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, the grid doubled until every sample is
within the tolerance or the budget runs out, and error is what
was measured. The fit’s parameterization is its own, so a pcurve
spoken against the surface must be re-derived against the result.
§Errors
OgeomError::Construction if
the domain is unbounded or the tolerance is not a distance; 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§fn clone(&self) -> SurfaceGeometry
fn clone(&self) -> SurfaceGeometry
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 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
Source§fn eq(&self, other: &SurfaceGeometry) -> bool
fn eq(&self, other: &SurfaceGeometry) -> bool
self and other values to be equal, and is used by ==.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 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 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§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.