Skip to main content

opensubdiv_rs/far/
mod.rs

1//! **Far** — Feature Adaptive Representation.
2//!
3//! Port of OpenSubdiv's `opensubdiv/far` layer: the public, client-facing
4//! API of the library.
5//!
6//! * [`TopologyDescriptor`] — a lightweight, borrowed description of a
7//!   mesh's topology (face-vertex lists, creases, corners, holes).
8//! * [`TopologyRefinerFactory`] — validates a descriptor and constructs a
9//!   [`TopologyRefiner`].
10//! * [`TopologyRefiner`] — stores the hierarchy of refinement
11//!   [levels](TopologyLevel) and performs [uniform
12//!   refinement](TopologyRefiner::refine_uniform) or [feature-adaptive
13//!   refinement](TopologyRefiner::refine_adaptive).
14//! * [`PrimvarRefiner`] — interpolates primvar data (positions, colors, …)
15//!   from one level to the next, and onto the limit surface — including
16//!   face-varying channels (UVs) declared on the descriptor.
17//! * [`StencilTable`] / [`StencilTableFactory`] — factorize the whole
18//!   refinement (or limit evaluation) into flat per-vertex stencils on the
19//!   base-level control vertices, for uniform and adaptive hierarchies
20//!   alike; [`LimitStencilTable`] / [`LimitStencilTableFactory`] — limit
21//!   stencils (position and first derivatives) at arbitrary
22//!   `(ptex face, u, v)` locations, factorized through the patch table
23//!   down to the base cage.
24//! * [`PatchTable`] / [`PatchTableFactory`] / [`PatchMap`] — parametric
25//!   patches covering the limit surface (B-spline and Gregory patches for
26//!   Catmark, box-spline and Gregory triangle patches for Loop), located
27//!   by ptex face and `(u, v)`, with optional face-varying patches per
28//!   channel ([`PatchTableOptions`]).
29
30mod fvar;
31pub(crate) mod gregory;
32pub(crate) mod loop_patch;
33pub(crate) mod patch_table;
34mod primvar_refiner;
35mod ptex;
36mod stencil_table;
37mod topology_descriptor;
38mod topology_refiner;
39
40pub use crate::vtr::TopologyError as Error;
41pub use fvar::FVarChannel;
42pub use patch_table::{
43    PatchBasis, PatchMap, PatchParam, PatchTable, PatchTableFactory, PatchTableOptions, PatchType,
44};
45pub use primvar_refiner::{Primvar, PrimvarRefiner};
46pub use ptex::PtexIndices;
47pub use stencil_table::{
48    LimitStencil, LimitStencilTable, LimitStencilTableFactory, LocationArray, Stencil,
49    StencilTable, StencilTableFactory, StencilTableOptions,
50};
51pub use topology_descriptor::{FVarChannelDescriptor, TopologyDescriptor};
52pub use topology_refiner::{
53    AdaptiveOptions, TopologyLevel, TopologyRefiner, TopologyRefinerFactory, UniformOptions,
54};