|
I think you are expecting too much of Manifold here. You are taking the points from each branch and combining them into one branch, but you are expecting Manifold to understand that what you intend is to generate a perimeter from these points by joining the shapes. Manifold is doing exactly what you ask: it is creating an area with one branch of points. It creates the first set of 5 points, then it crosses over to the other area and creates the next set of points, and then it crosses back to close the geometry. Your algorithm will only work (i.e., do what you intend) on very simple geometries where your points also happen to be arranged in order around the perimeter of the new area to be formed. In the more common, general case it will not work. For complex geometries, it will never work. What is it that you are trying to do? Fill in the empty space between two areas? I am not even sure how you would describe this problem algorithmically.
|