mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-15 12:47:19 +00:00
Add vertex getters to MaybePartial<HalfEdge>
This commit is contained in:
parent
c4d866f8e1
commit
7f3519a98e
@ -105,6 +105,28 @@ impl MaybePartial<GlobalEdge> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl MaybePartial<HalfEdge> {
|
impl MaybePartial<HalfEdge> {
|
||||||
|
/// Access the back vertex
|
||||||
|
pub fn back(&self) -> Option<MaybePartial<Vertex>> {
|
||||||
|
match self {
|
||||||
|
Self::Full(full) => Some(full.back().clone().into()),
|
||||||
|
Self::Partial(partial) => {
|
||||||
|
let [back, _] = &partial.vertices;
|
||||||
|
back.clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access the front vertex
|
||||||
|
pub fn front(&self) -> Option<MaybePartial<Vertex>> {
|
||||||
|
match self {
|
||||||
|
Self::Full(full) => Some(full.front().clone().into()),
|
||||||
|
Self::Partial(partial) => {
|
||||||
|
let [_, front] = &partial.vertices;
|
||||||
|
front.clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Access the vertices
|
/// Access the vertices
|
||||||
pub fn vertices(&self) -> [Option<MaybePartial<Vertex>>; 2] {
|
pub fn vertices(&self) -> [Option<MaybePartial<Vertex>>; 2] {
|
||||||
match self {
|
match self {
|
||||||
|
Loading…
Reference in New Issue
Block a user