Skip to content

Feature ArrayFromShape

DeepSOIC edited this page Jan 1, 2016 · 1 revision

Feature (document object)

ArrayFromShape feature creates an array of placements from a set of shapes (packed into a compound).

ArrayFromShape can extract placements of objects, as they were when packed. Or, it can calculate a new placements based on shapes, for example by taking a vertex, or by aligning to inertial properties such as center of mass and principal axes.

ArrayFromShape feature is also used by "Single Placement: linked to shape" command.

Properties

CompoundTraversal

Sets how to extract children from the shape. Possible values:

  • Use as a whole: the shape is used as a whole, no matter if it is a compound or not. One placement is output.
  • Direct children only (default): subcompounds are treated as whole objects.
  • Recursive: subcompounds are unpacked, to obtain every leaf in a compounding tree.

OrientMode, OrientElementIndex

OrientMode sets, how orientation parts (aka rotations) for the placements are generated. Possible values:

  • (none): Orientations output are trivial (not obtained from the shape in any way).
  • parent: orientation of the compound as a whole is copied (that is, orientation is copied from Placement property of object linked by 'ShapeLink' property).
  • child (default): orientation of child is extracted from within the compound. These are usually preserved from the point the shape was introduced into the compound (However, it is known, that placements of points in compounds are lost after save-restore; placements are also often reset when a compound undergoes a boolean operation).
  • child.InertiaAxes: Axes of inertia are used to build the orientation (in these axes, inertia tensor is diagonal; two of these axes are those which give minimal and maximal values of moment of inertia). Note that for highly symmetric objects like Cube, inertia axes are undefined, and the orientation results from calculation errors, so is fairly random. Calculation of inertia axes from compounds is not supported yet (that is, child cannot be a subcompound).
  • child.Edge: Placement's X axis is aligned to follow an edge of the child; the index of the edge is supplied by OrientElementIndex (zero-based indexing). Other axes are oriented automatically (with Z axis tending to point along global Z).
  • child.FaceAxis: Placement's X axis is aligned along face normal vector; the index of the face is supplied by OrientElementIndex (zero-based indexing). Other axes are oriented automatically (with Z axis tending to point along global Z).

ShapeLink

Shape to extract/derive placements from. Can be just a shape, or a compound.

TranslateMode, TranslateElementIndex

TranslateMode sets, how translational parts for the placements are generated. Possible values:

  • (none): translations are zero (not obtained from the shape in any way).
  • parent: translational part of placement of the compound as a whole is copied (that is, Position is copied from Placement property of object linked by 'ShapeLink' property).
  • child (default): translational part of placement of child is extracted from within the compound. These are usually preserved from the point the shape was introduced into the compound (However, it is known, that placements of points in compounds are lost after save-restore; placements are also often reset when a compound undergoes a boolean operation).
  • child.CenterOfMass: as the value suggests.
  • child.CenterOfBoundingBox: : as the value suggests.
  • child.Vertex: the translational part is matched to a vertex; the index of the vertex is supplied by TranslateElementIndex (zero-based indexing).

(click the title)

GUI Command (toolbar button)

There are two commands that create ArrayFromShape feature: "Array from compound" and "Single Placement: linked to shape".

"Array from compound" aka "ArrayFromShape" command

feat-arrayfromshape.files/ArrayFromShapeToolbar.png

Select an object that is a compound, and invoke the command. An array is created with default settings. Select the new feature, and edit properties to get what you want.

"Single Placement: linked to shape"

Select an object, and invoke the command. By default, a placement object is created, which is linked to Placement property of selected object. The behavior can be modified by altering properties.

Clone this wiki locally