pub struct CylinderDescriptor {
pub center: Point3,
pub axis_origin: Point3,
pub axis: Vec3,
pub x_ref: Vec3,
pub y_ref: Vec3,
pub radius: f64,
pub v0: f64,
pub v1: f64,
pub u0: f64,
pub u1: f64,
}Expand description
A cylinder surface packed for GPU evaluation.
Extracted from a FaceSurface::Cylinder face via
extract_cylinder_descriptor: the axis frame and radius come from the
CylindricalSurface; the parametric trim range (v0..v1 axial,
u0..u1 angular) comes from the face’s boundary.
Fields§
§center: Point3RTC origin — positions are emitted relative to this point. Defaults to
the descriptor’s own AABB center via extract_cylinder_descriptor.
axis_origin: Point3Cylinder axis origin (a point on the axis at v = 0).
axis: Vec3Cylinder axis direction (unit, points along increasing v).
x_ref: Vec3First radial reference direction (unit; u = 0 points here).
y_ref: Vec3Second radial reference direction (unit; axis × x_ref).
radius: f64Cylinder radius.
v0: f64Axial parameter at the lower trim boundary.
v1: f64Axial parameter at the upper trim boundary.
u0: f64Angular parameter at the start of the trim (radians).
u1: f64Angular parameter at the end of the trim (radians); u1 - u0 == 2π for
a full cylinder.
Implementations§
Source§impl CylinderDescriptor
impl CylinderDescriptor
Sourcepub fn evaluate(&self, u: f64, v: f64) -> Point3
pub fn evaluate(&self, u: f64, v: f64) -> Point3
World-space point on the surface at parameters (u, v), the same
parameterization the GPU shader evaluates:
pos(u, v) = axis_origin + radius·(cos u · x_ref + sin u · y_ref) + v·axis.
Note this returns an absolute world point; the GPU emits it minus
center (RTC). Used to compute the descriptor’s AABB and
available for CPU-side geometric checks.
Sourcepub fn triangle_count(tess: TessFactor) -> usize
pub fn triangle_count(tess: TessFactor) -> usize
Number of triangles a given tessellation factor produces (2·n_u·n_v).
Trait Implementations§
Source§impl Clone for CylinderDescriptor
impl Clone for CylinderDescriptor
Source§fn clone(&self) -> CylinderDescriptor
fn clone(&self) -> CylinderDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CylinderDescriptor
Auto Trait Implementations§
impl Freeze for CylinderDescriptor
impl RefUnwindSafe for CylinderDescriptor
impl Send for CylinderDescriptor
impl Sync for CylinderDescriptor
impl Unpin for CylinderDescriptor
impl UnsafeUnpin for CylinderDescriptor
impl UnwindSafe for CylinderDescriptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more