Stiching Body Faces
MbeStitchResType StitchShells( const c3d::SolidsSPtrVector & initialSolids,
const MbShellStitchParams & stitchParams,
c3d::SolidSPtr & resultSolid );
performs stitching of interlocking faces of several solids into one solid (the face orientation can be changed). The function is declared in the file action_shell.h.
The input parameters of the function are:
initialSolids - set of solids for stitching;
stitchParams - shell stitching parameters, which include the following:
_nameMaker is the operation’s namer;
_stitchAccuracy is the stitching accuracy (accuracy of finding paired edges);
_formSolidBody is the flag of forming a solid from a resulting shell;
_mergeEdges is the merging of similar edges (true).
The output parameter of the method is the constructed solid or the shell resultSolid (depending on the _formSolidBody flag). If the parameter _formSolidBody = true, the constructed solid resultSolid is checked for absence of boundary edges, nested shells are searched and internal shells are reoriented if necessary. If the parameter _formSolidBody = false, then boundary edges are allowed in the constructed resultSolid solid, and the definition of shell nesting is not performed.
The function returns the operation result code from the MbeStitchResType enumeration (see mb_operation_result.h):
stch_Success — the operation was completed successfully.
stch_PrepareError — error when preparing a stitching operation.
stch_CoorientFaceError — unable to set coordinated orientation of faces.
stch_SomeEdgesUnstitched — some edges are still unstitched.
stch_OutwardOrientError — failed to set face normals to the outside of the solid;
stch_NoEdgeWasStitched — no edges were stitched.
stch_SeparatePartsResult — there are still unconnected pieces after stitching;
stch_EdgeStitchError — error of the edge stitching.
stch_InputTopologyError — critical topology errors in input shells.
The function searches pairs of boundary edges that correspond to each other in length and location, and constructs the intersection curve of faces of the found edge in the given area. After successful construction of the intersection curve, a pair of boundary edges is replaced by a single edge connecting adjacent faces of the solids. If necessary, the function reorients the outer side of some faces. The set initialSolids can contain any finite number of solids.
Figure 1 shows two stitchable solids - solids [0] и solids [1]. Figure 2 shows the constructed solid resultSolid:
Fig. 1
Fig. 2
The StitchShells() function adds the MbStitchedSolid builder to the built solid log, which contains all the necessary data for the solid building. The MbStitchedSolid builder is declared in the cr_stitch_solid.h file.