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

Function makeBridgeEdge

source/MRMesh/MRMeshFillHole.cpp:1297–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1295}
1296
1297EdgeId makeBridgeEdge( MeshTopology & topology, EdgeId a, EdgeId b )
1298{
1299 assert( !topology.left( a ) );
1300 assert( !topology.left( b ) );
1301 if ( topology.fromSameOriginRing( a, b ) )
1302 {
1303 // org(a) and org(b) is the same vertex, so we cannot create a loop edge
1304 return {};
1305 }
1306
1307 const auto bOrg = topology.org( b );
1308 for ( auto e : orgRing( topology, a ) )
1309 {
1310 if ( topology.dest( e ) == bOrg )
1311 {
1312 // there is an edge between org(a) and org(b), so if create another one, then multiple edges appear
1313 return {};
1314 }
1315 }
1316
1317 auto res = topology.makeEdge();
1318 topology.splice( a, res );
1319 topology.splice( b, res.sym() );
1320 return res;
1321}
1322
1323} //namespace MR

Callers 3

TESTFunction · 0.85
fillPlanarHoleFunction · 0.85
connect_Method · 0.85

Calls 8

orgRingFunction · 0.85
leftMethod · 0.80
fromSameOriginRingMethod · 0.80
orgMethod · 0.45
destMethod · 0.45
makeEdgeMethod · 0.45
spliceMethod · 0.45
symMethod · 0.45

Tested by 1

TESTFunction · 0.68