@@ -1871,6 +1871,7 @@ edges should be already cut */
1871
1871
void fixOrphans ( Mesh& mesh, const std::vector<EdgePath>& paths, const FullRemovedFacesInfo& removedFaces, FaceMap* new2OldMap, NewEdgesMap* new2OldEdgeMap )
1872
1872
{
1873
1873
1874
+ MR_TIMER;
1874
1875
auto fixOrphan = [&]( EdgeId e, FaceId oldF )
1875
1876
{
1876
1877
if ( mesh.topology .left ( e ).valid () ||
@@ -2119,6 +2120,7 @@ void cutEdgesIntoPieces( Mesh& mesh,
2119
2120
2120
2121
void prepareFacesMap ( const MeshTopology& topology, FaceMap& new2OldMap )
2121
2122
{
2123
+ MR_TIMER;
2122
2124
new2OldMap.resize ( topology.lastValidFace () + 1 );
2123
2125
for ( auto f : topology.getValidFaces () )
2124
2126
new2OldMap[f] = f;
@@ -2129,6 +2131,7 @@ void prepareFacesMap( const MeshTopology& topology, FaceMap& new2OldMap )
2129
2131
FaceBitSet getBadFacesAfterCut ( const MeshTopology& topology, const PreCutResult& preRes,
2130
2132
const FullRemovedFacesInfo& oldFaces )
2131
2133
{
2134
+ MR_TIMER;
2132
2135
FaceBitSet badFacesBS ( topology.getValidFaces ().size () );
2133
2136
EdgeBitSet visited ( topology.edgeSize () );
2134
2137
for ( int pathId = 0 ; pathId < preRes.paths .size (); ++pathId )
@@ -2160,7 +2163,7 @@ FaceBitSet getBadFacesAfterCut( const MeshTopology& topology, const PreCutResult
2160
2163
CutMeshResult cutMesh ( Mesh& mesh, const OneMeshContours& contours, const CutMeshParameters& params )
2161
2164
{
2162
2165
MR_TIMER;
2163
- MR_WRITER ( mesh );
2166
+ mesh. invalidateCaches ( );
2164
2167
CutMeshResult res;
2165
2168
if ( params.new2OldMap )
2166
2169
prepareFacesMap ( mesh.topology , *params.new2OldMap );
@@ -2169,6 +2172,7 @@ CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMes
2169
2172
2170
2173
if ( params.new2oldEdgesMap )
2171
2174
{
2175
+ Timer t ( " new2oldEdgesMap" );
2172
2176
for ( int i = 0 ; i < preRes.paths .size (); ++i )
2173
2177
{
2174
2178
for ( int j = 0 ; j < preRes.paths [i].size (); ++j )
@@ -2186,6 +2190,7 @@ CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMes
2186
2190
return res;
2187
2191
2188
2192
// find one edge for every hole to fill
2193
+ Timer t ( " find edge per hole" );
2189
2194
HashSet<EdgeId> allHoleEdges;
2190
2195
struct HoleDesc
2191
2196
{
@@ -2221,8 +2226,9 @@ CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMes
2221
2226
addHoleDesc ( path[edgeId].sym (), oldf );
2222
2227
}
2223
2228
}
2229
+
2224
2230
// prepare in parallel the plan to fill every contour
2225
- Timer t ( " get TriangulateContourPlans" );
2231
+ t. restart ( " get TriangulateContourPlans" );
2226
2232
tbb::parallel_for ( tbb::blocked_range<size_t >( 0 , holeRepresentativeEdges.size () ),
2227
2233
[&]( const tbb::blocked_range<size_t >& range )
2228
2234
{
0 commit comments