pub struct HalfEdge { /* private fields */ }Expand description
A directed edge, defined in a surface’s 2D space
The concept of an “edge” in Fornjot is represented by two structs,
HalfEdge and GlobalEdge. HalfEdge has two attributes that make it
distinct from GlobalEdge:
HalfEdgeis directed, meaning it has a defined start and end vertex.HalfEdgeis defined in the 2-dimensional space of a surface.
When multiple faces, which are bound by edges, are combined to form a solid,
the HalfEdges that bound the face on the surface are then coincident with
the HalfEdges of other faces, where those faces touch. Those coincident
HalfEdges are different representations of the same edge. This edge is
represented by an instance of GlobalEdge.
There are some requirements that a HalfEdge needs to uphold to be valid:
- Coincident
HalfEdges must refer to the sameGlobalEdge. HalfEdges that are coincident, i.e. located in the same space, must always be congruent. This means they must coincide exactly. The overlap must be complete. None of the coincidentHalfEdges must overlap with just a section of another.
That second requirement means that a HalfEdge might need to be split into
multiple smaller HalfEdges that are each coincident with a HalfEdge in
another face.
§Implementation Note
There is no validation code that verifies whether coincident HalfEdges
refer to the same GlobalEdge or not:
https://github.com/hannobraun/Fornjot/issues/1594
Conversely, there is no validation code to verify that coincident
HalfEdges are congruent:
https://github.com/hannobraun/Fornjot/issues/1608
Implementations§
Source§impl HalfEdge
impl HalfEdge
Sourcepub fn new(
curve: Curve,
boundary: [Point<1>; 2],
start_vertex: Handle<Vertex>,
global_form: Handle<GlobalEdge>,
) -> Self
pub fn new( curve: Curve, boundary: [Point<1>; 2], start_vertex: Handle<Vertex>, global_form: Handle<GlobalEdge>, ) -> Self
Create an instance of HalfEdge
Sourcepub fn boundary(&self) -> [Point<1>; 2]
pub fn boundary(&self) -> [Point<1>; 2]
Access the boundary points of the half-edge on the curve
Sourcepub fn start_position(&self) -> Point<2>
pub fn start_position(&self) -> Point<2>
Compute the surface position where the half-edge starts
Sourcepub fn start_vertex(&self) -> &Handle<Vertex>
pub fn start_vertex(&self) -> &Handle<Vertex>
Access the vertex from where this half-edge starts
Sourcepub fn global_form(&self) -> &Handle<GlobalEdge>
pub fn global_form(&self) -> &Handle<GlobalEdge>
Access the global form of the half-edge
Trait Implementations§
Source§impl BuildHalfEdge for HalfEdge
impl BuildHalfEdge for HalfEdge
Source§fn unjoined(
curve: Curve,
boundary: [Point<1>; 2],
services: &mut Services,
) -> HalfEdge
fn unjoined( curve: Curve, boundary: [Point<1>; 2], services: &mut Services, ) -> 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 PartialOrd for HalfEdge
impl PartialOrd 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 replace_start_vertex(&self, start_vertex: Handle<Vertex>) -> HalfEdge
fn replace_start_vertex(&self, start_vertex: Handle<Vertex>) -> HalfEdge
Source§fn replace_global_form(&self, global_form: Handle<GlobalEdge>) -> HalfEdge
fn replace_global_form(&self, global_form: Handle<GlobalEdge>) -> HalfEdge
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 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.