Helper class to join tangent paths (polylines) together.
The algorithm performs the following tasks:
- Invalid paths (less than 2 vertices) are removed.
- Any already closed path is returned as-is.
- Any joined, closed paths are searched, starting with the longest path.
- Then joined, open paths are searched, starting with the longest path.
- Any remaining (non tangent) paths are returned as-is.
- Note
- If there are many possible solutions (many paths located at the same coordinate), finding the solution can take a lot of time. Therefore a timeout can be specified to abort a too long operation, then a non- optimal (but still valid) result is returned.