pub enum SurfaceGeometry {
Plane(PlaneSurface),
Cylinder(CylinderSurface),
Cone(ConeSurface),
Sphere(SphereSurface),
Torus(TorusSurface),
BSpline(BSplineSurface),
Revolution(Box<RevolutionSurface>),
Extrusion(Box<ExtrusionSurface>),
Trimmed(Box<TrimmedSurface>),
Offset(Box<OffsetSurface>),
}Expand description
A surface.
Variants§
Plane(PlaneSurface)
A plane.
Cylinder(CylinderSurface)
A circular cylinder.
Cone(ConeSurface)
A circular cone.
Sphere(SphereSurface)
A sphere.
Torus(TorusSurface)
A torus.
BSpline(BSplineSurface)
A polynomial or rational B-spline patch.
Revolution(Box<RevolutionSurface>)
A curve revolved about an axis.
Extrusion(Box<ExtrusionSurface>)
A curve swept along a direction.
Trimmed(Box<TrimmedSurface>)
Another surface restricted to a sub-rectangle.
Offset(Box<OffsetSurface>)
A surface at a constant signed distance along another’s normal.
Implementations§
Source§impl SurfaceGeometry
impl SurfaceGeometry
Sourcepub fn fitted_bspline(
&self,
tolerance: f64,
tol: Tolerances,
) -> OgeomResult<Fitted<BSplineSurface>>
pub fn fitted_bspline( &self, tolerance: f64, tol: Tolerances, ) -> OgeomResult<Fitted<BSplineSurface>>
This surface as a B-spline fitted over its own domain to a stated
tolerance: the approximation to_bspline
refuses to make silently, for an offset surface or anything else
with no exact rational form. A grid of the surface’s points is
fitted at degree three at the surface’s own parameters, the fit
measured against the surface between the samples as well as at
them, and the grid refined where it misses until the tolerance
holds or the budget runs out; error is the worst measured, not
what was asked. The fit spans the surface’s own domain, but its
knots are its own, so a pcurve spoken against the surface is
re-derived against the result. Where the surface cannot be evaluated
(an offset sphere’s poles, where the basis has no normal) the fit
takes the limit of the points around, and the error stated counts
how closely they close on it.
§Errors
OgeomError::Construction if
the domain is unbounded, the tolerance is not a distance, or the
surface cannot be evaluated somewhere and the points around do not
close on one (an offset cone’s apex); as fit::fit_surface_grid.
Source§impl SurfaceGeometry
impl SurfaceGeometry
Sourcepub fn to_bspline(&self, tol: Tolerances) -> OgeomResult<BSplineSurface>
pub fn to_bspline(&self, tol: Tolerances) -> OgeomResult<BSplineSurface>
This surface as a B-spline patch, exactly, over [0, 1] in both
directions.
Every analytic surface here is a surface of revolution or a ruled one, so its exact form falls out of the curve conversion above rather than needing a construction of its own: revolve an exactly-converted profile and the patch is exact wherever the profile was.
As for curves, the parameterization does not survive: a cylinder’s
u is an angle and the patch’s is not. See the module documentation.
§Errors
OgeomError::Construction if the
surface’s own extents are degenerate, or its geometry cannot be
evaluated.
Trait Implementations§
Source§impl Clone for SurfaceGeometry
impl Clone for SurfaceGeometry
Source§impl Debug for SurfaceGeometry
impl Debug for SurfaceGeometry
Source§impl From<BSplineSurface> for SurfaceGeometry
impl From<BSplineSurface> for SurfaceGeometry
Source§fn from(s: BSplineSurface) -> Self
fn from(s: BSplineSurface) -> Self
Source§impl From<ConeSurface> for SurfaceGeometry
impl From<ConeSurface> for SurfaceGeometry
Source§fn from(s: ConeSurface) -> Self
fn from(s: ConeSurface) -> Self
Source§impl From<CylinderSurface> for SurfaceGeometry
impl From<CylinderSurface> for SurfaceGeometry
Source§fn from(s: CylinderSurface) -> Self
fn from(s: CylinderSurface) -> Self
Source§impl From<ExtrusionSurface> for SurfaceGeometry
impl From<ExtrusionSurface> for SurfaceGeometry
Source§fn from(s: ExtrusionSurface) -> Self
fn from(s: ExtrusionSurface) -> Self
Source§impl From<PlaneSurface> for SurfaceGeometry
impl From<PlaneSurface> for SurfaceGeometry
Source§fn from(s: PlaneSurface) -> Self
fn from(s: PlaneSurface) -> Self
Source§impl From<RevolutionSurface> for SurfaceGeometry
impl From<RevolutionSurface> for SurfaceGeometry
Source§fn from(s: RevolutionSurface) -> Self
fn from(s: RevolutionSurface) -> Self
Source§impl From<SphereSurface> for SurfaceGeometry
impl From<SphereSurface> for SurfaceGeometry
Source§fn from(s: SphereSurface) -> Self
fn from(s: SphereSurface) -> Self
Source§impl From<TorusSurface> for SurfaceGeometry
impl From<TorusSurface> for SurfaceGeometry
Source§fn from(s: TorusSurface) -> Self
fn from(s: TorusSurface) -> Self
Source§impl From<TrimmedSurface> for SurfaceGeometry
impl From<TrimmedSurface> for SurfaceGeometry
Source§fn from(s: TrimmedSurface) -> Self
fn from(s: TrimmedSurface) -> Self
Source§impl PartialEq for SurfaceGeometry
impl PartialEq for SurfaceGeometry
impl StructuralPartialEq for SurfaceGeometry
Source§impl Surface for SurfaceGeometry
impl Surface for SurfaceGeometry
Source§fn point_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<Point>
fn point_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<Point>
(u, v). Read moreSource§fn d1_at(
&self,
u: f64,
v: f64,
tol: Tolerances,
) -> OgeomResult<(Vector, Vector)>
fn d1_at( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<(Vector, Vector)>
(u, v). Read moreSource§fn d2_at(
&self,
u: f64,
v: f64,
tol: Tolerances,
) -> OgeomResult<(Vector, Vector, Vector)>
fn d2_at( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<(Vector, Vector, Vector)>
Source§fn point_d1_at(
&self,
u: f64,
v: f64,
tol: Tolerances,
) -> OgeomResult<(Point, Vector, Vector)>
fn point_d1_at( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<(Point, Vector, Vector)>
(point, du, dv). Read moreSource§fn jet_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<SurfaceJet>
fn jet_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<SurfaceJet>
Source§fn kind(&self) -> SurfaceKind
fn kind(&self) -> SurfaceKind
Source§fn continuity(&self) -> Continuity
fn continuity(&self) -> Continuity
Source§fn is_closed_u(&self, tol: Tolerances) -> bool
fn is_closed_u(&self, tol: Tolerances) -> bool
u.Source§fn is_closed_v(&self, tol: Tolerances) -> bool
fn is_closed_v(&self, tol: Tolerances) -> bool
v.Source§fn is_periodic_u(&self) -> bool
fn is_periodic_u(&self) -> bool
u repeats past the domain.Source§fn is_periodic_v(&self) -> bool
fn is_periodic_v(&self) -> bool
v repeats past the domain.Source§fn normal_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<Direction>
fn normal_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<Direction>
Source§fn curvature_at(
&self,
u: f64,
v: f64,
tol: Tolerances,
) -> OgeomResult<SurfaceCurvature>
fn curvature_at( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<SurfaceCurvature>
(u, v). Read moreSource§fn is_degenerate_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<bool>
fn is_degenerate_at(&self, u: f64, v: f64, tol: Tolerances) -> OgeomResult<bool>
(u, v). Read moreSource§fn normalize_parameters(
&self,
u: f64,
v: f64,
tol: Tolerances,
) -> OgeomResult<(f64, f64)>
fn normalize_parameters( &self, u: f64, v: f64, tol: Tolerances, ) -> OgeomResult<(f64, f64)>
(u, v) into the domain, wrapping in whichever directions are
periodic, or closed. Read moreSource§fn parameter_outside(
&self,
t: f64,
a: f64,
b: f64,
periodic: bool,
across: bool,
tol: Tolerances,
) -> OgeomResult<f64>
fn parameter_outside( &self, t: f64, a: f64, b: f64, periodic: bool, across: bool, tol: Tolerances, ) -> OgeomResult<f64>
Source§impl Transformable for SurfaceGeometry
impl Transformable for SurfaceGeometry
Source§fn transformed(&self, t: &Transform, tol: Tolerances) -> OgeomResult<Self>
fn transformed(&self, t: &Transform, tol: Tolerances) -> OgeomResult<Self>
t. Read moreAuto Trait Implementations§
impl Freeze for SurfaceGeometry
impl RefUnwindSafe for SurfaceGeometry
impl Send for SurfaceGeometry
impl Sync for SurfaceGeometry
impl Unpin for SurfaceGeometry
impl UnsafeUnpin for SurfaceGeometry
impl UnwindSafe for SurfaceGeometry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.