Skip to content

clipper2-rust 1.2.0

Latest

Choose a tag to compare

@larsbrubaker larsbrubaker released this 18 Sep 16:47
· 9 commits to main since this release

Published on crates.io: clipper2-rust 1.2.0

[dependencies]
clipper2-rust = "1.2"

Added

  • using_z feature (optional, off by default) mirroring the C++ USINGZ build: a z field on Point<T>, Point::new_z, make_path_z / make_path_zd, and set_z_callback on Clipper64, ClipperD, and ClipperOffset. Z values are preserved through clipping and offsetting. Thanks to the contributors of #8.
    clipper2-rust = { version = "1.2", features = ["using_z"] }
  • ellipse_rect64 and ellipse_rect_d: generate an ellipse inscribed in a rectangle (port of the C++ Ellipse(const Rect<T>&) overload).
  • From<&Point64> for PointD and From<&PointD> for Point64 (rounding) conversions.
  • New using_z example: cargo run --example using_z --features using_z

Fixed

  • Zero-width spurs in union output (#9): clean_collinear did not restart its walk after removing a vertex, as C++ CleanCollinear does, so spikes could survive when preserve_collinear was on (the default). Output now matches C++. Thanks to @3dodev for the report and repro.

Compatibility

No breaking changes for default builds. Point's PartialEq is now a manual impl (equality ignores z, as in C++); comparison behavior is unchanged without using_z.

Tests: 457 passing (477 with using_z).