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

Function findOuterLayer

source/MRMesh/MRMeshDoubleLayer.cpp:13–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13FaceBitSet 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

Callers

nothing calls this directly

Calls 8

BitSetParallelForFunction · 0.85
rayMeshIntersectFunction · 0.85
segmentByGraphCutFunction · 0.85
edgeLengthMetricFunction · 0.85
faceSizeMethod · 0.80
normalMethod · 0.80
triCenterMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected