Skip to content

v0.3.0

Latest

Choose a tag to compare

@zmerlynn zmerlynn released this 02 Jun 03:10
· 1 commit to main since this release
Immutable release. Only release title and notes can be modified.
f64621d

This release tightens the safe API around status handling, mesh construction, and upstream enum/default parity, from the binding audit. It is a breaking change; most code that only runs booleans and extracts meshes needs just a dependency bump.

📖 Full migration guide: MIGRATION_0.2.0_TO_0.3.0.md — includes a Cargo.toml diff, mechanical rewrites, and an AI-assistant prompt.

Breaking changes

  • Manifold::status() now returns Result<(), CsgError> (use raw_status() for the raw upstream enum).
  • MeshGL::new / MeshGL64::new and their tangent constructors now return Result, validating buffer shape before the C call instead of panicking.
  • Empty mesh input is valid; CsgError::EmptyMesh removed.
  • CrossSection::from_polygons() and from_simple_polygon() now use upstream's default FillRule::Positive (was EvenOdd); the fill-rule forms moved to *_with_fill_rule(). Also affects slice_to_cross_section().
  • manifold_csg::OpType is now a safe crate enum instead of a re-export of the raw sys type.
  • FillRule, JoinType, OpType, CsgError, and raw ManifoldError are now #[non_exhaustive] — exhaustive matches need a wildcard arm.
  • Panics in user callbacks (warp, set_properties, from_sdf, from_sdf_seq, cross-section warp) now propagate after safe FFI cleanup instead of being swallowed.

Additions

  • Manifold::raw_status() for the raw upstream ManifoldError.
  • to_meshgl() / to_meshgl64() and *_with_normals() variants return full mesh containers including metadata.
  • MeshGL::new_with_options() / MeshGL64::new_with_options() build meshes with run, original-ID, merge, and tangent metadata; Manifold::from_meshgl() / from_meshgl64() construct from those containers.
  • Default for Manifold and CrossSection returns empty geometry.

Raw sys (manifold-csg-sys / manifold3d-sys 3.5.101)

  • Completes ManifoldError with upstream InvalidTangents and Cancelled, fixing a reachable invalid-enum UB bug (the bundled 3.5.0 can already return these codes), and marks it #[non_exhaustive].
  • ManifoldMeshGLOptions / ManifoldMeshGL64Options input pointers tightened from *mut to *const.

Credit

Thanks to @JaminKoke (#47) for flagging the missing MeshGL / MeshGL64 metadata-construction surface, which prompted the new_with_options API in this release.

Full Changelog: v0.2.0...v0.3.0