Extensions:2.6/Py/Scripts/Mesh/VolumeTools

提供: wiki
< Extensions:2.6‎ | Py‎ | Scripts‎ | Mesh
2013年3月15日 (金) 03:34時点におけるwiki>Letheによる版
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索
VolumeTools
Various operators related to volume
UI location Operators: Volume, Record Volume, Split Volume, Record Split Volume
Version 1.0 Author(s) Tom SF Haines
Blender 2.63 License GPL


Executable information
File name mesh_volume_tools.py
Current version download http://projects.blender.org/tracker/download.php/153/467/32555/22041/mesh_volume_tools.py


Links thaines.com


Provides four operators, all related to the volume of a mesh - the most basic provides the volume of a mesh. Also provides an operator to position a plane to satisfy a volume-based invariant relative to a mesh, i.e. the volume above/below the plane or the ratio between the two. Animation variants of these operators are provided, so you can get the volume during an animation (As an animated object property.) or animate a plane to maintain an invariant. This is typically used to position water planes in containers, for when a full simulation is overkill/unwanted e.g. a saline bag, which deforms when being picked up (All kinds of mesh animation are supported).

After installing the script you may access these operators by hitting 'space' and typing in the name of the operator you want - these are the 4 subheadings below. Note that the operator will only be available if a valid selection of objects, as described below, is made.


Volume:

Calculates the volume of a well defined mesh - the output appears momentarily on the top bar, but is also written to the custom property of the selected object, in the variable 'volume' A well defined mesh is one with no holes, and no stray vertices/edges where the normals all point outwards and the geometry does not intersect with itself. Multiple separate chunks are acceptable as long as they do not intersect. Most likely users of this are people who use Blender to create meshes for 3D printers, to estimate the material required.

Record Volume:

Does exactly what volume does, but calculates it for every frame in the animation, and creates an animated custom property on the object with the name 'volume' - you can then see how the property changes as the animation is run, or use it to drive something. Added this because I could - not really sure what it could be used for. Possibly useful to drive a gauge on some complex machine? Might have a debugging use when animating an object that should not change volume.

Split Volume:

You select two objects - first a well defined mesh, then an arbitrary object that represents a plane. The plane can be any actual object - it assumes a plane in the x-y axes, which happens to match up with the plane provided by Blender. Note however that this is a true plane, i.e. infinite. The plane can then split the mesh in half, defining a volume above and a volume below the mesh (above is the positive z direction, below the negative z direction.). You define one of 3 custom properties on the plane object:

* below - Contains your desired volume below the plane.
* above - Contains your desired volume above the plane.
* ratio - Defines how much of the volume should be below the plane in terms of the total volume, i.e. below = ratio * total_volume.

This operator then moves the plane the shortest distance to satisfy the constraint. In the event it is not possible to satisfy it the plane will end up at the extremity of the object that is closest to satisfying it. Main use is in testing values to find good ones to use for the below operator on the current frame.

Record Split Volume:

Does the exact same thing as split volume, except it makes the adjustment for every frame of the animation range and records the objects location in each position. Note that if you animate the custom properties of the plane (below, above or ratio.) it will satisfy the constraint for the correct animated term. Basically good if you want to model something related to volume, typically where the volume is held constant as something deforms. Most obvious example is water in a deforming container (Which can simply be a rotating container.). Every possible deformation is supported. The animation means you could fill an object with water at a constant rate accounting for the strange shape of the object - not the same as a real water simulation, but potentially useful in cases when that would be overkill, or problematic due to technical limitations (e.g. transparent container.).