Skip to content

Inexact calculations effects on clippings #114

@skygering

Description

@skygering

Here is an example of inexact calculations causing issues:

scale_fac = 1e5
c1 = [[-28083.868447876892, -58059.13401805979], [-9833.052704767595, -48001.726711609794], [-16111.439295815226, -2.856614689791036e-11], [-76085.95770326033, -2.856614689791036e-11], [-28083.868447876892, -58059.13401805979]]
c1 = [c ./ scale_fac for c in c1]
c2 = [[-53333.333333333336, 0.0], [0.0, 0.0], [0.0, -80000.0], [-60000.0, -80000.0], [-53333.333333333336, 0.0]]
c2 = [c ./ scale_fac for c in c2]
p1 = GI.Polygon([c1])
p2 = GI.Polygon([c2])
GO.intersection(p1, p2; target = GI.PolygonTrait(), fix_multipoly = nothing)

When scale_fac = 1 this doesn't work, but when scale_fac = 1e5 it does work...

Basically, there are two edges over one another on top of the x-axis, but one of the lines is slightly below the x-axis. I am working on a "patch" for this type of issue, but we might want a stronger fix at some point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclippingAbout polygon clipping or processing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions