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 BuildHalfEdge for HalfEdge
impl BuildHalfEdge for HalfEdge
Source§fn unjoined(
path: SurfacePath,
boundary: impl Into<CurveBoundary<Point<1>>>,
core: &mut Core,
) -> HalfEdge
fn unjoined( path: SurfacePath, boundary: impl Into<CurveBoundary<Point<1>>>, core: &mut Core, ) -> HalfEdge
Source§fn from_sibling(
sibling: &Handle<HalfEdge>,
start_vertex: Handle<Vertex>,
core: &mut Core,
) -> Handle<HalfEdge>
fn from_sibling( sibling: &Handle<HalfEdge>, start_vertex: Handle<Vertex>, core: &mut Core, ) -> Handle<HalfEdge>
Source§fn arc(
start: impl Into<Point<2>>,
end: impl Into<Point<2>>,
angle_rad: impl Into<Scalar>,
core: &mut Core,
) -> Handle<HalfEdge>
fn arc( start: impl Into<Point<2>>, end: impl Into<Point<2>>, angle_rad: impl Into<Scalar>, core: &mut Core, ) -> Handle<HalfEdge>
Source§impl Ord for HalfEdge
impl Ord for HalfEdge
Source§impl PartialOrd for HalfEdge
impl PartialOrd for HalfEdge
Source§impl ReplaceCurve for HalfEdge
impl ReplaceCurve for HalfEdge
Source§fn replace_curve(
&self,
original: &Handle<Curve>,
replacement: Handle<Curve>,
core: &mut Core,
) -> ReplaceOutput<Self, Self::BareObject>
fn replace_curve( &self, original: &Handle<Curve>, replacement: Handle<Curve>, core: &mut Core, ) -> ReplaceOutput<Self, Self::BareObject>
Source§impl ReplaceVertex for HalfEdge
impl ReplaceVertex for HalfEdge
Source§fn replace_vertex(
&self,
original: &Handle<Vertex>,
replacement: Handle<Vertex>,
core: &mut Core,
) -> ReplaceOutput<Self, Self::BareObject>
fn replace_vertex( &self, original: &Handle<Vertex>, replacement: Handle<Vertex>, core: &mut Core, ) -> ReplaceOutput<Self, Self::BareObject>
Source§impl UpdateHalfEdge for HalfEdge
impl UpdateHalfEdge for HalfEdge
Source§impl Validate for HalfEdge
impl Validate for HalfEdge
Source§fn validate(
&self,
_: &ValidationConfig,
_: &mut Vec<ValidationError>,
_: &Geometry,
)
fn validate( &self, _: &ValidationConfig, _: &mut Vec<ValidationError>, _: &Geometry, )
Source§fn validate_and_return_first_error(
&self,
geometry: &Geometry,
) -> Result<(), ValidationError>
fn validate_and_return_first_error( &self, geometry: &Geometry, ) -> Result<(), ValidationError>
impl Eq for HalfEdge
impl StructuralPartialEq for HalfEdge
Auto Trait Implementations§
impl Freeze for HalfEdge
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.