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

Function patchMesh

source/MRMesh/MRMeshPatch.cpp:10–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8{
9
10FaceBitSet patchMesh( Mesh& mesh, const FaceBitSet& patchBS, const FillHoleNicelySettings& settings /*= {} */ )
11{
12 MR_TIMER;
13 FaceBitSet newFaces;
14 auto bounds = delRegionKeepBd( mesh, patchBS );
15 auto s = settings;
16 for ( const auto& bd : bounds )
17 {
18 if ( bd.empty() )
19 continue;
20 auto avgLength = calcPathLength( bd, mesh ) / bd.size();
21 if ( settings.subdivideSettings.maxEdgeLen <= 0.0f )
22 s.subdivideSettings.maxEdgeLen = float( avgLength ) * 1.5f;
23 if ( !mesh.topology.left( bd[0] ) )
24 newFaces |= fillHoleNicely( mesh, bd[0], s );
25 }
26 return newFaces;
27}
28
29}

Callers 3

onMouseUp_Method · 0.85
eliminateTunnelsFunction · 0.85
fixMeshDegeneraciesFunction · 0.85

Calls 6

delRegionKeepBdFunction · 0.85
calcPathLengthFunction · 0.85
fillHoleNicelyFunction · 0.85
leftMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected