opensubdiv-rs 0.7.0

A faithful Rust port of Pixar's OpenSubdiv subdivision-surface library (Sdc / Vtr / Far layers)
Documentation
//! **Far** — Feature Adaptive Representation.
//!
//! Port of OpenSubdiv's `opensubdiv/far` layer: the public, client-facing
//! API of the library.
//!
//! * [`TopologyDescriptor`] — a lightweight, borrowed description of a
//!   mesh's topology (face-vertex lists, creases, corners, holes).
//! * [`TopologyRefinerFactory`] — validates a descriptor and constructs a
//!   [`TopologyRefiner`].
//! * [`TopologyRefiner`] — stores the hierarchy of refinement
//!   [levels](TopologyLevel) and performs [uniform
//!   refinement](TopologyRefiner::refine_uniform) or [feature-adaptive
//!   refinement](TopologyRefiner::refine_adaptive).
//! * [`PrimvarRefiner`] — interpolates primvar data (positions, colors, …)
//!   from one level to the next, and onto the limit surface — including
//!   face-varying channels (UVs) declared on the descriptor.
//! * [`StencilTable`] / [`StencilTableFactory`] — factorize the whole
//!   refinement (or limit evaluation) into flat per-vertex stencils on the
//!   base-level control vertices, for uniform and adaptive hierarchies
//!   alike; [`LimitStencilTable`] / [`LimitStencilTableFactory`] — limit
//!   stencils (position and first derivatives) at arbitrary
//!   `(ptex face, u, v)` locations, factorized through the patch table
//!   down to the base cage.
//! * [`PatchTable`] / [`PatchTableFactory`] / [`PatchMap`] — parametric
//!   patches covering the limit surface (B-spline and Gregory patches for
//!   Catmark, box-spline and Gregory triangle patches for Loop), located
//!   by ptex face and `(u, v)`, with optional face-varying patches per
//!   channel ([`PatchTableOptions`]).

mod fvar;
pub(crate) mod gregory;
pub(crate) mod loop_patch;
pub(crate) mod patch_table;
mod primvar_refiner;
mod ptex;
mod stencil_table;
mod topology_descriptor;
mod topology_refiner;

pub use crate::vtr::TopologyError as Error;
pub use fvar::FVarChannel;
pub use patch_table::{
    PatchBasis, PatchMap, PatchParam, PatchTable, PatchTableFactory, PatchTableOptions, PatchType,
};
pub use primvar_refiner::{Primvar, PrimvarRefiner};
pub use ptex::PtexIndices;
pub use stencil_table::{
    LimitStencil, LimitStencilTable, LimitStencilTableFactory, LocationArray, Stencil,
    StencilTable, StencilTableFactory, StencilTableOptions,
};
pub use topology_descriptor::{FVarChannelDescriptor, TopologyDescriptor};
pub use topology_refiner::{
    AdaptiveOptions, TopologyLevel, TopologyRefiner, TopologyRefinerFactory, UniformOptions,
};