Discovered at the end of fixing NanoComp/meep#864. The version of node_in_or_on_polygon (in geom.c) that was added with commit da42dcf creates small lines in polygons that shouldn't be there. For example, in these images show the error (with the correct form of the polygon on the left and the incorrect on the right):


More examples of this error can be seen in this imgur gallery. The lines only seem to form to the left of a vertex in the polygon. The even-odd algorithm that was used (from this paper) accounts for this sort of problem, and running through the algorithm on paper with problematic polygons doesn't show the lines appearing. Perhaps the occurrence of the lines is caused by a floating-point problem?
This problem could potentially be addressed by using a winding number algorithm instead of an even-odd algorithm.
Discovered at the end of fixing NanoComp/meep#864. The version of
node_in_or_on_polygon(ingeom.c) that was added with commit da42dcf creates small lines in polygons that shouldn't be there. For example, in these images show the error (with the correct form of the polygon on the left and the incorrect on the right):More examples of this error can be seen in this imgur gallery. The lines only seem to form to the left of a vertex in the polygon. The even-odd algorithm that was used (from this paper) accounts for this sort of problem, and running through the algorithm on paper with problematic polygons doesn't show the lines appearing. Perhaps the occurrence of the lines is caused by a floating-point problem?
This problem could potentially be addressed by using a winding number algorithm instead of an even-odd algorithm.