Extension of Body Face

The function

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 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:

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 MbExtensionShellParams::Add methods):

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 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 MbeCopyMode enumeration is given in section Copying a Set of Faces.

The params object of the ExtensionValues class defines face extension methods and contains the data shown in Fig. 1:

../../../../_images/M.1.16.1.png

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:

../../../../_images/M.1.16.2.png

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:

../../../../_images/M.1.16.3.png

Fig. 3

../../../../_images/M.1.16.4.png

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:

../../../../_images/M.1.16.5.png

Fig. 5

../../../../_images/M.1.16.6.png

Fig. 6

The ExtensionShell() function adds the MbExtensionShell builder, which contains all construction data, into the body log. The MbExtensionShell constructor is declared in the cr_extension_shell.h file.