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<DynamicObject, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DynamicObject, <__D as Deserializer<'de>>::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§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl<B> ToCsg<B> for DynamicObjectwhere
B: DynamicBackend,
impl<B> ToCsg<B> for DynamicObjectwhere
B: DynamicBackend,
fn to_csg(&self) -> <B as CsgBackend>::CsgType
Source§impl ToDynamic for DynamicObject
impl ToDynamic for DynamicObject
fn to_dynamic(&self) -> DynamicObject
Source§impl<B> ToSketch<B> for DynamicObjectwhere
B: DynamicBackend,
impl<B> ToSketch<B> for DynamicObjectwhere
B: DynamicBackend,
fn to_sketch(&self) -> <B as CsgBackend>::SketchType
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§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist.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>(self, other: Other) -> Difference<Self, Other>where
Other: Object,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntersectionObject for Twhere
T: Object,
impl<T> IntersectionObject for Twhere
T: Object,
fn intersection<Other>(self, other: Other) -> Intersection<Self, Other>where
Other: Object,
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§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> LinearPatternObject for T
impl<T> LinearPatternObject for T
Source§impl<T> MirrorObject for Twhere
T: Object,
impl<T> MirrorObject for Twhere
T: Object,
fn mirror<T>(self, x: T, y: T, z: T) -> Mirror<Self>
fn mirror_x<T>(self, x: T) -> Mirror<Self>
fn mirror_y<T>(self, y: T) -> Mirror<Self>
fn mirror_z<T>(self, z: T) -> Mirror<Self>
fn mirror_xy<T>(self, x: T, y: T) -> Mirror<Self>
fn mirror_xz<T>(self, x: T, z: T) -> Mirror<Self>
fn mirror_yz<T>(self, y: T, z: T) -> Mirror<Self>
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ProjectionObject<T> for Twhere
T: Object,
impl<T> ProjectionObject<T> for Twhere
T: Object,
fn project(self) -> Projection<Self>
Source§impl<T> RotateObject for Twhere
T: Object,
impl<T> RotateObject for Twhere
T: Object,
fn rotate<T>(self, x: T, y: T, z: T) -> Rotate<Self>
fn rotate_x<T>(self, x: T) -> Rotate<Self>
fn rotate_y<T>(self, y: T) -> Rotate<Self>
fn rotate_z<T>(self, z: T) -> Rotate<Self>
fn rotate_xy<T>(self, x: T, y: T) -> Rotate<Self>
fn rotate_yz<T>(self, y: T, z: T) -> Rotate<Self>
fn rotate_xz<T>(self, x: T, z: T) -> Rotate<Self>
Source§impl<T> ScaleObject for Twhere
T: Object,
impl<T> ScaleObject for Twhere
T: Object,
fn scale_uniform<T>(self, scaler: T) -> Scale<Self>
fn scale<T>(self, x: T, y: T, z: T) -> Scale<Self>
fn scale_x<T>(self, x: T) -> Scale<Self>
fn scale_y<T>(self, y: T) -> Scale<Self>
fn scale_z<T>(self, z: T) -> Scale<Self>
fn scale_xy<T>(self, x: T, y: T) -> Scale<Self>
fn scale_xz<T>(self, x: T, z: T) -> Scale<Self>
fn scale_yz<T>(self, y: T, z: T) -> Scale<Self>
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.