pub struct ManifoldBackend;Expand description
Manifold C++ kernel CSG backend.
Trait Implementations§
Source§impl CsgBackend for ManifoldBackend
impl CsgBackend for ManifoldBackend
Source§type CsgType = ManifoldSolid
type CsgType = ManifoldSolid
3D solid type produced by this backend.
Source§type SketchType = CrossSection
type SketchType = CrossSection
2D sketch / cross-section type produced by this backend.
fn empty_csg() -> ManifoldSolid
fn empty_sketch() -> CrossSection
fn union(a: ManifoldSolid, b: ManifoldSolid) -> ManifoldSolid
fn difference(a: ManifoldSolid, b: ManifoldSolid) -> ManifoldSolid
fn intersection(a: ManifoldSolid, b: ManifoldSolid) -> ManifoldSolid
fn xor(a: ManifoldSolid, b: ManifoldSolid) -> ManifoldSolid
fn union_2d(a: CrossSection, b: CrossSection) -> CrossSection
fn difference_2d(a: CrossSection, b: CrossSection) -> CrossSection
fn intersection_2d(a: CrossSection, b: CrossSection) -> CrossSection
fn xor_2d(a: CrossSection, b: CrossSection) -> CrossSection
fn translate(csg: ManifoldSolid, offset: DVec3) -> ManifoldSolid
fn rotate(csg: ManifoldSolid, angles: DVec3) -> ManifoldSolid
fn scale(csg: ManifoldSolid, factors: DVec3) -> ManifoldSolid
fn mirror(csg: ManifoldSolid, axes: DVec3) -> ManifoldSolid
fn translate_2d(sketch: CrossSection, offset: DVec3) -> CrossSection
fn rotate_2d(sketch: CrossSection, angles: DVec3) -> CrossSection
fn scale_2d(sketch: CrossSection, factors: DVec3) -> CrossSection
fn mirror_2d(sketch: CrossSection, axes: DVec3) -> CrossSection
fn color(csg: ManifoldSolid, color: [f32; 4]) -> ManifoldSolid
fn color_2d(sketch: CrossSection, _color: [f32; 4]) -> CrossSection
fn extrude( sketch: CrossSection, height: f64, twist: f64, scale: f64, slices: usize, ) -> ManifoldSolid
Source§impl CsgToMesh for ManifoldBackend
Available on crate feature bevy only.
impl CsgToMesh for ManifoldBackend
Available on crate feature
bevy only.fn to_bevy_mesh(solid: &ManifoldSolid) -> Mesh
Source§impl CsgToStl for ManifoldBackend
impl CsgToStl for ManifoldBackend
fn write_stl_binary(solid: &ManifoldSolid, writer: &mut dyn Write) -> Result<()>
fn write_stl_ascii(solid: &ManifoldSolid, writer: &mut dyn Write) -> Result<()>
Source§impl DynamicBackend for ManifoldBackend
impl DynamicBackend for ManifoldBackend
fn cube(size: [f64; 3]) -> ManifoldSolid
Source§fn sphere(radius: f64, segments: usize, _stacks: usize) -> ManifoldSolid
fn sphere(radius: f64, segments: usize, _stacks: usize) -> ManifoldSolid
stacks is advisory; backends with a single tessellation knob ignore it.fn cylinder(radius: f64, height: f64, segments: usize) -> ManifoldSolid
fn cone(radius: f64, height: f64, segments: usize) -> ManifoldSolid
fn circle(radius: f64, segments: usize) -> CrossSection
fn square(size: [f64; 2]) -> CrossSection
fn polygon(points: &[[f64; 2]]) -> CrossSection
Source§fn sketch(loops: &[Vec<DVec2>]) -> CrossSection
fn sketch(loops: &[Vec<DVec2>]) -> CrossSection
Build a profile from winding-normalized loops (CCW outers, CW holes)
as produced by
rscad_core::sketch::profile_loops.Source§fn offset(
sketch: CrossSection,
delta: f64,
round: bool,
chamfer: bool,
segments: usize,
) -> CrossSection
fn offset( sketch: CrossSection, delta: f64, round: bool, chamfer: bool, segments: usize, ) -> CrossSection
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<ManifoldSolid>) -> ManifoldSolid
fn union_all(items: Vec<ManifoldSolid>) -> ManifoldSolid
N-ary union; override when the backend has a batch operation.
fn union_all_2d(items: Vec<CrossSection>) -> CrossSection
Source§const 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.Source§fn 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.Source§fn 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.Source§impl ToCsg<ManifoldBackend> for Cube
impl ToCsg<ManifoldBackend> for Cube
fn to_csg(&self) -> ManifoldSolid
Source§impl ToCsg<ManifoldBackend> for Cylinder
impl ToCsg<ManifoldBackend> for Cylinder
fn to_csg(&self) -> ManifoldSolid
Source§impl ToCsg<ManifoldBackend> for Sphere
impl ToCsg<ManifoldBackend> for Sphere
fn to_csg(&self) -> ManifoldSolid
Source§impl<T: Object + ToSketch<ManifoldBackend>> ToSketch<ManifoldBackend> for Offset<T>
impl<T: Object + ToSketch<ManifoldBackend>> ToSketch<ManifoldBackend> for Offset<T>
Source§impl ToSketch<ManifoldBackend> for PolygonDynamic
impl ToSketch<ManifoldBackend> for PolygonDynamic
Auto Trait Implementations§
impl Freeze for ManifoldBackend
impl RefUnwindSafe for ManifoldBackend
impl Send for ManifoldBackend
impl Sync for ManifoldBackend
impl Unpin for ManifoldBackend
impl UnsafeUnpin for ManifoldBackend
impl UnwindSafe for ManifoldBackend
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.