mirror of
https://github.com/hannobraun/Fornjot
synced 2025-09-29 20:48:30 +00:00
Return Handle
from UpdateHalfEdge::update_path
This commit is contained in:
parent
34ce68d89f
commit
f8038849d9
@ -9,13 +9,14 @@ use crate::{
|
||||
};
|
||||
|
||||
/// Update a [`HalfEdge`]
|
||||
pub trait UpdateHalfEdge {
|
||||
pub trait UpdateHalfEdge: Sized {
|
||||
/// Update the path of the edge
|
||||
#[must_use]
|
||||
fn update_path(
|
||||
&self,
|
||||
update: impl FnOnce(SurfacePath) -> SurfacePath,
|
||||
) -> Self;
|
||||
core: &mut Core,
|
||||
) -> Handle<Self>;
|
||||
|
||||
/// Update the boundary of the edge
|
||||
#[must_use]
|
||||
@ -49,13 +50,15 @@ impl UpdateHalfEdge for HalfEdge {
|
||||
fn update_path(
|
||||
&self,
|
||||
update: impl FnOnce(SurfacePath) -> SurfacePath,
|
||||
) -> Self {
|
||||
core: &mut Core,
|
||||
) -> Handle<Self> {
|
||||
HalfEdge::new(
|
||||
update(self.path()),
|
||||
self.boundary(),
|
||||
self.curve().clone(),
|
||||
self.start_vertex().clone(),
|
||||
)
|
||||
.insert(core)
|
||||
}
|
||||
|
||||
fn update_boundary(
|
||||
|
@ -429,9 +429,12 @@ mod tests {
|
||||
|cycle, core| {
|
||||
cycle.update_half_edge(
|
||||
cycle.half_edges().nth_circular(0),
|
||||
|edge, _| {
|
||||
|edge, core| {
|
||||
[edge
|
||||
.update_path(|path| path.reverse())
|
||||
.update_path(
|
||||
|path| path.reverse(),
|
||||
core,
|
||||
)
|
||||
.update_boundary(|boundary| {
|
||||
boundary.reverse()
|
||||
})]
|
||||
|
Loading…
x
Reference in New Issue
Block a user