Skip to main content

Mesh

Struct Mesh 

Source
pub struct Mesh {
    pub vertex_names: Vec<String>,
    pub positions: Vec<[f64; 3]>,
    pub face_names: Vec<String>,
    pub faces: Vec<Vec<usize>>,
    pub sharp: BTreeSet<[usize; 2]>,
    pub soft: BTreeMap<[usize; 2], f64>,
}
Expand description

The cage as the limit surface is built from it: indexed, the mirror image added, every element named.

Fields§

§vertex_names: Vec<String>

Per vertex: its name (v3, v3m) and where it is.

§positions: Vec<[f64; 3]>§face_names: Vec<String>

Per face: its name (f7, f7m) and its vertices, counter-clockwise seen from outside.

§faces: Vec<Vec<usize>>§sharp: BTreeSet<[usize; 2]>

The edges kept sharp, the smaller index first.

§soft: BTreeMap<[usize; 2], f64>

The edges creased soft, by their sharpness in (0, 1) (see Crease).

Implementations§

Source§

impl Mesh

Source

pub fn new(cage: &Cage, mirror: Mirror) -> GeopResult<Self>

cage, and, if mirror names a plane, its mirror image in it, joined to it at the vertices on the plane. Fails, naming the elements, for a cage no limit surface can be built from (see Topology::new), and for a mirrored one with a face lying in the plane, or reaching across it.

Source

pub fn edge_name(&self, a: usize, b: usize) -> String

The name of the edge between vertices a and b, as a cage element: e3-5, or, on the mirrored half, e3m-5m.

Source§

impl Mesh

Source

pub fn topology(&self) -> GeopResult<Topology>

The mesh’s topology, checked (see Topology::new), and checked to be in one piece.

Trait Implementations§

Source§

impl Clone for Mesh

Source§

fn clone(&self) -> Mesh

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mesh

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Mesh

§

impl RefUnwindSafe for Mesh

§

impl Send for Mesh

§

impl Sync for Mesh

§

impl Unpin for Mesh

§

impl UnsafeUnpin for Mesh

§

impl UnwindSafe for Mesh

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.