Lian -- I had a similar problem when my polygons contained NaNs. After I fixed that, the problem went away. Perhaps yours is similar?
Sebastian -- Thank you very much!
5
06 Apr 2011
Polygon Clipper
Given two arbitrary polygons, the routine calculates the resulting polygon ...
Guys, does anyone know how to fix this issue:
Bugs
----
??? 1) It seems that the routine is sometimes passing back empty arrays (0 vertex). This should be handled. ???
Comment only
04 Apr 2011
Polygon Clipper
Given two arbitrary polygons, the routine calculates the resulting polygon ...
Hi Lian,
Please see this page:
http://www.cs.man.ac.uk/~toby/alan/software/gpc_faq.htm
GPC is the C clipping library behind PolygonClipper. What you are experiencing is not due to a shortcoming of MATLAB or Hölz' MEX code, but is instead due to a known limitation of the underlying clipping algorithm implementation.
I had the same problem you are having (I only encountered it in certain cases), and I fixed it by snapping all polygon vertices to a grid before clipping, as Murta suggests.
Btw, thank you Sebastian Hölz, you have saved me the trouble of trying to write my own GPC interface!
Comment only