MbMesh Polygonal Object
The MbMesh class is declared in the mesh.h file.
The MbMesh polygonal object is derived from the MbItem class and is described by a set of triangulations RPArray< MbGrid > grids, a set of polygons RPArray< MbPolygon3D > wires, a set of apexes RPArray< MbApex3D > peaks, a pointer to the original object MbRefItem item, the type, a bounding cube cube, and the closed flag closed.
A polygonal object is a set of triangular and quadrilateral plates, polyline segments, and individual points. One of the ways to construct a polygonal object is to approximate other geometric model objects, for example, a solid. Each i -th face of the solid is approximated by the triangulation grids[i], each j-th edge of the solid is approximated by the polygon wires[j], each k-th vertex of the solid corresponds to the apex peaks[k], and the closed flag closed corresponds to whether the solid is closed. Another way to obtain a polygonal object is to import data using a polygonal representation converter.
The MbGrid triangulation represents a set of points SArray< MbFloatPoint3D > points, the corresponding set of normals SArray< MbFloatVector3D > normals (the number of points equals the number of normals), a set of two-dimensional points of the parametric domain of the surface SArray< MbFloatPoint > params (the number of two-dimensional points equals the number of three-dimensional points or is zero – the set may be empty), a set of triangular plates SArray< MbTriangle > triangles as three indices of the points set, and a set of quadrilateral plates SArray< MbQuadrangle > quadrangles as four indices of the points set. The plates of the triangulation approximate a certain surface.
The MbPolygon3D polygon represents an ordered set of points whose successive connection produces a polyline approximating a certain curve.
The MbApex3D apex represents a point endowed with additional data.
The pointer to the original object item may be null, and the type may be undefined.
A vector image of a polygonal object is shown in Fig. 1.
Fig. 1
A shaded image of a polygonal object is shown in Fig. 2.
Fig. 2
Individual triangles of the object are visible in the figure because the normal direction is constant in each triangle. If the normal direction in the triangles of the triangulation changes continuously, individual triangles of the object become invisible, see Fig. 3.
Fig. 3
A polygonal object can be created by the MbItem:: CreateMesh() method or by the MbItem:: AddYourMesh() method. A polygonal object is used for visualization, computations, and manufacturing of modeled objects. The main advantage of a polygonal object is its simplicity and high computational speed, for example, for intersection with a line.