Skip to main content

Topology

Struct Topology 

Source
pub struct Topology {
    pub directed: HashMap<(usize, usize), (usize, usize)>,
    pub fans: Vec<(Vec<(usize, usize)>, bool)>,
}
Expand description

How the faces of a mesh fit together: which face runs along each directed edge, and the faces around each vertex in order.

Fields§

§directed: HashMap<(usize, usize), (usize, usize)>

(a, b): the face that runs from a to b, and the corner of it at a.

§fans: Vec<(Vec<(usize, usize)>, bool)>

Per vertex: the faces around it, each with its corner there, in order — each next one across the edge to the previous one’s preceding corner — and whether they close up all round, rather than meeting the mesh’s boundary on both ends.

Implementations§

Source§

impl Topology

Source

pub fn new( vertex_count: usize, faces: &[Vec<usize>], vertex_names: &[String], face_names: &[String], ) -> GeopResult<Self>

The topology of faces over vertex_count vertices. Fails, naming the elements with vertex_names and face_names, for a mesh no limit surface can be built from: a face of fewer than three vertices, or through one twice; faces turned against each other (an edge run the same way twice), or more than two meeting at an edge; faces around a vertex that do not make one fan; a vertex of no face; an inner vertex of fewer than three faces.

Source

pub fn is_boundary(&self, a: usize, b: usize) -> bool

Whether only one face runs along the edge between a and b.

Source

pub fn edges(&self) -> BTreeMap<[usize; 2], Vec<usize>>

Every edge, the smaller index first, with its faces.

Trait Implementations§

Source§

impl Clone for Topology

Source§

fn clone(&self) -> Topology

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 Topology

Source§

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

Formats the value using the given formatter. Read more

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> 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.