Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
clipper2/clipper.h
✓ #include <clipper2/clipper.h>
Compute the intersection of two polygons
#include <clipper2/clipper.h>
#include <iostream>
int main() {
Clipper2Lib::Paths64 subject = {Clipper2Lib::MakePath({0, 0, 100, 0, 100, 100, 0, 100})};
Clipper2Lib::Paths64 clip = {Clipper2Lib::MakePath({50, 50, 150, 50, 150, 150, 50, 150})};
Clipper2Lib::Clipper64 clipper;
clipper.AddSubject(subject);
clipper.AddClip(clip);
Clipper2Lib::Paths64 solution;
clipper.Execute(Clipper2Lib::ClipType::Intersection, Clipper2Lib::FillRule::NonZero, solution);
std::cout << "Intersection has " << solution.size() << " polygons" << std::endl;
return 0;
}
Debug
Known issues
No known issues recorded.
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.