Hello Inkscape developers,
I'm working on an Inkscape function that sorts paths in an order suitable for 3D rendering. For this, I need to know which polygons contain which other polygons. In my use case, partial containment does not occur, i.e. every shape is either fully contained or has no crossings.
I tried to implement this "polygon in polygon" functionality by iterating over all the points of one polygon and using the 2geom function Geom::contains(Path, Point) to test them for containment. However, I found several cases where the function does not yield the expected result[1].
The current method I use is to test for partial inclusion (at least one point is included) and the number of crossings (using the Geom::crossings function) is 0. This is super slow, however, so my question is: how can I efficiently test whether a polygon is in another polygon?
[1] http://xinutec.org/~pippijn/files/txt/5c595dad425061f408f82cc6553a354e.txt
participants (1)
-
Pippijn van Steenhoven