in reply to Re^3: Combine line segments to form a single line
in thread Combine line segments to form a single line
Nope!
You just have to handle the case that $next becomes undef and leave the loop.
The problem I rather see is to choose a starting point!
Simplest solution: you choose one arbitrary edge and walk in both directions.
Since %neighbour is symmetric this shouldn't be a problem, just swap the orientation of the start segment.
I'm on mobile and I want you to understand the algorithm...so no code. :)
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|