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

Method nextEdge

source/MRMesh/MRReducePath.cpp:517–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517bool TriangleStripUnfolder::nextEdge( MeshEdgePoint & e2 )
518{
519 assert( !e2.inVertex() );
520
521 Vector2f o2, d2;
522 strip_.getLastEdge( d2, o2 );
523 Vector3f v[3];
524 const EdgeId pl = mesh_.topology.prev( lastEdge_ );
525 // orient e2 to have last edge at left
526 if ( pl == e2.e.sym() )
527 e2 = e2.sym();
528 if ( pl == e2.e )
529 {
530 mesh_.getLeftTriPoints( e2.e, v[0], v[1], v[2] );
531 Vector2f x2 = o2 + unfoldOnPlane( v[2] - v[0], v[1] - v[0], d2 - o2, false );
532 strip_.nextEdgeNewLeft( x2 );
533 lastEdge_ = pl;
534 return true;
535 }
536
537 const EdgeId nl = mesh_.topology.next( lastEdge_.sym() ).sym();
538 // orient e2 to have last edge at left
539 if ( nl == e2.e.sym() )
540 e2 = e2.sym();
541 if ( nl == e2.e )
542 {
543 mesh_.getLeftTriPoints( e2.e, v[0], v[1], v[2] );
544 Vector2f x2 = o2 + unfoldOnPlane( v[1] - v[2], v[0] - v[2], d2 - o2, false );
545 strip_.nextEdgeNewRight( x2 );
546 lastEdge_ = nl;
547 return true;
548 }
549 return false;
550}
551
552void TriangleStripUnfolder::find( const MeshTriPoint & end, std::function< void(float) > edgeCrossPosition )
553{

Callers 1

reducePathFunction · 0.80

Calls 9

unfoldOnPlaneFunction · 0.85
getLastEdgeMethod · 0.80
getLeftTriPointsMethod · 0.80
nextEdgeNewLeftMethod · 0.80
nextEdgeNewRightMethod · 0.80
inVertexMethod · 0.45
prevMethod · 0.45
symMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected