MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / connectPreparedParts

Function connectPreparedParts

source/MRMesh/MRBooleanOperation.cpp:150–176  ·  view source on GitHub ↗

transforms partB if needed and adds it to partA stitches parts by paths if they are not empty updates mapper

Source from the content-addressed store, hash-verified

148// stitches parts by paths if they are not empty
149// updates mapper
150void connectPreparedParts( Mesh& res, Mesh& partB, const FaceBitSet* bRegion, bool flipB,
151 const std::vector<EdgePath>& pathsA, const std::vector<EdgePath>& pathsB,
152 const AffineXf3f* rigidB2A, BooleanResultMapper* mapper, bool graphCut, VacantElements& vacant )
153{
154 MR_TIMER;
155
156 if ( rigidB2A )
157 partB.transform( *rigidB2A );
158
159 // use dense-maps inside addMesh(Part) instead of default hash-maps for better performance
160 FaceMap fmap;
161 WholeEdgeMap emap;
162 VertMap vmap;
163
164 FaceMap* fMapPtr = mapper ? &mapper->maps[int( BooleanResultMapper::MapObject::B )].cut2newFaces : &fmap;
165 WholeEdgeMap* eMapPtr = mapper ? &mapper->maps[int( BooleanResultMapper::MapObject::B )].old2newEdges : &emap;
166 VertMap* vMapPtr = mapper ? &mapper->maps[int( BooleanResultMapper::MapObject::B )].old2newVerts : &vmap;
167
168 if ( !graphCut )
169 {
170 res.addMeshPart( { partB,bRegion }, flipB, pathsA, pathsB, Src2TgtMaps( fMapPtr, vMapPtr, eMapPtr ), &vacant );
171 }
172 else
173 {
174 res.addMeshPart( { partB,bRegion }, flipB, {}, {}, Src2TgtMaps( fMapPtr, vMapPtr, eMapPtr ), &vacant );
175 }
176}
177
178} // anonymous namespace
179

Callers 1

doBooleanOperationFunction · 0.85

Calls 3

Src2TgtMapsClass · 0.85
addMeshPartMethod · 0.80
transformMethod · 0.45

Tested by

no test coverage detected