| 11 | { |
| 12 | |
| 13 | FaceBitSet findOuterLayer( const Mesh & mesh ) |
| 14 | { |
| 15 | MR_TIMER; |
| 16 | const auto szFaces = mesh.topology.faceSize(); |
| 17 | FaceBitSet innerSeeds( szFaces ), outerSeeds( szFaces ); |
| 18 | BitSetParallelFor( mesh.topology.getValidFaces(), [&]( FaceId f ) |
| 19 | { |
| 20 | const auto n = mesh.normal( f ); |
| 21 | const auto c = mesh.triCenter( f ); |
| 22 | const bool outer = !rayMeshIntersect( mesh, Line3f{ c, n }, 0.0f, FLT_MAX, nullptr, false, [f]( FaceId t ) { return t != f; } ); |
| 23 | const bool inner = !rayMeshIntersect( mesh, Line3f{ c,-n }, 0.0f, FLT_MAX, nullptr, false, [f]( FaceId t ) { return t != f; } ); |
| 24 | if ( outer == inner ) |
| 25 | return; |
| 26 | if ( outer ) |
| 27 | outerSeeds.set( f ); |
| 28 | else |
| 29 | innerSeeds.set( f ); |
| 30 | } ); |
| 31 | return segmentByGraphCut( mesh.topology, outerSeeds, innerSeeds, edgeLengthMetric( mesh ) ); |
| 32 | } |
| 33 | |
| 34 | } //namespace MR |
nothing calls this directly
no test coverage detected