Skip to main content

axiolid_surface/
lib.rs

1#![forbid(unsafe_code)]
2
3//! Exact, format-neutral surface representations and evaluation contracts.
4//!
5//! Bounded, swept, offset, and curve-on-surface relationships are nodes in
6//! `axiolid-model`; this crate contains atomic surface data only.
7
8pub mod elementary;
9pub mod evaluate;
10pub mod spline;
11
12pub use elementary::{Cone, Cylinder, EllipticalCylinder, Plane, Sphere, Torus};
13pub use evaluate::SurfaceEvaluator;
14pub use spline::BSplineSurface;
15
16/// Atomic three-dimensional surface values.
17#[non_exhaustive]
18#[derive(Debug, Clone, PartialEq)]
19#[cfg_attr(
20    feature = "serde",
21    derive(serde::Serialize, serde::Deserialize),
22    serde(deny_unknown_fields)
23)]
24pub enum Surface {
25    /// Plane.
26    Plane(Plane),
27    /// Circular cylinder.
28    Cylinder(Cylinder),
29    /// Elliptical cylinder.
30    EllipticalCylinder(EllipticalCylinder),
31    /// Right circular cone.
32    Cone(Cone),
33    /// Sphere.
34    Sphere(Sphere),
35    /// Torus.
36    Torus(Torus),
37    /// Polynomial or rational B-spline surface.
38    BSpline(BSplineSurface),
39}