{"repo":"tirithen/clipper2","free":true,"listed":false,"github":"https://github.com/tirithen/clipper2","clone":"git clone https://github.com/tirithen/clipper2.git","description":"A polygon Clipping and Offsetting library for Rust.","language":"Rust","stars":27,"topics":["2d-graphics","algorithm","algorithms","boolean","cnc","game-development","geometry","geospatial","gis","path-tracing"],"license":"Apache-2.0","category":"game-templates","readme_excerpt":"clipper2 A safe, idiomatic Rust API for 2D polygon clipping and offsetting, built on top of Clipper2, Angus Johnson's C++ library. The focus of this crate is to provide an easy to use API, staying as close to the core Vec and fn types as possible. The unsafe FFI layer lives in the separate clipper2c-sys crate; reach for that one only if you need direct access to the raw C ABI. Example The example below uses macroquad to visualize the result of the operations and some helpers from the examples/ directory. See the examples directory for more. This is how the resulting shapes look: Minkowski sum and difference The Minkowski operations grow a polygon by an arbitrary polygonal kernel rather than the radius-only kernel of inflate , which makes them the right primitive for square cutters, drag-knives, asymmetric tool footprints, and configuration-space obstacles in robot motion planning. The kernel may be concave; concave kernels can carve holes into the swept region. minkowski sum translates the kernel by +p at every vertex of the input path; minkowski diff translates by -p . For a pattern that is symmetric about the origin (a centred disc or square) the two agree, but for an asymmetric pattern the difference is the sum reflected through the origin of the pattern. The screenshots below use the same concave arrowhead kernel against the same L-shaped outline: minkowski sum minkowski diff --- --- The arrowhead extends the swept boundary rightward (its tip is at +0.6 x); the concave no","default_branch":null,"files":null,"tree":[],"storefront":"/r/tirithen","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tirithen/clipper2/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}