Struct fj_core::objects::HalfEdge

source ·
pub struct HalfEdge { /* private fields */ }
Expand description

A directed half-edge, defined in a surface’s 2D space

Structure

A HalfEdge is defined by the Curve it is on, its boundary on the curve, and the Vertex instances that bound it on the curve. To keep the data structures simple (by avoiding redundancy), each HalfEdge only refers to its start vertex. The vertex where it ends is referred to by the next HalfEdge in the Cycle that the HalfEdge is a part of.

Validity

A valid HalfEdge must have a non-zero length, meaning its bounding vertices must not be coincident.

In a valid Shell, HalfEdges form coincident pairs, where the faces of the shell touch. The other HalfEdge in such a pair is called the sibling.

A HalfEdge and its sibling are equal but opposite. Specifically this means that both refer to the same curve; that the sibling has the same, but inverted, boundary; and that both are bound by the same vertices, though their start vertices are different.

Implementations§

source§

impl HalfEdge

source

pub fn new( path: SurfacePath, boundary: impl Into<CurveBoundary<Point<1>>>, curve: Handle<Curve>, start_vertex: Handle<Vertex> ) -> Self

Create an instance of Edge

source

pub fn path(&self) -> SurfacePath

Access the curve that defines the edge’s geometry

source

pub fn boundary(&self) -> CurveBoundary<Point<1>>

Access the boundary points of the edge on the curve

source

pub fn curve(&self) -> &Handle<Curve>

Access the curve of the edge

source

pub fn start_vertex(&self) -> &Handle<Vertex>

Access the vertex from where this edge starts

source

pub fn start_position(&self) -> Point<2>

Compute the surface position where the edge starts

Trait Implementations§

source§

impl BoundingVolume<2> for HalfEdge

source§

fn aabb(&self) -> Option<Aabb<2>>

Compute an axis-aligned bounding box (AABB) Read more
source§

impl BuildHalfEdge for HalfEdge

source§

fn unjoined( path: SurfacePath, boundary: impl Into<CurveBoundary<Point<1>>>, services: &mut Services ) -> HalfEdge

Create a half-edge that is not joined to a sibling
source§

fn from_sibling(sibling: &HalfEdge, start_vertex: Handle<Vertex>) -> HalfEdge

Create a half-edge from its sibling
source§

fn arc( start: impl Into<Point<2>>, end: impl Into<Point<2>>, angle_rad: impl Into<Scalar>, services: &mut Services ) -> HalfEdge

Create an arc Read more
source§

fn circle( center: impl Into<Point<2>>, radius: impl Into<Scalar>, services: &mut Services ) -> HalfEdge

Create a circle
source§

fn line_segment( points_surface: [impl Into<Point<2>>; 2], boundary: Option<[Point<1>; 2]>, services: &mut Services ) -> HalfEdge

Create a line segment
source§

impl Clone for HalfEdge

source§

fn clone(&self) -> HalfEdge

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for HalfEdge

source§

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

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

impl From<HalfEdge> for Object<Bare>

source§

fn from(object: HalfEdge) -> Self

Converts to this type from the input type.
source§

impl Hash for HalfEdge

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Insert for HalfEdge

§

type Inserted = Handle<HalfEdge>

The type of Self, once it has been inserted Read more
source§

fn insert(self, services: &mut Services) -> Self::Inserted

Insert the object into its respective store Read more
source§

impl Ord for HalfEdge

source§

fn cmp(&self, other: &HalfEdge) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for HalfEdge

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for HalfEdge

source§

fn partial_cmp(&self, other: &HalfEdge) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl ReplaceCurve for HalfEdge

§

type BareObject = HalfEdge

The bare object type that this trait is implemented for
source§

fn replace_curve( &self, original: &Handle<Curve>, replacement: Handle<Curve>, _: &mut Services ) -> ReplaceOutput<Self, Self::BareObject>

Replace the curve
source§

impl ReplaceVertex for HalfEdge

§

type BareObject = HalfEdge

The bare object type that this trait is implemented for
source§

fn replace_vertex( &self, original: &Handle<Vertex>, replacement: Handle<Vertex>, _: &mut Services ) -> ReplaceOutput<Self, Self::BareObject>

Replace the vertex
source§

impl ReverseCurveCoordinateSystems for HalfEdge

source§

fn reverse_curve_coordinate_systems(&self, _: &mut Services) -> Self

Reverse the direction of the curve coordinate systems within an object Read more
source§

impl SplitHalfEdge for HalfEdge

source§

fn split_half_edge( &self, point: impl Into<Point<1>>, services: &mut Services ) -> [HalfEdge; 2]

Split the half-edge into two Read more
source§

impl SweepHalfEdge for HalfEdge

source§

fn sweep_half_edge( &self, end_vertex: Handle<Vertex>, surface: &Surface, color: Option<Color>, path: impl Into<Vector<3>>, cache: &mut SweepCache, services: &mut Services ) -> (Face, Handle<HalfEdge>)

source§

impl TransformObject for HalfEdge

source§

fn transform_with_cache( self, transform: &Transform, services: &mut Services, cache: &mut TransformCache ) -> Self

Transform the object using the provided cache
source§

fn transform(self, transform: &Transform, services: &mut Services) -> Self

Transform the object
source§

fn translate( self, offset: impl Into<Vector<3>>, services: &mut Services ) -> Self

Translate the object Read more
source§

fn rotate( self, axis_angle: impl Into<Vector<3>>, services: &mut Services ) -> Self

Rotate the object Read more
source§

impl UpdateHalfEdge for HalfEdge

source§

fn update_path(&self, update: impl FnOnce(SurfacePath) -> SurfacePath) -> Self

Update the path of the edge
source§

fn update_boundary( &self, update: impl FnOnce(CurveBoundary<Point<1>>) -> CurveBoundary<Point<1>> ) -> Self

Update the boundary of the edge
source§

fn update_curve( &self, update: impl FnOnce(&Handle<Curve>) -> Handle<Curve> ) -> Self

Update the curve of the edge
source§

fn update_start_vertex( &self, update: impl FnOnce(&Handle<Vertex>) -> Handle<Vertex> ) -> Self

Update the start vertex of the edge
source§

impl Validate for HalfEdge

source§

fn validate_with_config( &self, config: &ValidationConfig, errors: &mut Vec<ValidationError> )

Validate the object
source§

fn validate_and_return_first_error(&self) -> Result<(), ValidationError>

Validate the object using default config and return on first error
source§

fn validate(&self, errors: &mut Vec<ValidationError>)

Validate the object using default configuration
source§

impl Eq for HalfEdge

source§

impl StructuralEq for HalfEdge

source§

impl StructuralPartialEq for HalfEdge

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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

§

type Output = T

Should always be Self
§

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,

§

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>,

§

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>,

§

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

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