polypartition icon indicating copy to clipboard operation
polypartition copied to clipboard

What's wrong with this input(square with inner square hole)?

Open GoogleCodeExporter opened this issue 10 years ago • 4 comments

What steps will reproduce the problem?

Square input poly with an interior square hole seems to be failing

input poly 1 
-1423 479
-1423 419
-1363 419
-1363 479

input poly 2 - marked as hole
-1403, 459
-1383, 459
-1383, 439
-1403, 439

Thanks

Original issue reported on code.google.com by [email protected] on 10 May 2013 at 5:36

GoogleCodeExporter avatar May 03 '15 11:05 GoogleCodeExporter

Hi,
I cannot reproduce the problem, what methods did you use?

Original comment by [email protected] on 11 May 2013 at 11:47

GoogleCodeExporter avatar May 03 '15 11:05 GoogleCodeExporter

Sorry. I used

TPPLPartition partition;
partition.ConvexPartition_HM( &inputPolys, &convexPolys );

Original comment by [email protected] on 13 May 2013 at 1:26

GoogleCodeExporter avatar May 03 '15 11:05 GoogleCodeExporter

Hm, that works for me. Here's a test code that I used:

    TPPLPartition pp;
    list<TPPLPoly> input;
    list<TPPLPoly> output;

    TPPLPoly p;
    p.Init(4);

    p[0].x = -1423; p[0].y = 479;
    p[1].x = -1423; p[1].y = 419;
    p[2].x = -1363; p[2].y = 419;
    p[3].x = -1363; p[3].y = 479;
    p.SetHole(false);
    input.push_back(p);

    p[0].x = -1403; p[0].y = 459;
    p[1].x = -1383; p[1].y = 459;
    p[2].x = -1383; p[2].y = 439;
    p[3].x = -1403; p[3].y = 439;
    p.SetHole(true);
    input.push_back(p);

    pp.ConvexPartition_HM(&input, &output);


Did you use the most recent version of the library? Did you make any changes to 
it? Or use different vertex ordering in your code?

Original comment by [email protected] on 13 May 2013 at 9:41

Attachments:

GoogleCodeExporter avatar May 03 '15 11:05 GoogleCodeExporter

Here is a test case text file (with 1500 added to the X values so that everything is positive): issue-6.txt

Here is the output when running this: issue-6.zip

Specifically, ConvexPartition_HM results in this, which looks fine to me:

conv_hm

I can't reproduce this bug, so it should probably be closed.

aaronfranke avatar Jan 07 '21 04:01 aaronfranke