pub struct RevolutionSurface {
pub profile: BezierCurve,
pub sweep_angle: f64,
}Expand description
A surface of revolution: a profile curve in the XZ plane rotated around the Z axis.
u ∈ [0, 1] sweeps the full 2π revolution (or a fraction thereof),
v ∈ [0, 1] traverses the profile curve.
Fields§
§profile: BezierCurveProfile curve (in XZ plane: profile[.][0] = X offset, profile[.][2] = Z height).
sweep_angle: f64Total sweep angle in radians (default 2π for a full revolution).
Implementations§
Source§impl RevolutionSurface
impl RevolutionSurface
Sourcepub fn new(profile: BezierCurve) -> Self
pub fn new(profile: BezierCurve) -> Self
Create a surface of revolution with a full 2π sweep.
Sourcepub fn with_angle(profile: BezierCurve, sweep_angle: f64) -> Self
pub fn with_angle(profile: BezierCurve, sweep_angle: f64) -> Self
Create a surface of revolution with an explicit sweep angle.
Sourcepub fn evaluate(&self, u: f64, v: f64) -> [f64; 3]
pub fn evaluate(&self, u: f64, v: f64) -> [f64; 3]
Evaluate at (u, v):
vselects a point on the profile(r, 0, z),urotates it byu * sweep_anglearound the Z axis.
Auto Trait Implementations§
impl Freeze for RevolutionSurface
impl RefUnwindSafe for RevolutionSurface
impl Send for RevolutionSurface
impl Sync for RevolutionSurface
impl Unpin for RevolutionSurface
impl UnsafeUnpin for RevolutionSurface
impl UnwindSafe for RevolutionSurface
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.