Trait BuildShell

Source
pub trait BuildShell {
    // Provided methods
    fn empty() -> Shell { ... }
    fn from_vertices_and_indices(
        vertices: impl IntoIterator<Item = impl Into<Point<3>>>,
        indices: impl IntoIterator<Item = [usize; 3]>,
        core: &mut Core,
    ) -> Shell { ... }
    fn tetrahedron(
        points: [impl Into<Point<3>>; 4],
        core: &mut Core,
    ) -> TetrahedronShell { ... }
}
Expand description

Build a Shell

See module-level documentation for context.

Provided Methods§

Source

fn empty() -> Shell

Build an empty shell

Source

fn from_vertices_and_indices( vertices: impl IntoIterator<Item = impl Into<Point<3>>>, indices: impl IntoIterator<Item = [usize; 3]>, core: &mut Core, ) -> Shell

Build a polyhedron by specifying its vertices and indices

Source

fn tetrahedron( points: [impl Into<Point<3>>; 4], core: &mut Core, ) -> TetrahedronShell

Build a tetrahedron from the provided points

Accepts 4 points, naturally. For the purposes of the following discussion, let’s call those a, b, c, and d, and assume that the order they are listed in here matches the order they are provided in within the array.

Assumes that a, b, and c form a triangle in counter-clockwise order, when arranging the viewpoint such that it is on the opposite side of the triangle from d. If this assumption is met, the orientation of all faces of the tetrahedron will be valid, meaning their counter-clockwise sides are outside.

§Implementation Note

In principle, this method doesn’t need to make assumptions about the order of the points provided. It could, given some extra effort, just build a correct tetrahedron, regardless of that order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§