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

Method runPlanar

source/MRMesh/MRMeshFillHole.cpp:809–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809HoleFillPlan HoleFillPlanner::runPlanar( const Mesh& mesh, EdgeId e, bool allowSweptLine )
810{
811 if ( allowSweptLine )
812 {
813 int holeSize = 0;
814 for ( [[maybe_unused]] auto _ : leftRing( mesh.topology, e ) )
815 if ( ++holeSize >= cMinSweptHoleSize )
816 break; // fast break when we OK with hole size
817
818 if ( holeSize >= cMinSweptHoleSize )
819 {
820 // only use this for large holes
821 auto exRes = fillContours2DPlan( mesh, e );
822 if ( exRes.has_value() )
823 return *exRes;
824 }
825 }
826
827 bool stopOnBad{ false };
828 FillHoleParams params;
829 params.metric = getPlaneNormalizedFillMetric( mesh, e );
830 params.stopBeforeBadTriangulation = &stopOnBad;
831
832 auto res = run( mesh, e, params );
833 if ( stopOnBad ) // triangulation cannot be good if we fall in this `if`, so let it create degenerated faces
834 res = run( mesh, e, { getMinAreaMetric( mesh ) } );
835 return res;
836}
837
838HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params )
839{

Callers 2

getPlanarHoleFillPlanFunction · 0.80
getPlanarHoleFillPlansFunction · 0.80

Calls 4

leftRingFunction · 0.85
fillContours2DPlanFunction · 0.85
getMinAreaMetricFunction · 0.85

Tested by

no test coverage detected