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

Function firstCommonEdge

source/MRMesh/MRReducePath.cpp:98–114  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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 )
99{
100 EdgeId e0 = commonEdge( topology, v, p );
101 if ( !e0 )
102 return {};
103 for ( int i = 0; i < 2; ++i )
104 {
105 EdgeId e1 = topology.prev( e0 );
106 MeshTriPoint mtp0( p );
107 MeshTriPoint mtp1( e1, { 0.5f, 0.0f } );
108 if ( fromSameTriangle( topology, mtp0, mtp1 ) )
109 e0 = e1;
110 else
111 break;
112 }
113 return e0;
114}
115
116bool reducePathViaVertex( const Mesh & mesh, const MeshTriPoint & s, VertId v, const MeshTriPoint & e,
117 SurfacePath & outPath, std::vector<Vector2f> & tmp, SurfacePath& cachePath )

Callers 1

reducePathViaVertexFunction · 0.85

Calls 3

commonEdgeFunction · 0.85
fromSameTriangleFunction · 0.70
prevMethod · 0.45

Tested by

no test coverage detected