| 807 | } |
| 808 | |
| 809 | HoleFillPlan 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 | |
| 838 | HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params ) |
| 839 | { |
no test coverage detected