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

Function lastCommonEdge

source/MRMesh/MRReducePath.cpp:79–95  ·  view source on GitHub ↗

finds an edge originated from v, which is located in the same triangle as p, and next edge does not satisfy this property

Source from the content-addressed store, hash-verified

77
78// finds an edge originated from v, which is located in the same triangle as p, and next edge does not satisfy this property
79static EdgeId lastCommonEdge( const MeshTopology & topology, VertId v, const MeshTriPoint & p )
80{
81 EdgeId e0 = commonEdge( topology, v, p );
82 if ( !e0 )
83 return {};
84 for ( int i = 0; i < 2; ++i )
85 {
86 EdgeId e1 = topology.next( e0 );
87 MeshTriPoint mtp0( p );
88 MeshTriPoint mtp1( e1, { 0.5f, 0.0f } );
89 if ( fromSameTriangle( topology, mtp0, mtp1 ) )
90 e0 = e1;
91 else
92 break;
93 }
94 return e0;
95}
96
97// finds an edge originated from v, which is located in the same triangle as p, and prev edge does not satisfy this property
98static EdgeId firstCommonEdge( const MeshTopology & topology, VertId v, const MeshTriPoint & p )

Callers 1

reducePathViaVertexFunction · 0.85

Calls 3

commonEdgeFunction · 0.85
fromSameTriangleFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected