pub struct BspBackend;Expand description
BSP-based CSG backend.
Trait Implementations§
Source§impl CsgBackend for BspBackend
impl CsgBackend for BspBackend
Source§type SketchType = Csg<f64>
type SketchType = Csg<f64>
2D sketch / cross-section type produced by this backend.
fn empty_csg() -> Csg<f64>
fn empty_sketch() -> Csg<f64>
fn union(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn difference(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn intersection(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn xor(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn union_2d(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn difference_2d(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn intersection_2d(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn xor_2d(a: Csg<f64>, b: Csg<f64>) -> Csg<f64>
fn translate(csg: Csg<f64>, offset: DVec3) -> Csg<f64>
fn rotate(csg: Csg<f64>, angles: DVec3) -> Csg<f64>
fn scale(csg: Csg<f64>, factors: DVec3) -> Csg<f64>
fn mirror(csg: Csg<f64>, axes: DVec3) -> Csg<f64>
fn translate_2d(sketch: Csg<f64>, offset: DVec3) -> Csg<f64>
fn rotate_2d(sketch: Csg<f64>, angles: DVec3) -> Csg<f64>
fn scale_2d(sketch: Csg<f64>, factors: DVec3) -> Csg<f64>
fn mirror_2d(sketch: Csg<f64>, axes: DVec3) -> Csg<f64>
fn color(csg: Csg<f64>, color: [f32; 4]) -> Csg<f64>
fn color_2d(sketch: Csg<f64>, color: [f32; 4]) -> Csg<f64>
fn extrude( sketch: Csg<f64>, height: f64, twist: f64, scale: f64, slices: usize, ) -> Csg<f64>
Source§impl CsgToMesh for BspBackend
Available on crate feature bridge-bevy only.
impl CsgToMesh for BspBackend
Available on crate feature
bridge-bevy only.fn to_bevy_mesh(solid: &Csg<f64>) -> Mesh
Source§impl CsgToStl for BspBackend
impl CsgToStl for BspBackend
Source§impl DynamicBackend for BspBackend
impl DynamicBackend for BspBackend
Source§const SKETCH_IS_CSG: bool = true
const SKETCH_IS_CSG: bool = true
2D and 3D share Csg<f64>; bare sketches keep their geometry in 3D
context (and vice versa) through the identity bridges below.
fn cube(size: [f64; 3]) -> Csg<f64>
Source§fn sphere(radius: f64, segments: usize, stacks: usize) -> Csg<f64>
fn sphere(radius: f64, segments: usize, stacks: usize) -> Csg<f64>
stacks is advisory; backends with a single tessellation knob ignore it.fn cylinder(radius: f64, height: f64, segments: usize) -> Csg<f64>
fn cone(radius: f64, height: f64, segments: usize) -> Csg<f64>
fn circle(radius: f64, segments: usize) -> Csg<f64>
fn square(size: [f64; 2]) -> Csg<f64>
fn polygon(points: &[[f64; 2]]) -> Csg<f64>
Source§fn sketch(loops: &[Vec<DVec2>]) -> Csg<f64>
fn sketch(loops: &[Vec<DVec2>]) -> Csg<f64>
Build a profile from winding-normalized loops (CCW outers, CW holes)
as produced by
rscad_core::sketch::profile_loops.Source§fn sketch_as_csg(sketch: Csg<f64>) -> Csg<f64>
fn sketch_as_csg(sketch: Csg<f64>) -> Csg<f64>
Bare 2D geometry appearing in 3D context. Only called when
SKETCH_IS_CSG is true.Source§fn csg_as_sketch(csg: Csg<f64>) -> Csg<f64>
fn csg_as_sketch(csg: Csg<f64>) -> Csg<f64>
3D geometry appearing in 2D context. Only called when
SKETCH_IS_CSG is true.Source§fn 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.Source§fn 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
Source§impl ToSketch<BspBackend> for PolygonDynamic
impl ToSketch<BspBackend> for PolygonDynamic
Auto Trait Implementations§
impl Freeze for BspBackend
impl RefUnwindSafe for BspBackend
impl Send for BspBackend
impl Sync for BspBackend
impl Unpin for BspBackend
impl UnsafeUnpin for BspBackend
impl UnwindSafe for BspBackend
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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> 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> 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>
Converts
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>
Converts
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<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>
Converts this type into the system output type.
§impl<T> Pointable for T
impl<T> Pointable for 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.