#[non_exhaustive]pub enum EdgeRepr {
Curve3d {
curve: CurveId,
location: Location,
range: (f64, f64),
},
PCurve {
curve: PCurveId,
surface: SurfaceId,
location: Location,
range: (f64, f64),
},
Seam {
forward: PCurveId,
reversed: PCurveId,
surface: SurfaceId,
location: Location,
range: (f64, f64),
},
PolygonOnTriangulation {
triangulation: TriangulationId,
indices: Vec<u32>,
location: Location,
},
Polyline {
points: Vec<Point>,
parameters: Vec<f64>,
location: Location,
deflection: f64,
},
}Expand description
One way of describing where an edge runs.
An edge holds several at once, and they must agree; see
EdgeData::same_parameter.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Curve3d
The edge as a curve in space.
Fields
PCurve
The edge as a curve in one surface’s parameter space.
Fields
Seam
The edge as a seam on a closed surface, needing two pcurves.
A seam runs along a surface’s closure (a cylinder’s join, a sphere’s date line) where the same points have two parameter values. One pcurve per side; a single one could not express both, and using only one leaves the face split open along the seam.
Fields
PolygonOnTriangulation
The edge’s path through one face’s cached triangulation, as indices.
What a renderer wants to draw a shared edge without hunting for coincident vertices: consecutive indices are consecutive mesh nodes along the edge, in the edge’s own direction. Only meaningful while the named triangulation is the one stored; retessellating replaces both together.
Fields
triangulation: TriangulationIdThe face triangulation the indices point into.
Polyline
A cached polyline approximation, with the deflection it was built to.
Carried alongside the exact geometry rather than replacing it: display and coarse spatial queries want it, and rebuilding it on every frame would dominate their cost.
Fields
parameters: Vec<f64>The curve parameter each point came from.
Kept, not discarded. A face’s cached triangulation has to place its boundary vertices where this polyline puts them, and it reaches them through its own pcurve, so it needs the parameters, not just the points. Without them the two caches drift and the stored mesh has gaps that the exact geometry does not.
Implementations§
Source§impl EdgeRepr
impl EdgeRepr
Sourcepub const fn surface(&self) -> Option<SurfaceId>
pub const fn surface(&self) -> Option<SurfaceId>
The surface this representation belongs to, if any.
Sourcepub const fn range(&self) -> Option<(f64, f64)>
pub const fn range(&self) -> Option<(f64, f64)>
The parameter range this representation covers, if it has one.
Sourcepub const fn is_curve3d(&self) -> bool
pub const fn is_curve3d(&self) -> bool
Whether this is the edge’s curve in space.
Sourcepub const fn is_parametric(&self) -> bool
pub const fn is_parametric(&self) -> bool
Whether this describes the edge in a surface’s parameter space.
Trait Implementations§
impl StructuralPartialEq for EdgeRepr
Auto Trait Implementations§
impl Freeze for EdgeRepr
impl RefUnwindSafe for EdgeRepr
impl Send for EdgeRepr
impl Sync for EdgeRepr
impl Unpin for EdgeRepr
impl UnsafeUnpin for EdgeRepr
impl UnwindSafe for EdgeRepr
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.