.. role:: blue :class: blue Constructing Polygons for an Object =================================== .. _Constructing_Polygons_for_an_Object_: .. kernel version: The virtual method of three-dimensional geometric objects .. code-block:: cpp 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 :blue:`MbSpaceItem` inheritors. The polygonal object is described in the subsection :ref:`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. .. figure:: ../../pictures/R.1.4.1.png :width: 9cm :align: center 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. .. figure:: ../../pictures/R.1.4.2.png :width: 9cm :align: center 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: .. figure:: ../../pictures/R.1.4.3.png :width: 15cm :align: center Fig. 3 For geometric model objects, this method works similarly to the :blue:`CalculateMesh`\() method when *stepData.stepType* == *ist_SpaceStep*, *stepData.sag* == *sag*, *note.wire* == true, *note.seam* == true.