Skip to main content

Crate vcad

Crate vcad 

Source
Expand description

vcad — Parametric CAD in Rust

CSG modeling with multi-format export (STL, glTF, USD, DXF).

§Status

This crate is the legacy manifold-based CSG API. It is preserved as the ergonomic Rust-facing way to script models, but the implementation will be migrated to sit on top of the new BRep kernel (vcad-kernel) rather than its own mesh-CSG backend.

Tracked in issue #10.

§Example

use vcad::{centered_cube, Part};

let cube = centered_cube("block", 20.0, 10.0, 5.0);
let hole = Part::cylinder("hole", 3.0, 10.0, 32).translate(0.0, 0.0, -2.5);
let result = cube.difference(&hole);
result.write_stl("block_with_hole.stl").unwrap();

Re-exports§

pub use export::Material;
pub use export::Materials;

Modules§

export
Export modules for multi-format CAD output.
step
STEP file import/export support.

Structs§

Part
A named part with geometry.
PartMesh
A triangle mesh with vertices and indices.
Scene
A scene containing multiple parts with different materials
SceneNode
A scene node containing a part with its material assignment.

Enums§

CadError
Errors returned by CAD operations.

Functions§

bolt_pattern
Create a bolt pattern (circle of holes)
centered_cube
Helper to create a cube centered at the origin (Part::cube is corner-aligned).
centered_cylinder
Helper to create a cylinder centered at the origin (Part::cylinder has its base at z = 0).
counterbore_hole
Create a counterbore hole (through hole + larger shallow hole for bolt head)