Skip to content

Multiple Partial Overlap Bug #30

@Vatvo

Description

@Vatvo

Hello Flo_Curves Devs,

I found a bug with the marking of interior/exterior edges when subtracting complex shapes in a specific way in both v0.7.3 and v0.8.0.

It begins with a base shape created by merging four SimpleBezierPaths into a GraphPath:
Screenshot 2024-06-26 at 1 24 22 PM

And a cutout GraphPath like this:
Screenshot 2024-06-26 at 1 28 40 PM

The cutout path is then subtracted from the base shape using GraphPath::collide() and then GraphPath::set_exterior_by_subtracting(). This produces the incorrect path seen here:
Noncomposite_Incorrect

Here is a recreation of what it should look like if it were correct:
Composite_Correct

The result of this error (when healed using the heal_exterior_gaps() function) looks like this:
Thin_Lock_Broken

When it should look like this:
Thin_Lock_Fixed

The two black and white images were made using the original icons with which this bug was discovered, but I have written a test using the more minimal reproduction seen in the debug images.

The inner loop seen in the top right of the debug image seems to be important. When it is removed, the bug does not occur.
pathloop

Also, if the top of the cutout shape, which intersects that loop, is moved higher (to around y=100) the bug does not occur.
path100

When that point is at its normal position of y=160 it breaks.
path160

I believe the bug is somewhere in the set_exterior_by_subtracting() function, or the function it calls, though I was unable to locate exactly where.

The subtract_multiple_partial_overlap() test I have proposed in pull request #29 creates these shapes, subtracts them, locates the edges of the inner arch, and checks their interior/exterior statuses. If they are correctly labelled as exterior, it passes. I believe that if this test passes, the bug would be fixed.

Also, I’m not sure if this is relevant, but maybe it will be useful information somehow. The edge indicated in the following image is actually two lines that partially overlap:
twolines02

I would think that Flo_Curves should see the overlap and split the edge up appropriately.
splitlines02

I could be wrong about what this is supposed to look like, but maybe this information will be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions