Skip to content

orb.Polygon intersection example #1

@missinglink

Description

@missinglink

Heya, your lib looks great but I'm struggling to figure out how to use it...

I have two orb.Polygon geometries which I'd like to generate the intersection of.
Do you possibly have an example of how I can achieve this using your lib?

From the code it looks like I can convert each orb.Loop to a martinez_rueda.Contour and then construct a martinez_rueda.Polygon which I can use with martinez_rueda.Compute() to generate the intersection and then reverse the process to convert back to an orb.Polygon?

Are there any gotchas I should be aware of such as whether the orb.Point values in the martinez_rueda.Contour should be closed (ie the first point should/should not be repeated as the last point) and whether winding order is important?

Thanks!

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