Skip Menu |

This queue is for tickets about the Math-Geometry-Planar CPAN distribution.

Report information
The Basics
Id: 6250
Status: resolved
Priority: 0/
Queue: Math-Geometry-Planar

People
Owner: daniel.van_de_pol [...] alcatel.be
Requestors: cpetti [...] matrixsemi.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.12
Fixed in: (no value)



Subject: bug in Gpc2polygons function (and fix)
Hi...this bug in distribution Math-Geometry-Planar-1.12 is very simple: Starting at line 1986 in Planar.pm, in the subroutine Gpc2polygons, you have this code: if ($obj->isinside($polygon[0])) { $obj->add_polygons($inner[$i]); splice @inner,$i,1; } $i++; However, I think you want to do this: if ($obj->isinside($polygon[0])) { $obj->add_polygons($inner[$i]); splice @inner,$i,1; } else { $i++; } that is, only increment the counter if you don't splice! Otherwise, some of the "holes" you're trying to insert into polygons get missed. I was losing some "holes" in operations I was doing, but when I made this change in my copy of Planar.pm, it worked perfectly! thanks and best regards Christopher Petti, PhD. Matrix Semiconductor, Inc 3230 Scott Blvd. Santa Clara, CA 95054 office: 408 969 4835 mobile: 408 410 1479 fax: 408 969 4849 email: cpetti@matrixsemi.com
Fixed the problem as suggested (version 1.14) Thx.