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

Function findSelfContoursMapping

source/MRMesh/MRMeshBoolean.cpp:132–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 int secondRot{ 0 };
131};
132std::vector<JoinedSelfLoops> findSelfContoursMapping( const ContinuousContours& contours )
133{
134 assert( contours.size() % 2 == 0 );
135 std::vector<JoinedSelfLoops> holePairs( contours.size() / 2 );
136 BitSet visitedConts( contours.size(), true );
137 int i = 0;
138 while ( visitedConts.any() )
139 {
140 size_t first = visitedConts.find_first();
141 visitedConts.reset( first );
142 auto fInter = contours[first][0];
143 tbb::task_group_context ctx;
144 ParallelFor( visitedConts.beginId(), visitedConts.endId(), [&] ( size_t next )
145 {
146 if ( ctx.is_group_execution_cancelled() || !visitedConts.test( next ) )
147 return;
148 int rot = 0;
149 for ( const auto& nInter : contours[next] )
150 {
151 if ( ctx.is_group_execution_cancelled() )
152 return;
153 ++rot;
154 if ( fInter.isEdgeATriB() == nInter.isEdgeATriB() )
155 continue;
156 if ( fInter.tri() != nInter.tri() )
157 continue;
158 if ( fInter.edge != nInter.edge.sym() )
159 continue;
160 if ( ctx.cancel_group_execution() )
161 {
162 visitedConts.reset( next );
163 holePairs[i++] = { int( first ),int( next ),rot - 1 };
164 }
165 return;
166 }
167 } );
168 }
169 return holePairs;
170}
171
172enum LoneProccessingState
173{

Callers 2

subdivideSelfLoneFunction · 0.85
selfBooleanFunction · 0.85

Calls 11

ParallelForFunction · 0.85
isEdgeATriBMethod · 0.80
triMethod · 0.80
sizeMethod · 0.45
anyMethod · 0.45
find_firstMethod · 0.45
resetMethod · 0.45
beginIdMethod · 0.45
endIdMethod · 0.45
testMethod · 0.45
symMethod · 0.45

Tested by

no test coverage detected