Skip to content

Releases: timschmidt/csgrs

v0.20.1

24 Jul 07:33

Choose a tag to compare

Changes since v0.20.0

  • working sweep
  • document sweep
  • check off some todo list items
  • clean up Sketch::bezier and eliminate some temporary allocations
  • loosen EPSILON a little further for f32 to prevent stack overflow

v0.20.0

11 Jul 00:29

Choose a tag to compare

What's Changed

  • Split monolithic CSG type into Mesh and Sketch subkernels making room for additional internal geometry representations
  • Creation of CSG trait defining operations each subkernel must implement and implementing the functions invariant between them
  • Implement From traits between subkernels
  • Add additional images to documentation
  • BSP splitting planes are now chosen via a heuristic judging the quality of the first 20 choices instead of simply using the first plane
  • Add object level metadata field to Sketch and Mesh and use it to propagate metadata through booleans
  • Correctly invalidate bounding box on mesh transformation
  • Implement vertex clamping near zero for delaunay translation via spade
  • Correct parameters for square and rectangle and cube and cuboid
  • Check for NaNs and infinities when triangulating, in SDFs, and in building Planes from normal + offset
  • CI checks for all combinations of f32 / f64, delaunay / earcut, serial / parallel, and minimal / featureful
  • Rewritten from_image using the same SVG parser we use for file IO
  • File IO support for AMF, PLY, and OBJ files added
  • Implement PartialEq for Plane, Vertex, and Polygon
  • Adjust naming for triangulate, revolve, loft
  • Reworked airfoil_naca4 to take typed arguments
  • Too many for loops converted to iterators and other small optimizations to mention individually
  • Several recursive loops unrolled into iterative functions
  • New functions for connectivity, smoothing, and mesh quality assessment
  • Offsetting of points
  • Straight skeleton generation for poylgons and multipolygons
  • Various small improvements to shape generation
  • Implement Sketch::renormalize() and Sketch::inverse()
  • Return errors instead of panic for several operations where that makes sense
  • Loosened EPSILON further to resolve some BSP recursion issues
  • Fix an issue with parallel booleans by keeping existing subtrees instead of reallocating them
  • Addressed all warnings from CI to get cargo check, cargo test, cargo build, and cargo semver-checks passing

Thank you to Ryan K, Ryan Clanton, Jacob Bergholtz, Wink Saville, .nathanf, Dusty DeWeese, and others for your contributions in code and discussion in the csgrs Discord: https://discord.gg/9WkD3WFxMC

Thank you to my GitHub sponsors: Archiyou and ftvkyo for keeping the lights on.

Please consider sponsoring development of csgrs. Your financial contributions directly fund my time and effort advancing the library for all.

v0.18.1

19 Jun 21:32

Choose a tag to compare

This is a bugfix release. Some polygons were not correctly passed through to the result in difference() which has been corrected.

v0.18.0

22 May 04:25

Choose a tag to compare

Another month, another major csgrs release! v0.18.0 features dramatically higher quality geometry output using fewer CPU cycles and less memory thanks to an optimization reducing the number of Polygons processed by booleans to those who's bounding boxes intersect. A summarized list of changes from the 29 commits and 76 files modified since v0.17.4 follows:

  • Improved accuracy and coverage of documentation comments
  • Added a bounding_box field to Polygons and CSGs to cache the result of bounding box calculation
  • Return the cached value or calculate and cache it when calling bounding_box()
  • Invalidate cached bounding boxes on transformation with OnceLock::new()
  • Use cached bounding boxes to cull Polygons which cannot intersect prior to booleans, yielding improved geometry with fewer unnecessary split polygons, improved memory usage, and reduced computation time
  • Switch bounding_box field's OnceCell to OnceLock to preserve thread safety for parallel builds.
  • Fix orientation of airfoils
  • Added renders for most functions to the Readme
  • Rewrote the triply periodic minimal surfaces as SDFs greatly simplifying them and eliminating a great deal of hand rolled meshing code in favor of the fast-surface-nets crate already used by SDF.
  • Removed "Under Construction" status from beziers and bsplines
  • Added initial implementations of heart, crescent, octahedron, icosahedron, torus

csgrs now has a Discord chat which you can join using the following link: https://discord.gg/9WkD3WFxMC

I'd like to thank project contributors Ryan, Wink Saville, Pieter-Jan Briers, Andrei Stepanenko, Bruce Michener, and Connor K for all your contributions.

Thank you to Ralith, Dusty DeWeese, Julian Ruiseco, Sebastien Crozet, Sourav, BrianH, StrikeForceZero, quarry, Michael Kirk, .nathanf, Wink Saville, Ryan, Glenn Dittmann, Alice Cecile, and any others who's conversations in Discord, through Github, and elsewhere have contributed.

