pub struct TensorProductPatch {
pub control_points: [Point; 16],
pub colors: [ColorComponents; 4],
}Expand description
A tensor-product patch.
Fields§
§control_points: [Point; 16]The control points of the tensor-product patch (4x4 grid = 16 points).
colors: [ColorComponents; 4]The colors at each corner of the tensor-product patch.
Implementations§
Source§impl TensorProductPatch
impl TensorProductPatch
Sourcepub fn map_coordinate(&self, p: Point) -> Point
pub fn map_coordinate(&self, p: Point) -> Point
Map the point to the coordinates of the tensor product patch.
Sourcepub fn to_triangles(&self, buffer: &mut Vec<Triangle>)
pub fn to_triangles(&self, buffer: &mut Vec<Triangle>)
Approximate the tensor product patch mesh by triangles.
Sourcepub fn interpolate(&self, pos: Point) -> ColorComponents
pub fn interpolate(&self, pos: Point) -> ColorComponents
Get the interpolated colors of the point from the patch.
Trait Implementations§
Source§impl Clone for TensorProductPatch
impl Clone for TensorProductPatch
Source§fn clone(&self) -> TensorProductPatch
fn clone(&self) -> TensorProductPatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TensorProductPatch
impl RefUnwindSafe for TensorProductPatch
impl Send for TensorProductPatch
impl Sync for TensorProductPatch
impl Unpin for TensorProductPatch
impl UnwindSafe for TensorProductPatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more