10-24-2016 11:27 AM - edited 10-24-2016 04:36 PM
My interpolation code required that the points are spaced at least one pixel apart, else you need to ensure that the inner loop iterates at least once. (I was aware of that but did not want to complicate the code originally). Anyway, I modified the code now. I think you need to scale your xy-points to much more pixles.
It seems we can detect the connector between the two curves by its excessive lenght.
I substituted intensity graphs because it is easier to zoom and verify the code. You can convert to a boolean array later. Now all you need is apply the fill. see how far you get.
(Also: Please do NOT attach new code under the same name as previous code. It makes it difficult to keep versions apart, especially since the browser changes the file name to prevent duplicates).
10-26-2016 05:05 AM
many many thanks altenbach! 🙂
so i've tried your code + the floodfill-algorithm.
it works for simple shapes like a rectangle but not for more complex ones like the beamsplitter. 😕
i reckon this is due the fact that after interpolating there are still "gaps" along the edge of the shape. do you know why, altenbach?
i've attached data where the points are at least 1pixel apart.