.. role:: blue :class: blue Extension of Body Face ====================== .. _Extension_of_Body_Face_: .. kernel version: 118041 The function .. code-block:: cpp MbResultType ExtensionShell( MbSolid & solid, MbeCopyMode sameShell, const MbExtensionShellParams & params, c3d::SolidSPtr & result ); creates a non-closed body by extending the border edges of a selected body face. The function's input parameters are: - **solid** is an original body; - **sameShell** is the copy mode for the original body; - **params** is an object containing the construction parameters of the operation. The :blue:`MbExtensionShellParams` class defines two constructors to initialize **params** objects with operation parameters: The constructor for extending a non-closed body by extrusion for a given set of edges: .. code-block:: cpp MbExtensionShellParams( const c3d::EdgesSPtrVector & edges, const ExtensionValues & params, const MbSNameMaker & operNames ); The constructor for extending a non-closed body by extrusion without specifying edges (the edges are specified by the appropriate :blue:`MbExtensionShellParams::Add methods`): .. code-block:: cpp MbExtensionShellParams( const ExtensionValues & params, const MbSNameMaker & operNames ); where - **edges** is a set of border edges through which the extension is performed; - **params** is an object containing operation parameters; - **operNames** is the namer of the operation. The output parameter of the function is **result**, which contains the constructed body. The function returns a result code of the operation from the :blue:`MbResultType` enumeration (see *mb_operation_result.h*). The function is declared in *action_shell.h* file. The **sameShell** parameter controls transfer of faces, edges and vertices from the **solid** original body to the **result** constructed body. This parameter can take one of four values: - *cm_Same* = 0 (the shell is not copied); - *cm_KeepHistory* (the original shell and its copy share base surfaces, vertices, and faces unchanged by the operation); - *cm_KeepSurface* (the original shell and its copy share base surfaces); - *cm_Copy* (the original shell and its copy have no shared data). A detailed description of the :blue:`MbeCopyMode` enumeration is given in section :ref:`Copying a Set of Faces `. The **params** object of the :blue:`ExtensionValues` class defines face extension methods and contains the data shown in Fig. 1: .. figure:: /MODELER/METHODS_OF_SOLID_BUILDING/pictures/M.1.16.1.png :width: 12cm :align: center Fig. 1 There are three types of face extension. The **params**.\ *type* parameter defines the extension type: - If **params**.\ *type* = *et_same*, the original **face** is extended by expanding its surface parameter domain and offsetting border **edges**; - If **params**.\ *type* = *et_tangent*, new faces are smoothly joined to the face through the **edges**; - If **params**.\ *type* = *et_direction*, new faces are joined to **face** of the original body using **edges**. New faces are received by extruding the curved **edges** in **params**.\ *direction*. The **params**.\ *way* parameter defines the extension distance for the **face**. - If **params**.\ *way* = *ew_distance*, then the face is extended by **params**.\ *distance*; - If **params**.\ *way* = *ew_vertex*, then the face is extended to the vertex defined by **params**.\ *point*; - If **params**.\ *way* = *ew_shell*, then the face is extended up to **params**.\ *shell*. If **params**.\ *way* ≠ *ew_shell*, then **params**.\ *shell* can be null. The **params**.\ *faceIndex* parameter sets an face index of **params**.\ *shell* used for extension to the shell. The **params**.\ *kind* parameter defines how the borders of extension faces are trimmed in the beginning and in the end of each edge of **edges** set. - If **params**.\ *kind* = *le_normal*, then **face** extension border is cut along the normal to the corresponding edge of **edges** set; - If **params**.\ *kind* = *le_prolong*, then the border of the **face** extension is defined by the edges adjacent to the edges of the **edges** set. The **params**.\ *output* parameter defines the representation options for the resulting body: - If **params**.\ *output* = *eo_Original*, then the original faces of the body are extended; - If **params**.\ *output* = *eo_newFace*, then the extension result is formed as new faces; - If **params**.\ *output* = *eo_newShell*, the extension result is formed as a new shell. The **params**.\ *toShellType* parameter defines the extension method to a shell: - If **params**.\ *toShellType* = *sot_ToShell*, then the extension is performed to the shell; - If **params**.\ *toShellType* = *sot_ThroughShellLayer*, then the extension is performed through the first layer of the shell (before the first exit from the shell); - If **params**.\ *toShellType* = *sot_ToShellWithoutCut*, then the extension is performed to the shell without trimming. The **operNames** parameter is used to name faces, edges and vertices of the constructed body. Fig. 2 shows the body face, the two border edges of which will be extended: .. figure:: /MODELER/METHODS_OF_SOLID_BUILDING/pictures/M.1.16.2.png :width: 12cm :align: center Fig. 2 Fig. 3 and 4 show the results of face extension by expanding the surface parameter domain using various values of **params**.\ *kind* parameter: .. figure:: /MODELER/METHODS_OF_SOLID_BUILDING/pictures/M.1.16.3.png :width: 12cm :align: center Fig. 3 .. figure:: /MODELER/METHODS_OF_SOLID_BUILDING/pictures/M.1.16.4.png :width: 12cm :align: center Fig. 4 Fig. 5 shows the result of **face** extension by adding other faces that smoothly join with **face**. Fig. 6 shows the result of extending **face** in the selected direction: .. figure:: /MODELER/METHODS_OF_SOLID_BUILDING/pictures/M.1.16.5.png :width: 11cm :align: center Fig. 5 .. figure:: /MODELER/METHODS_OF_SOLID_BUILDING/pictures/M.1.16.6.png :width: 11cm :align: center Fig. 6 The :blue:`ExtensionShell`\() function adds the :blue:`MbExtensionShell` builder, which contains all construction data, into the body log. The :blue:`MbExtensionShell` constructor is declared in the *cr_extension_shell.h* file.