pub struct AdHocShape(pub Shape);Expand description
Wrapper for the Shape struct that provides an “ad-hoc” API. New code is encouraged
to use more fine-grained API in the [primitives] module.
Tuple Fields§
§0: ShapeImplementations§
Source§impl AdHocShape
impl AdHocShape
Sourcepub fn make_box(x: f64, y: f64, z: f64) -> Self
pub fn make_box(x: f64, y: f64, z: f64) -> Self
Make a box with a corner at (0,0,0) and with size (x,y,z)
Sourcepub fn make_box_point_point(p1: DVec3, p2: DVec3) -> Self
pub fn make_box_point_point(p1: DVec3, p2: DVec3) -> Self
Make a box with one corner at p1, and the opposite corner at p2.
Sourcepub fn make_cylinder(p: DVec3, r: f64, h: f64) -> Self
pub fn make_cylinder(p: DVec3, r: f64, h: f64) -> Self
Make a cylinder with its bottom at point p, with radius r and height h.
Sourcepub fn extrude_polygon(points: &[DVec3], h: f64) -> Self
pub fn extrude_polygon(points: &[DVec3], h: f64) -> Self
Purposefully underpowered for now, this simply takes a list of points, creates a face out of them, and then extrudes it by h in the positive Z direction.
Sourcepub fn drill_hole(&mut self, p: DVec3, dir: DVec3, radius: f64)
pub fn drill_hole(&mut self, p: DVec3, dir: DVec3, radius: f64)
Drills a cylindrical hole starting at point p, pointing down the Z axis (this will later change to be an arbitrary axis).
pub fn write_stl<P: AsRef<Path>>(&self, path: P)
pub fn fillet_edges(&mut self, radius: f64)
pub fn chamfer_edges(&mut self, distance: f64)
pub fn subtract(&mut self, other: &Shape)
pub fn union(&mut self, other: &Shape)
pub fn intersect(&mut self, other: &Shape)
Methods from Deref<Target = Shape>§
pub fn shape_type(&self) -> ShapeType
pub fn fillet_edge(&mut self, radius: f64, edge: &Edge)
pub fn chamfer_edge(&mut self, distance: f64, edge: &Edge)
pub fn fillet_edges<T: AsRef<Edge>>( &mut self, radius: f64, edges: impl IntoIterator<Item = T>, )
pub fn chamfer_edges<T: AsRef<Edge>>( &mut self, distance: f64, edges: impl IntoIterator<Item = T>, )
Sourcepub fn chamfer(&mut self, distance: f64)
pub fn chamfer(&mut self, distance: f64)
Performs chamfer of distance on all edges of the shape
pub fn subtract(&self, other: &Shape) -> BooleanShape
pub fn write_step(&self, path: impl AsRef<Path>) -> Result<(), Error>
pub fn union(&self, other: &Shape) -> BooleanShape
pub fn write_stl<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
pub fn clean(&mut self)
pub fn set_global_translation(&mut self, translation: DVec3)
pub fn mesh(&self) -> Mesh
pub fn edges(&self) -> EdgeIterator ⓘ
pub fn faces(&self) -> FaceIterator ⓘ
pub fn faces_along_ray( &self, ray_start: DVec3, ray_dir: DVec3, ) -> Vec<(Face, DVec3)>
Trait Implementations§
Source§impl Deref for AdHocShape
impl Deref for AdHocShape
Source§impl DerefMut for AdHocShape
impl DerefMut for AdHocShape
Source§impl From<AdHocShape> for Shape
impl From<AdHocShape> for Shape
Source§fn from(adhoc_shape: AdHocShape) -> Self
fn from(adhoc_shape: AdHocShape) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AdHocShape
impl RefUnwindSafe for AdHocShape
impl !Send for AdHocShape
impl !Sync for AdHocShape
impl Unpin for AdHocShape
impl UnwindSafe for AdHocShape
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