Version 0.55.1

Solid Analysis

During dynamic construction, it is often desirable to get certain information about a solid that turns up on run-time. This may be an object uploaded by the user or another dynamic construction that was is not statically available during the design process. trCAD contains a number of concepts to allow the scripter to derieve such information dynamically.

Empty State

The member solid.empty() of a solid can be used to check whether the solid variable has any content at all.

Bounding Boxes

One important concept is that of the minimal bounding box. This is the smallest axis-aligned box that covers the solid completely. The minimum bounding box is returned from the solid member solid.min_bbox() .

The member function returns a selectbox that has the dimensions of the respective bounding box.

The following example returns the width of a sphere in Y direction:

Example

solid s = sphere()
selectbox b = s.min_bbox()
echo( b.maxy - b.miny )

Output

1

Intersection Check

Function intersect () can be used to perform fast collision checks between two meshes. If the full intersection volume is required, it can be retrieved via a boolean intersection function (see Solid Boolean Operations ).

🗙

Search results for