axiolid_primitive/solid.rs
1//! Bounded analytic solid primitives.
2
3use axiolid_core::Scalar;
4
5/// Exact primitive solid; tessellation is a separate operation.
6#[non_exhaustive]
7#[derive(Debug, Clone, Copy, PartialEq)]
8pub enum Primitive {
9 /// Axis-aligned box in local coordinates.
10 Block {
11 /// Extent along x.
12 x: Scalar,
13 /// Extent along y.
14 y: Scalar,
15 /// Extent along z.
16 z: Scalar,
17 },
18 /// Sphere centered at the local origin.
19 Sphere {
20 /// Radius.
21 radius: Scalar,
22 },
23 /// Cylinder along local +z.
24 Cylinder {
25 /// Radius.
26 radius: Scalar,
27 /// Height.
28 height: Scalar,
29 },
30 /// Cone along local +z.
31 Cone {
32 /// Base radius.
33 radius: Scalar,
34 /// Height.
35 height: Scalar,
36 },
37 /// Rectangular pyramid along local +z.
38 Pyramid {
39 /// Base extent along x.
40 x: Scalar,
41 /// Base extent along y.
42 y: Scalar,
43 /// Height.
44 height: Scalar,
45 },
46}