| 515 | } |
| 516 | |
| 517 | bool 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 | |
| 552 | void TriangleStripUnfolder::find( const MeshTriPoint & end, std::function< void(float) > edgeCrossPosition ) |
| 553 | { |
no test coverage detected