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
impl HalfEdge
sourcepub fn new(
path: SurfacePath,
boundary: impl Into<CurveBoundary<Point<1>>>,
curve: Handle<Curve>,
start_vertex: Handle<Vertex>
) -> Self
pub fn new( path: SurfacePath, boundary: impl Into<CurveBoundary<Point<1>>>, curve: Handle<Curve>, start_vertex: Handle<Vertex> ) -> Self
Create an instance of Edge
sourcepub fn path(&self) -> SurfacePath
pub fn path(&self) -> SurfacePath
Access the curve that defines the edge’s geometry
sourcepub fn boundary(&self) -> CurveBoundary<Point<1>>
pub fn boundary(&self) -> CurveBoundary<Point<1>>
Access the boundary points of the edge on the curve
sourcepub fn start_vertex(&self) -> &Handle<Vertex>
pub fn start_vertex(&self) -> &Handle<Vertex>
Access the vertex from where this edge starts
sourcepub fn start_position(&self) -> Point<2>
pub fn start_position(&self) -> Point<2>
Compute the surface position where the edge starts
Trait Implementations§
source§impl BoundingVolume<2> for HalfEdge
impl BoundingVolume<2> for HalfEdge
source§impl BuildHalfEdge for HalfEdge
impl BuildHalfEdge for HalfEdge
source§fn unjoined(
path: SurfacePath,
boundary: impl Into<CurveBoundary<Point<1>>>,
services: &mut Services
) -> HalfEdge
fn unjoined( path: SurfacePath, boundary: impl Into<CurveBoundary<Point<1>>>, services: &mut Services ) -> HalfEdge
source§fn from_sibling(sibling: &HalfEdge, start_vertex: Handle<Vertex>) -> HalfEdge
fn from_sibling(sibling: &HalfEdge, start_vertex: Handle<Vertex>) -> HalfEdge
source§fn arc(
start: impl Into<Point<2>>,
end: impl Into<Point<2>>,
angle_rad: impl Into<Scalar>,
services: &mut Services
) -> HalfEdge
fn arc( start: impl Into<Point<2>>, end: impl Into<Point<2>>, angle_rad: impl Into<Scalar>, services: &mut Services ) -> HalfEdge
source§impl Ord for HalfEdge
impl Ord for HalfEdge
source§impl PartialEq for HalfEdge
impl PartialEq for HalfEdge
source§impl PartialOrd for HalfEdge
impl PartialOrd for HalfEdge
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl ReplaceCurve for HalfEdge
impl ReplaceCurve for HalfEdge
§type BareObject = HalfEdge
type BareObject = HalfEdge
source§fn replace_curve(
&self,
original: &Handle<Curve>,
replacement: Handle<Curve>,
_: &mut Services
) -> ReplaceOutput<Self, Self::BareObject>
fn replace_curve( &self, original: &Handle<Curve>, replacement: Handle<Curve>, _: &mut Services ) -> ReplaceOutput<Self, Self::BareObject>
source§impl ReplaceVertex for HalfEdge
impl ReplaceVertex for HalfEdge
§type BareObject = HalfEdge
type BareObject = HalfEdge
source§fn replace_vertex(
&self,
original: &Handle<Vertex>,
replacement: Handle<Vertex>,
_: &mut Services
) -> ReplaceOutput<Self, Self::BareObject>
fn replace_vertex( &self, original: &Handle<Vertex>, replacement: Handle<Vertex>, _: &mut Services ) -> ReplaceOutput<Self, Self::BareObject>
source§impl ReverseCurveCoordinateSystems for HalfEdge
impl ReverseCurveCoordinateSystems for HalfEdge
source§fn reverse_curve_coordinate_systems(&self, _: &mut Services) -> Self
fn reverse_curve_coordinate_systems(&self, _: &mut Services) -> Self
source§impl SplitHalfEdge for HalfEdge
impl SplitHalfEdge for HalfEdge
source§impl SweepHalfEdge for HalfEdge
impl SweepHalfEdge for HalfEdge
source§impl TransformObject for HalfEdge
impl TransformObject for HalfEdge
source§fn transform_with_cache(
self,
transform: &Transform,
services: &mut Services,
cache: &mut TransformCache
) -> Self
fn transform_with_cache( self, transform: &Transform, services: &mut Services, cache: &mut TransformCache ) -> Self
source§fn transform(self, transform: &Transform, services: &mut Services) -> Self
fn transform(self, transform: &Transform, services: &mut Services) -> Self
source§impl UpdateHalfEdge for HalfEdge
impl UpdateHalfEdge for HalfEdge
source§fn update_path(&self, update: impl FnOnce(SurfacePath) -> SurfacePath) -> Self
fn update_path(&self, update: impl FnOnce(SurfacePath) -> SurfacePath) -> Self
source§fn update_boundary(
&self,
update: impl FnOnce(CurveBoundary<Point<1>>) -> CurveBoundary<Point<1>>
) -> Self
fn update_boundary( &self, update: impl FnOnce(CurveBoundary<Point<1>>) -> CurveBoundary<Point<1>> ) -> Self
source§impl Validate for HalfEdge
impl Validate for HalfEdge
source§fn validate_with_config(
&self,
config: &ValidationConfig,
errors: &mut Vec<ValidationError>
)
fn validate_with_config( &self, config: &ValidationConfig, errors: &mut Vec<ValidationError> )
source§fn validate_and_return_first_error(&self) -> Result<(), ValidationError>
fn validate_and_return_first_error(&self) -> Result<(), ValidationError>
source§fn validate(&self, errors: &mut Vec<ValidationError>)
fn validate(&self, errors: &mut Vec<ValidationError>)
impl Eq for HalfEdge
impl StructuralEq for HalfEdge
impl StructuralPartialEq for HalfEdge
Auto Trait Implementations§
impl !RefUnwindSafe for HalfEdge
impl Send for HalfEdge
impl Sync for HalfEdge
impl Unpin for HalfEdge
impl !UnwindSafe for HalfEdge
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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.