Skip to main content

EdgeRepr

Enum EdgeRepr 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Curve3d

The edge as a curve in space.

Fields

§curve: CurveId

The curve.

§location: Location

Where the curve sits.

§range: (f64, f64)

The portion of the curve this edge covers.

§

PCurve

The edge as a curve in one surface’s parameter space.

Fields

§curve: PCurveId

The curve in (u, v).

§surface: SurfaceId

The surface whose parameter space it lives in.

§location: Location

Where that surface sits.

§range: (f64, f64)

The portion of the curve this edge covers.

§

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

§forward: PCurveId

The pcurve on the side the face’s forward orientation sees.

§reversed: PCurveId

The pcurve on the other side.

§surface: SurfaceId

The surface.

§location: Location

Where that surface sits.

§range: (f64, f64)

The portion both curves cover.

§

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: TriangulationId

The face triangulation the indices point into.

§indices: Vec<u32>

Node indices along the edge, in curve order.

§location: Location

Where the edge occurrence sits.

§

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

§points: Vec<Point>

The points, in order along the edge.

§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.

§location: Location

Where they sit.

§deflection: f64

The maximum distance from the exact curve.

Implementations§

Source§

impl EdgeRepr

Source

pub const fn surface(&self) -> Option<SurfaceId>

The surface this representation belongs to, if any.

Source

pub const fn location(&self) -> Option<&Location>

Where this representation sits.

Source

pub const fn range(&self) -> Option<(f64, f64)>

The parameter range this representation covers, if it has one.

Source

pub const fn is_curve3d(&self) -> bool

Whether this is the edge’s curve in space.

Source

pub const fn is_parametric(&self) -> bool

Whether this describes the edge in a surface’s parameter space.

Trait Implementations§

Source§

impl Clone for EdgeRepr

Source§

fn clone(&self) -> EdgeRepr

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EdgeRepr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for EdgeRepr

Source§

fn eq(&self, other: &EdgeRepr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EdgeRepr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.