pub struct PatchTable {
pub control_points: Vec<[u32; 16]>,
pub faces: Vec<u32>,
/* private fields */
}Expand description
Bicubic B-spline patches over the regular quads of a refined level.
Built by RefinementResult::patch_table; see the module docs for
the exactness contract and the control-point layout.
Fields§
§control_points: Vec<[u32; 16]>16 refined-vertex indices per patch, row-major (v then u), one entry per regular refined quad; feature quads get no patch here.
faces: Vec<u32>The refined face each patch covers (index into face CSR).
Implementations§
Source§impl PatchTable
impl PatchTable
Sourcepub fn quad_class(&self, face: u32) -> QuadClass
pub fn quad_class(&self, face: u32) -> QuadClass
Classification of refined face face.
Sourcepub fn face_patch(&self, face: u32) -> Option<u32>
pub fn face_patch(&self, face: u32) -> Option<u32>
The patch covering refined face face
(faces[patch] == face), None for feature quads.
Sourcepub fn eval(
&self,
patch: usize,
uv: [f32; 2],
control_positions: &[[f32; 3]],
) -> [f32; 3]
pub fn eval( &self, patch: usize, uv: [f32; 2], control_positions: &[[f32; 3]], ) -> [f32; 3]
Limit position of patch patch at in-quad (u, v).
control_positions is indexed by the patch’s control-point
entries, i.e. one position per refined vertex. The basis is
accumulated in f64 and rounded once on return.
Sourcepub fn eval_with_derivatives(
&self,
patch: usize,
uv: [f32; 2],
control_positions: &[[f32; 3]],
) -> ([f32; 3], [f32; 3], [f32; 3])
pub fn eval_with_derivatives( &self, patch: usize, uv: [f32; 2], control_positions: &[[f32; 3]], ) -> ([f32; 3], [f32; 3], [f32; 3])
Limit position and first derivatives (p, dp/du, dp/dv) of
patch patch at in-quad (u, v).
Derivatives are with respect to the quad’s own [0, 1]^2
parameterization (see the module docs for the scale);
dp/du x dp/dv is the winding-oriented surface normal.
Trait Implementations§
Source§impl Clone for PatchTable
impl Clone for PatchTable
Source§fn clone(&self) -> PatchTable
fn clone(&self) -> PatchTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PatchTable
impl Debug for PatchTable
Source§impl PartialEq for PatchTable
impl PartialEq for PatchTable
Source§fn eq(&self, other: &PatchTable) -> bool
fn eq(&self, other: &PatchTable) -> bool
self and other values to be equal, and is used by ==.