Constructing Polygons for an Object
The virtual method of three-dimensional geometric objects
void MbSpaceItem::CalculateWire( double sag,
MbMesh & mesh );
fills the supplied polygonal object mesh with a set of polygons that approximate the geometric object.
The input parameter of the method is sag – the maximum allowable deviation of a polygonal element from the original by sag.
The output parameter of the method is the polygonal object mesh.
The method is declared in the space_item.h file and in the header files of MbSpaceItem inheritors.
The polygonal object is described in the subsection MbMesh Polygonal Object. The sag parameter defines the maximum allowable distance between the object and the polyline passing through the polygon points. This method fills only the set of polygon pointers mesh.wires (polylines).
The method approximates a curve with a single polygon. It approximates a contour with several polygons, each passing along the corresponding contour segment. Fig. 1 shows a curve and its polygonal object consisting of a single polygon.
Fig. 1
The method approximates a surface with a set of polygons passing along u-lines, v-lines and along the surface boundary. Fig. 2 shows a polygonal object of a surface consisting of several polylines.
Fig. 2
The method approximates a solid with a set of polylines passing inside each face along the u-lines and v-lines of the face surfaces and with a set of polylines approximating the curves on which the solid edges are based. Fig. 3 (right) shows a polygonal object of a solid:
Fig. 3
For geometric model objects, this method works similarly to the CalculateMesh() method when stepData.stepType == ist_SpaceStep, stepData.sag == sag, note.wire == true, note.seam == true.