Skip to main content

Module dynamic

Module dynamic 

Source
Expand description

Generic DynamicObject dispatch shared by every CSG backend.

Backends implement DynamicBackend (parameterized primitive constructors plus two 2D/3D bridge hooks); the tree walk itself — booleans, transforms, extrusions, sketch loop handling — lives once in dynamic_to_csg/dynamic_to_sketch. Blanket [ToCsg]/[ToSketch] impls for DynamicObject route through the walkers, so backends must NOT provide their own (the compiler rejects the overlap).

Conventions the constructors must honor (pinned by tests/dynamic_dispatch.rs): cube/square corner-anchored at the origin, cylinder/cone base on y=0 with +Y axis, sphere centered. Backend-specific fixes (BSP’s centered-factory offsets, Manifold’s z_to_y_up) belong inside the backend impls, never in the walkers.

Traits§

DynamicBackend
A CsgBackend that can build every DynamicObject primitive.

Functions§

dynamic_to_csg
Evaluate a DynamicObject tree as a 3D solid.
dynamic_to_sketch
Evaluate a DynamicObject tree as a 2D sketch/cross-section.