Skip to main content

FaceMesh

Struct FaceMesh 

Source
pub struct FaceMesh {
    pub key: String,
    pub triangles: Vec<[Vector3; 3]>,
    pub normals: Vec<[Vector3; 3]>,
}
Expand description

A face triangulated, with the surface’s normal at each corner, and what it is known by: its key, a hash of what a viewer is sent of it — so a face drawn alike, in this part or another, is one mesh to a viewer.

Its corners and normals are sharp: a mesh is a polygon drawn near the face, and which point of a corner’s enclosure it is drawn through is a free choice — the middle — which a viewer is sent and a pick tests.

A viewer is sent it as a viewer draws it: each corner its triangles share once, and each triangle by its corners’ indices — in base64, the corners’ points and normals as 32-bit floats, x y z after one another, the indices as 32-bit integers, three a triangle, all little endian: {"positions", "normals", "indices"}. A tenth of a mesh’s size written as numbers.

Fields§

§key: String§triangles: Vec<[Vector3; 3]>§normals: Vec<[Vector3; 3]>

Implementations§

Source§

impl FaceMesh

Source

pub fn new(triangles: Vec<[Vector3; 3]>, normals: Vec<[Vector3; 3]>) -> Rc<Self>

The mesh of triangles, each with the normals normals at its corners, each taken at the middle of its enclosure.

Trait Implementations§

Source§

impl Debug for FaceMesh

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Serialize for FaceMesh

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. 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> 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, 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.