pub trait DynamicBackend: CsgBackend {
const SKETCH_IS_CSG: bool = false;
Show 13 methods
// Required methods
fn cube(size: [f64; 3]) -> Self::CsgType;
fn sphere(radius: f64, segments: usize, stacks: usize) -> Self::CsgType;
fn cylinder(radius: f64, height: f64, segments: usize) -> Self::CsgType;
fn cone(radius: f64, height: f64, segments: usize) -> Self::CsgType;
fn circle(radius: f64, segments: usize) -> Self::SketchType;
fn square(size: [f64; 2]) -> Self::SketchType;
fn polygon(points: &[[f64; 2]]) -> Self::SketchType;
fn sketch(loops: &[Vec<DVec2>]) -> Self::SketchType;
// Provided methods
fn offset(
sketch: Self::SketchType,
_delta: f64,
_round: bool,
_chamfer: bool,
_segments: usize,
) -> Self::SketchType { ... }
fn sketch_as_csg(_sketch: Self::SketchType) -> Self::CsgType { ... }
fn csg_as_sketch(_csg: Self::CsgType) -> Self::SketchType { ... }
fn union_all(items: Vec<Self::CsgType>) -> Self::CsgType { ... }
fn union_all_2d(items: Vec<Self::SketchType>) -> Self::SketchType { ... }
}Expand description
A CsgBackend that can build every DynamicObject primitive.
Provided Associated Constants§
Sourceconst SKETCH_IS_CSG: bool = false
const SKETCH_IS_CSG: bool = false
true when the backend uses one type for 2D and 3D (BSP): bare 2D
nodes keep their geometry in 3D context and vice versa, via the two
bridge hooks. When false (Manifold), out-of-context nodes are empty
and the hooks are never called.
Required Methods§
fn cube(size: [f64; 3]) -> Self::CsgType
Sourcefn sphere(radius: f64, segments: usize, stacks: usize) -> Self::CsgType
fn sphere(radius: f64, segments: usize, stacks: usize) -> Self::CsgType
stacks is advisory; backends with a single tessellation knob ignore it.
fn cylinder(radius: f64, height: f64, segments: usize) -> Self::CsgType
fn cone(radius: f64, height: f64, segments: usize) -> Self::CsgType
fn circle(radius: f64, segments: usize) -> Self::SketchType
fn square(size: [f64; 2]) -> Self::SketchType
fn polygon(points: &[[f64; 2]]) -> Self::SketchType
Sourcefn sketch(loops: &[Vec<DVec2>]) -> Self::SketchType
fn sketch(loops: &[Vec<DVec2>]) -> Self::SketchType
Build a profile from winding-normalized loops (CCW outers, CW holes)
as produced by rscad_core::sketch::profile_loops.
Provided Methods§
Sourcefn offset(
sketch: Self::SketchType,
_delta: f64,
_round: bool,
_chamfer: bool,
_segments: usize,
) -> Self::SketchType
fn offset( sketch: Self::SketchType, _delta: f64, _round: bool, _chamfer: bool, _segments: usize, ) -> Self::SketchType
2D polygon offset (offset(delta=…) / offset(r=…)). Default passes
the profile through unchanged — for backends without polygon offsetting
(BSP, the documented 2D outlier). round wins over chamfer.
Sourcefn sketch_as_csg(_sketch: Self::SketchType) -> Self::CsgType
fn sketch_as_csg(_sketch: Self::SketchType) -> Self::CsgType
Bare 2D geometry appearing in 3D context. Only called when
SKETCH_IS_CSG is true.
Sourcefn csg_as_sketch(_csg: Self::CsgType) -> Self::SketchType
fn csg_as_sketch(_csg: Self::CsgType) -> Self::SketchType
3D geometry appearing in 2D context. Only called when
SKETCH_IS_CSG is true.
Sourcefn union_all(items: Vec<Self::CsgType>) -> Self::CsgType
fn union_all(items: Vec<Self::CsgType>) -> Self::CsgType
N-ary union; override when the backend has a batch operation.
fn union_all_2d(items: Vec<Self::SketchType>) -> Self::SketchType
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.