Manifold

Struct Manifold 

Source
pub struct Manifold(/* private fields */);
Expand description

Manifold rust wrapper for C++ manifold object.

Implementations§

Source§

impl Manifold

Source

pub fn is_empty(&self) -> bool

Does Manifold contain triangles?

Source

pub fn slice(&self, height: f64) -> Polygons

Slice the manifold into a set of polygons.

Source

pub fn project(&self) -> Polygons

Project the manifold onto a plane and return the resulting polygons.

Source

pub fn trim_by_plane(&self, x: f64, y: f64, z: f64, offset: f64) -> Manifold

Trim by a plane.

Source

pub fn hull(&self) -> Manifold

Convex hull.

Source

pub fn translate(&self, x: f64, y: f64, z: f64) -> Manifold

Translate the manifold.

Source

pub fn scale(&self, x: f64, y: f64, z: f64) -> Manifold

Scale the manifold.

Source

pub fn rotate(&self, x: f64, y: f64, z: f64) -> Manifold

Rotate the manifold.

Source

pub fn empty() -> Manifold

Create empty manifold.

Source

pub fn tetrahedron() -> Manifold

Create tetrahedron manifold.

Source

pub fn sphere(radius: f64, segments: u32) -> Manifold

Create a sphere manifold.

Source

pub fn cube(x_size: f64, y_size: f64, z_size: f64) -> Manifold

Create a cube manifold.

Source

pub fn cylinder( radius_low: f64, radius_high: f64, height: f64, segments: u32, ) -> Manifold

Create a cylinder manifold.

Source

pub fn union(&self, b: &Manifold) -> Manifold

Get the union of two manifolds.

Source

pub fn intersection(&self, b: &Manifold) -> Manifold

Get the intersection of two manifolds.

Source

pub fn difference(&self, b: &Manifold) -> Manifold

Get the difference of two manifolds.

Source

pub fn boolean_op(&self, b: &Manifold, op: BooleanOp) -> Manifold

Boolean operation on manifolds.

Source

pub fn extrude( multi_polygon_data: &[&[f64]], height: f64, n_divisions: u32, twist_degrees: f64, scale_top_x: f64, scale_top_y: f64, ) -> Manifold

Extrude a polygon to create a manifold.

Source

pub fn revolve( multi_polygon_data: &[&[f64]], circular_segments: u32, revolve_degrees: f64, ) -> Manifold

Revolve a polygon to create a manifold.

Source

pub fn refine(&self, n: i32) -> Manifold

Refine manifold.

Source

pub fn refine_to_length(&self, t: f64) -> Manifold

Refine manifold to Length.

Source

pub fn refine_to_tolerance(&self, t: f64) -> Manifold

Refine to tolerance.

Source

pub fn smooth_by_normals(&self, normal_idx: i32) -> Manifold

Smooth by normals.

Source

pub fn smooth_out(&self, min_sharp_angle: f64, min_smoothness: f64) -> Manifold

Smooth out.

Source

pub fn calculate_normals( &self, normal_idx: i32, min_sharp_angle: f64, ) -> Manifold

Calculate normals for the manifold and return a new one.

Source

pub fn to_mesh(&self) -> Mesh

Get the mesh representation of the manifold.

Source

pub fn from_mesh(mesh: Mesh) -> Manifold

Create a manifold from a mesh.

Trait Implementations§

Source§

impl From<Manifold> for TriangleMesh

Source§

fn from(manifold: Manifold) -> Self

Converts to this type from the input type.
Source§

impl From<Mesh> for Manifold

Convert Mesh to Manifold struct

Source§

fn from(mesh: Mesh) -> Manifold

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool