I am trying to use the GpcClip()
function from Math::Geometry::Planar to find the intersection of two polygons. I built two polygons by using Math::Geometry::Planar->new();
but I got the following error when I used them in GpcClip()
:
Type error in argument 2 of gpc_polygon_clip. Expected _p_gpc_polygon at c:/strawberry/perl/site/lib/math/geometry/planar.pm line 2028
How can I convert the object returned by Math::Geometry::Planar->new()
into a GPC polygon?
According to the documentation, you can use the
convert2gpc
method:Example: