Version 0.59.0

solid

A general solid object.

The figure displays the function of the solid.split() method as 2d sketch. The initial solid is represented by the gray shapes on the left. Red arrows indicate the directions of surface normals on the four shells. The right side depicts the two solids that result from the solid.split() in blue and orange. Note how negative "bubble" shells are included into the orange solid.

Casts To

bool

'true' if the solid value has been defined, 'false' otherwise

Members

float area()

Returns the total surface area of the solid.

vector cm()

Returns the center of mass of the solid.
(Note that this value may be incorrect if the mesh representing the solid contains not-closed or overlapping shells.)

bool empty()

Returns 'true' if the solid contains one or more mesh triangle(s), 'false' if it contains no triangles and/or if it has not been defined.

int feature_count()

Returns the number of tesselation features (triangles) of a solid's representation. (Note that solids are represented by triangle meshes internally.)

bool has_holes()

Returns 'true' if the solid's mesh contains shells that are not closed (i.e. that are not "watertight") and 'false' otherwise. (See also modifier fill_holes .)

marker mark( vector pos )

Find the point on the solid's surface that is closest to point pos and attaches a marker at this point. The marker is then returned by the method.

selectbox min_bbox()

Returns the axis-aligned minimum bounding box of the solid.

vector[] min_bbox_axes()

Return a basis of three axes that define the coordinate system for the (non-axis-aligned) minimum bounding box. The axis in which the solid has its largest extension is the first in the array, followed by the axis with intermediate and smallest extension.

split()

Returns an array of solids that holds individual partial solids the solid consists of. A partial solid is defined as an independent shell mesh that may contain "negative" inward shells ("bubbles", see figure). This operation works most reliably for solids consisting of non-intersecting, closed shells. The solids are ordered by the center point and extension of their bounding boxes.

float volume()

Returns the volume of the solid.
(Note that this value may be incorrect if the mesh representing the solid contains not-closed or overlapping shells.)

🗙

Search results for