Plexus is a Rust library for generating and manipulating 3D meshes.
Meshes can be generated from primitives like cubes and spheres using iterator
expressions. Primitives emit topological structures like Triangle
s or
Quad
s, which contain arbitrary geometric data in their vertices. These can be
transformed and decomposed into other topologies and geometric data via
triangulation, tesselation, and conversion into rendering pipeline data.
```rust use ordered_float::OrderedFloat; use plexus::buffer::conjoint::ConjointBuffer; use plexus::generate::{sphere, MapVertices, SpatialPolygons};
use render::{self, Vertex}; // Module in the local crate providing rendering.
type r32 = OrderedFloatf32
with Eq
and Hash
implementations.
// Construct a buffer of index and vertex data from a sphere primitive and
// render it. Note that (r32, r32, r32)
is convertible to Vertex
via the
// From
trait in this example.
let buffer = sphere::UVSphere::