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 returnsResult<(), CsgError>(useraw_status()for the raw upstream enum).MeshGL::new/MeshGL64::newand their tangent constructors now returnResult, validating buffer shape before the C call instead of panicking.- Empty mesh input is valid;
CsgError::EmptyMeshremoved. CrossSection::from_polygons()andfrom_simple_polygon()now use upstream's defaultFillRule::Positive(wasEvenOdd); the fill-rule forms moved to*_with_fill_rule(). Also affectsslice_to_cross_section().manifold_csg::OpTypeis now a safe crate enum instead of a re-export of the raw sys type.FillRule,JoinType,OpType,CsgError, and rawManifoldErrorare now#[non_exhaustive]— exhaustive matches need a wildcard arm.- Panics in user callbacks (
warp,set_properties,from_sdf,from_sdf_seq, cross-sectionwarp) now propagate after safe FFI cleanup instead of being swallowed.
Additions
Manifold::raw_status()for the raw upstreamManifoldError.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.DefaultforManifoldandCrossSectionreturns empty geometry.
Raw sys (manifold-csg-sys / manifold3d-sys 3.5.101)
- Completes
ManifoldErrorwith upstreamInvalidTangentsandCancelled, fixing a reachable invalid-enum UB bug (the bundled 3.5.0 can already return these codes), and marks it#[non_exhaustive]. ManifoldMeshGLOptions/ManifoldMeshGL64Optionsinput pointers tightened from*mutto*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