Skip to main content

viewport_lib_geometry/
lib.rs

1//! CPU geometry algorithms that operate on `viewport-lib-types` payloads without
2//! touching the GPU.
3//!
4//! - [`primitives`]: built-in meshes (cube, sphere, torus and the rest).
5//! - [`mesh`]: operations on triangle meshes, including clip-plane caps and
6//!   isolines.
7//! - [`volume`]: regular scalar grids, marching cubes isosurfaces, and
8//!   unstructured volume meshes.
9//! - [`maths`]: small helpers such as ray/plane intersection.
10//!
11//! Everything returns plain data, usually a
12//! [`MeshData`](viewport_lib_types::data::mesh::MeshData) the renderer can
13//! upload, but nothing here needs the renderer to run.
14
15pub mod maths;
16pub mod mesh;
17pub mod primitives;
18pub mod volume;
19
20mod util;
21
22pub mod prelude {
23    //! The geometry entry points, in one glob import:
24    //! `use viewport_lib_geometry::prelude::*;`.
25    pub use crate::volume::grid::VolumeData;
26    pub use crate::volume::marching_cubes::extract_isosurface;
27    pub use crate::volume::mesh::{
28        CELL_SENTINEL, GridCells, VolumeMeshData, extract_volume_mesh_isosurface,
29    };
30}