ogeom_topo/lib.rs
1//! The boundary-representation data model. What this model can express is what
2//! the kernel can do, so its invariants are normative; see `docs/DATA_MODEL.md`.
3//!
4//! Non-negotiable invariants:
5//!
6//! - A shape is a **(TShape, Location, Orientation) triple**: a positionless,
7//! orientationless shared topology node plus a placement plus an orientation.
8//! Cheap to copy; the heavy data lives once in an arena.
9//! - **Location is a chain** of `(datum, power)` pairs, not a flat 4x4. Composition
10//! is list concatenation and the composed transform is computed lazily. This is
11//! what lets an assembly of 10,000 identical bolts share one piece of geometry,
12//! and what keeps identical-instance detection a cheap chain comparison.
13//! - **Orientation composes multiplicatively** down the tree. An edge's effective
14//! orientation inside a face depends on that face's orientation inside its shell.
15//! - **Identity is a trichotomy**: same (tshape + location), equal (+ orientation),
16//! partner (tshape only), each with a consistent hasher. Conflating these is a
17//! classic source of silent bugs.
18//! - **Tolerances are per-entity**, with `tol(vertex) >= tol(edge) >= tol(face)`, and
19//! they grow through operations. This is the kernel's answer to inexact
20//! arithmetic.
21//! - **An edge carries a list of representations**, not one curve: a 3D curve, one
22//! pcurve per adjacent face, two pcurves for a seam edge on a closed surface, plus
23//! polygon and triangulation representations, with a `same_parameter` flag and a
24//! repair routine.
25
26mod content;
27pub mod entity;
28mod kept;
29pub mod location;
30pub mod model;
31pub mod shape;
32pub mod tessellation;
33
34pub use content::face_content;
35pub use entity::{
36 CurveId, EdgeData, EdgeRepr, FaceData, GeometryStore, NodeData, PCurveId, SurfaceId,
37 TriangulationId, VertexData, check_containment, enforce_containment,
38};
39pub use location::{Datum, DatumId, DatumStore, Location};
40pub use model::{
41 Absorbed, Filter, Model, ModelParts, Unshared, WidenMark, ancestors_of, explore, explore_unique,
42};
43pub use shape::{Orientation, PartnerKey, SameKey, Shape, ShapeType, TShape, TShapeId};
44pub use tessellation::Triangulation;