pub enum DynamicObject {
Show 23 variants
Cube {
size: [f64; 3],
},
Sphere {
radius: f64,
segments: usize,
stacks: usize,
},
Cylinder {
radius: f64,
height: f64,
segments: usize,
},
Cone {
radius: f64,
height: f64,
segments: usize,
},
Circle {
radius: f64,
segments: usize,
},
Square {
size: [f64; 2],
},
Polygon {
points: Vec<[f64; 2]>,
},
Sketch {
data: SketchData,
},
Union {
children: Vec<DynamicObject>,
},
Difference {
children: Vec<DynamicObject>,
},
Intersection {
children: Vec<DynamicObject>,
},
Translate {
offset: [f64; 3],
child: Box<DynamicObject>,
},
Rotate {
angles: [f64; 3],
child: Box<DynamicObject>,
},
Scale {
factors: [f64; 3],
child: Box<DynamicObject>,
},
Mirror {
axis: [f64; 3],
child: Box<DynamicObject>,
},
Color {
color: [f64; 4],
child: Box<DynamicObject>,
},
Material {
material: MaterialData,
child: Box<DynamicObject>,
},
LinearExtrude {
height: f64,
twist: f64,
scale: f64,
slices: usize,
child: Box<DynamicObject>,
},
Revolve {
angle_degrees: f64,
segments: usize,
child: Box<DynamicObject>,
},
Offset {
delta: f64,
round: bool,
chamfer: bool,
segments: usize,
child: Box<DynamicObject>,
},
EdgeFeature {
data: EdgeFeatureData,
child: Box<DynamicObject>,
},
Group {
children: Vec<DynamicObject>,
},
Empty,
}Expand description
A dynamically-typed CSG object node.
Implements Object so it can be used anywhere a static rscad-core object
can, and can be serialized/deserialized when the serde feature is enabled.
Variants§
Cube
Sphere
Cylinder
Cone
Circle
Square
Polygon
Sketch
Constraint-based 2D sketch (see crate::sketch). Lives in its local
XZ plane like the other 2D primitives.
Fields
data: SketchDataUnion
Implicit union of all children.
Fields
children: Vec<DynamicObject>Difference
First child minus all subsequent children.
Fields
children: Vec<DynamicObject>Intersection
Intersection of all children.
Fields
children: Vec<DynamicObject>Translate
Rotate
Rotation in degrees (OpenSCAD convention).
Scale
Mirror
Color
RGBA color (0.0–1.0).
Material
PBR surface finish (metallic/roughness); albedo stays in Self::Color.
LinearExtrude
Revolve
Revolve the child 2D profile about its local Y axis (OpenSCAD
rotate_extrude). Profile-x is the radius (x ≥ 0 expected).
Offset
Grow/shrink the child 2D profile by delta (OpenSCAD offset()).
Fields
child: Box<DynamicObject>EdgeFeature
Chamfer/fillet the child’s selected edges. Backends never see this
variant directly — it lowers to plain CSG masks against the child
([crate::feature::lower]), re-resolved on every evaluation so the
feature follows parameter edits.
Group
Implicit union of children (convenience wrapper).
Fields
children: Vec<DynamicObject>Empty
Empty geometry — produces no polygons.
Implementations§
Source§impl DynamicObject
impl DynamicObject
Sourcepub fn extract_top_transforms(&self) -> ExtractedTransforms<'_>
pub fn extract_top_transforms(&self) -> ExtractedTransforms<'_>
Peel off top-level Translate/Rotate/Scale/Color nodes that are
not under any boolean operation, producing an accumulated affine
matrix, an optional color, and a reference to the remaining inner
subtree.
Extraction stops at booleans (Union, Difference, Intersection),
Mirror (negative scale breaks face winding), LinearExtrude, Group,
primitives, and Empty.
Trait Implementations§
Source§impl Clone for DynamicObject
impl Clone for DynamicObject
Source§fn clone(&self) -> DynamicObject
fn clone(&self) -> DynamicObject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DynamicObject
impl Debug for DynamicObject
Source§impl<'de> Deserialize<'de> for DynamicObject
impl<'de> Deserialize<'de> for DynamicObject
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DynamicObject
impl PartialEq for DynamicObject
Source§fn eq(&self, other: &DynamicObject) -> bool
fn eq(&self, other: &DynamicObject) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for DynamicObject
impl Serialize for DynamicObject
Source§impl ToDynamic for DynamicObject
impl ToDynamic for DynamicObject
fn to_dynamic(&self) -> DynamicObject
impl StructuralPartialEq for DynamicObject
Auto Trait Implementations§
impl Freeze for DynamicObject
impl RefUnwindSafe for DynamicObject
impl Send for DynamicObject
impl Sync for DynamicObject
impl Unpin for DynamicObject
impl UnsafeUnpin for DynamicObject
impl UnwindSafe for DynamicObject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CenterObject for Twhere
T: Object,
impl<T> CenterObject for Twhere
T: Object,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ColorObject for Twhere
T: Object,
impl<T> ColorObject for Twhere
T: Object,
fn colored(self, color: impl ColorFormat) -> Colored<T>
Source§impl<T> DifferenceObject for Twhere
T: Object,
impl<T> DifferenceObject for Twhere
T: Object,
fn difference<Other: Object>(self, other: Other) -> Difference<Self, Other>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntersectionObject for Twhere
T: Object,
impl<T> IntersectionObject for Twhere
T: Object,
fn intersection<Other: Object>(self, other: Other) -> Intersection<Self, Other>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more