Crate csgrs

Source
Expand description

A fast, optionally multithreaded Constructive Solid Geometry (CSG) library, built around Boolean operations (union, difference, intersection, xor) on sets of polygons stored in BSP trees.

Example CSG output

§Features

§Default
  • f64: use f64 as Real
  • stl-io: .stl import/export
  • dxf-io: .dxf import/export
  • chull-io: convex hull and minkowski sum
  • metaballs: enables a CSG implementation of metaballs
  • hashmap: enables use of hashbrown for slice, related helper functions, and is_manifold
  • sdf: signed distance fields (sdf) using fast-surface-nets
  • offset: use geo-buf for offset operations
  • delaunay: use geos spade feature for triangulation
§Optional
  • f32: use f32 as Real, this conflicts with f64
  • parallel: use rayon for multithreading
  • svg-io: create CSGs from and convert CSGs to SVG’s
  • truetype-text: create CSGs using TrueType fonts .ttf
  • hershey-text: create CSGs using Hershey fonts (.jhf)
  • image-io: make 2d CSGs from images
  • earcut: use geos earcutr feature for triangulation
  • bevymesh: for conversion to a bevy Mesh

Re-exports§

pub use csg::CSG;
pub use vertex::Vertex;

Modules§

bsp
This module contains the implementation of the BSP tree data structure
convex_hull
The convex hull of a shape is the smallest convex set that contains it. It may be visualized as the shape enclosed by a rubber band stretched around the subset.
csg
errors
extrudes
flatten_slice
float_types
image
io
metaballs
Implementation of metaballs
offset
plane
Utilities for working with planes in 3‑space including robust orientation tests, point classification and polygon splitting.
polygon
sdf
Create CSGs by meshing signed distance fields (sdf) within a bounding box.
shapes2d
shapes3d
tpms
Triply‑Periodic Minimal Surfaces rewritten to leverage the generic signed‑distance mesher in sdf.rs.
truetype
Create CSGs using ttf fonts
vertex