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

Function preparePart

source/MRMesh/MRBooleanOperation.cpp:114–145  ·  view source on GitHub ↗

deletes unnecessary part from the mesh

Source from the content-addressed store, hash-verified

112
113/// deletes unnecessary part from the mesh
114VacantElements preparePart( Mesh& mesh, const FaceBitSet& leftPart,
115 bool needFlip, BooleanResultMapper::Maps* maps )
116{
117 MR_TIMER;
118
119 auto rightPart = mesh.topology.getValidFaces() - leftPart;
120 auto res = mesh.deleteFaces( rightPart );
121 if ( needFlip )
122 mesh.topology.flipOrientation();
123
124 if ( maps )
125 {
126 auto& fmap = maps->cut2newFaces;
127 if ( fmap.size() < mesh.topology.faceSize() )
128 fmap.resize( mesh.topology.faceSize() );
129 for ( auto f : mesh.topology.getValidFaces() )
130 fmap[f] = f;
131
132 auto& vmap = maps->old2newVerts;
133 if ( vmap.size() < mesh.topology.vertSize() )
134 vmap.resize( mesh.topology.vertSize() );
135 for ( auto v : mesh.topology.getValidVerts() )
136 vmap[v] = v;
137
138 auto& emap = maps->old2newEdges;
139 if ( emap.size() < mesh.topology.undirectedEdgeSize() )
140 emap.resize( mesh.topology.undirectedEdgeSize() );
141 for ( auto ue : undirectedEdges( mesh.topology ) )
142 emap[ue] = ue;
143 }
144 return res;
145}
146
147// transforms partB if needed and adds it to partA
148// stitches parts by paths if they are not empty

Callers 1

doBooleanOperationFunction · 0.85

Calls 8

faceSizeMethod · 0.80
undirectedEdgesFunction · 0.70
deleteFacesMethod · 0.45
flipOrientationMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
vertSizeMethod · 0.45
undirectedEdgeSizeMethod · 0.45

Tested by

no test coverage detected