#[non_exhaustive]pub enum Primitive {
Block {
x: f64,
y: f64,
z: f64,
},
Sphere {
radius: f64,
},
Cylinder {
radius: f64,
height: f64,
},
Cone {
radius: f64,
height: f64,
},
Pyramid {
x: f64,
y: f64,
height: f64,
},
Torus {
major_radius: f64,
minor_radius: f64,
},
Wedge {
x: f64,
y: f64,
height: f64,
top_x_min: f64,
top_x_max: f64,
top_y_min: f64,
top_y_max: f64,
},
}Expand description
Exact primitive solid; tessellation is a separate operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Block
Axis-aligned box in local coordinates.
Sphere
Sphere centered at the local origin.
Cylinder
Cylinder along local +z.
Cone
Cone along local +z.
Pyramid
Rectangular pyramid along local +z.
Torus
Ring torus centred on the local origin, about local +z.
The tube’s centre circle has radius major_radius in the plane
z = 0. Only a ring torus, 0 < minor_radius < major_radius, is a
valid solid: at minor == major (a horn torus) the tube pinches the
axis to a point, and past it (a spindle torus) the tube overlaps
itself, so neither bounds a two-manifold solid.
Wedge
Wedge: a box whose top face is narrowed or shifted, as OCCT’s
BRepPrimAPI_MakeWedge(dx, dy, dz, xmin, zmin, xmax, zmax) with
OCCT’s y (the height) read as local +z here.
The base is the rectangle [0, x] x [0, y] at z = 0 and the top is
[top_x_min, top_x_max] x [top_y_min, top_y_max] at z = height.
Every face is planar and the solid is the convex hull of the two
rectangles. The top may collapse to a segment (top_x_min == top_x_max or top_y_min == top_y_max, a wedge proper) or to a point
(a pyramid with its apex anywhere); OCCT’s ltx form is top_x_min = 0, top_x_max = ltx, top_y_min = 0, top_y_max = y.
Trait Implementations§
Source§impl From<Primitive> for GeometryNode
impl From<Primitive> for GeometryNode
Source§fn from(value: Primitive) -> GeometryNode
fn from(value: Primitive) -> GeometryNode
impl BuiltInNode for Primitive
impl Copy for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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