Constructing a Symmetrical Body

The function

MbResultType SymmetrySolid(       MbSolid &               solid,
                                  MbeCopyMode             sameShell,
                            const MbSymmetrySolidParams & symParams,
                                  c3d::SolidSPtr &        result );

constructs a symmetrical body with a given symmetry plane.

The input parameters of the function are:

  • solid – the original body;

  • sameShell – the copying mode of the original body;

  • symParams – the parameters of the operation.

The output parameter of the function is the constructed body result.

The function returns an operation result code from the MbResultType enumeration.

The function is declared in the action_solid.h file.

The parameter sameShell can take one of four values:

  • cm_Same = 0 (the shell is not copied);

  • cm_KeepHistory (the original shell and its copy have common base surfaces, vertices and faces unchanged by the operation);

  • cm_KeepSurface (the original shell and its copy have common base surfaces);

  • cm_Copy (the original shell and its copy have no common data).

The enumeration MbeCopyMode is described in section Copying a Set of Faces MbFaceShell.

In the MbSymmetrySolidParams class, the following constructor is defined to initialize the object symParams (see op_shell_parameter.h):

MbSymmetrySolidParams( const MbPlacement3D & place,
                       const MbSNameMaker &  operNames,
                             ThreeStates     side );

where

  • place – the local coordinate system;

  • side – the retained part of the original body relative to the symmetry plane (+1 for the part above the plane, -1 for the part below the plane);

  • operNames – the namer for faces, edges and vertices of the constructed body.

If the parameter symParams.side = 1, the function creates a symmetrical body with respect to the specified symmetry plane as follows: the source body is cut by the XY-plane of the local coordinate system, the part of the source body located in the positive direction of the Z-axis from this plane is taken, a mirror copy of the selected part of the source body is constructed and then united with the selected part.

If symParams.side = -1, the function unites the part of the source body located in the negative direction of the Z-axis from the XY-plane of the local coordinate system with the mirror copy of this part with respect to the symmetry plane.

The parameter operNames provides naming for faces, edges and vertices of the constructed body.

Fig. 1 shows the original body solid and the symmetry plane place:

../../../../_images/M.2.9.1.png

Fig. 1

Fig. 2 shows the constructed body result:

../../../../_images/M.2.9.2.png

Fig. 2

Fig. 3 shows the constructed body result for a symmetry plane with opposite normal:

../../../../_images/M.2.9.3.png

Fig. 3

Fig. 4 shows the original body solid and the symmetry plane place, which do not intersect:

../../../../_images/M.2.16.1.png

Fig. 4

Fig. 5 shows the original body solid and the constructed mirror body result:

../../../../_images/M.2.16.2.png

Fig. 5

The function SymmetrySolid() adds to the operation log of the constructed body the builder MbSymmetrySolid, which contains all necessary data for performing the operation. The builder MbSymmetrySolid is declared in the file cr_symmetry_solid.h.

In the test application test.exe, constructing a symmetrical body is performed using the menu command “Create→Solid→Based on a solid→Symmetric”.