The source project of this merge request has been removed.
Chain multiple polylines.
Bug: vtkStripper is unable to chain 2 or more polylines that are contiguous.
To reproduce:
- Explore state file attached in this post.
Fix:
Maintain a dictionary; given an endpoint, all incident/outgoing polyline ids can be found. Traverse such a graph following these steps:
currentChain
: a polyline (list of verts) that is currently being accumulated.
chaining = currentChain.size()
if not chaining:
start a new chain
traverse currentChain until it's end. (flip traversal if needed)
if other routes exist, set hints to the next chain and continue..
if all nodes have not yet been visited, capture currentChain, reset its verts and continue..
else break
Apart from the existing test case, an additional unit-test was introduced to ensure multiple polylines can be chained if they're contiguous.