And as always the biggest thanks go to Andrei Stepanenko, Archiyou, and The Architect for sponsoring my work on csgrs. You folks kept the bank account open this month. Seriously. Thank you.

If you're reading these release notes, please consider the accolades available to you by sponsoring this work. Titles such as "Most fun at trade shows" and "Favorite sponsor" have yet to be awarded. How would you or your company like to be thanked in the release notes for the auspicious v0.19.0? Just click the thing: https://github.com/sponsors/timschmidt

v0.17.4

10 May 18:21

Choose a tag to compare

This is a bugfix release adding processing of multipolygons in to_polygons()

v0.17.3

09 May 13:14

Choose a tag to compare

This release implements to_bevy_mesh() behind a new "bevymesh" feature flag.

v0.17.2

09 May 11:50

Choose a tag to compare

This release splits stl and dxf into io modules and implements support for linestrings, lines, triangles, and rects in extrude().

v0.17.1

01 May 01:12

Choose a tag to compare

Bugfix release which clamps values near zero to zero for triangulation with spade.

v0.17.0

28 Apr 21:24

Choose a tag to compare

🚀 Highlights

  • Robust Predicates
    • Full integration of Shewchuk’s orient3d for orientation tests
    • Plane::orient_plane and Plane::orient_point utilities wrap orient3d from robust crate
    • Plane internal representation transitioned from normal and offset to three points
    • Plane::from_normal, normal, and offset public functions for backward compatibility
    • Converted orientation tests in clip_polygons, split_plane, and slice
  • Modularization & Cleanup
    • Split core functionality out of csg.rs into dedicated modules:
      • Flatten & Slice, SDF, Extrudes, Shapes2D, Shapes3D, Convex Hull, Hershey Text, TrueType Font, Image, Offset, Metaballs
    • Initial WebAssembly support—csgrs now compiles for wasm32-unknown-unknown targets
  • Geometry & Precision Improvements
    • EPSILON for 64-bit builds now set to 1e-10
    • TrueType font now processed with ttf-parser-utils, instead of meshtext, resulting in fewer dependencies and availability of 2D polygons
    • Shared definition of FRONT, BACK, COPLANAR, SPANNING between bsp and plane
    • Line by line audit of BSP, Plane, and Polygon splitting code
  • Feature-Flag Enhancements
    • Compile-time selection between Constrained Delaunay triangulation and Earcut triangulation
    • Explicit compiler errors for invalid tessellation-mode feature combinations
    • Pass through parallel flag to geo, hashbrown, parry, rapier
  • I/O Support
    • SVG import/export
    • DXF loader improvements, with better handling of edge cases
  • Performance / Memory Optimizations
    • Use of [small_str] for is_manifold hash map key generation to avoid allocations
    • Elimination of several unnecessary mutable references in both single-threaded and parallel split_polygon paths
    • Removed embedded Plane in Polygon, inlined Polygon::plane for deriving on demand
    • Inline Plane::orient_plane, Plane::orient_point, Plane::normal, and Plane::offset
      Developer Tooling
    • New xtask target to test all combinations of feature-flag configurations:
      • cargo xtask test-all
  • New Shapes
    • Reuleaux polygons
    • NACA airfoils
    • Arrows
    • 2D Metaballs
  • New Shapes Under Construction
    • Beziers
    • B-splines
    • Involute spur gear, helical gear, and rack
    • Cycloidal spur gear, helical gear, and rack

🐛 Bug Fixes

  • Fixed infinite recursion crash in Node::build / Plane::slice_polygon due to floating point error and too-strict epsilon
  • metaballs2d now produces correct geometry
  • Realeux now produces correct geometry
  • More robust svg polygon/polyline points parsing

📚 Documentation

  • README updates to reflect new modules, feature flags, and usage examples
  • Enhanced comments for Boolean operations
  • Improved readability of Node::build, and Plane::split_polygon
  • Documented orient3d usage
  • Added keywords and crate categories in Cargo.toml

I'd like to thank ftvkyo, Archiyou, and thearchitect. Your sponsorship enables me to spend more time improving and extending csgrs. If you use csgrs or would like to in the future, please consider becoming a sponsor: https://github.com/sponsors/timschmidt

We have several new contributors this development cycle - ftvkyo, PJB3005, mattatz, TimTheBig, winksaville, waywardmonkeys, and naseschwarz and SIGSTACKFAULT who I failed to mention in previous release notes. Thank you to all contributors for making this release possible! Enjoy the improved robustness, modularity, and performance in v0.17.0.