From 03e43538a5fdad5956e09868616b2c5f6d82e822 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:19:14 +0200 Subject: [PATCH 01/29] Add missing assertion This case was no longer checked, on accident, after a recent change. --- crates/fj-core/src/operations/update/cycle.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/update/cycle.rs b/crates/fj-core/src/operations/update/cycle.rs index 03567c942..87099a410 100644 --- a/crates/fj-core/src/operations/update/cycle.rs +++ b/crates/fj-core/src/operations/update/cycle.rs @@ -41,6 +41,10 @@ impl UpdateCycle for Cycle { } }); - Cycle::new(edges) + let cycle = Cycle::new(edges); + + assert!(updated.is_none(), "Edge not found in cycle"); + + cycle } } From 88a63f3b6f3102f2dba18c3727ddf5b373b73b9f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:19:49 +0200 Subject: [PATCH 02/29] Update doc comment --- crates/fj-core/src/operations/update/cycle.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/fj-core/src/operations/update/cycle.rs b/crates/fj-core/src/operations/update/cycle.rs index 87099a410..4765bdda5 100644 --- a/crates/fj-core/src/operations/update/cycle.rs +++ b/crates/fj-core/src/operations/update/cycle.rs @@ -10,6 +10,10 @@ pub trait UpdateCycle { fn add_edges(&self, edges: impl IntoIterator>) -> Self; /// Update the provided edge + /// + /// # Panics + /// + /// Panics, if the provided edge is not part of the cycle. #[must_use] fn update_edge( &self, From c3e51998f9aab8cbbc419f0bdbcc84974410bb25 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:23:02 +0200 Subject: [PATCH 03/29] Update trait method name --- crates/fj-core/src/operations/update/edge.rs | 4 ++-- crates/fj-core/src/validate/shell.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index 2db76fec5..b701053aa 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -10,7 +10,7 @@ use crate::{ pub trait UpdateEdge { /// Replace the path of the edge #[must_use] - fn replace_path(&self, path: SurfacePath) -> Self; + fn update_path(&self, path: SurfacePath) -> Self; /// Replace the boundary of the edge #[must_use] @@ -26,7 +26,7 @@ pub trait UpdateEdge { } impl UpdateEdge for Edge { - fn replace_path(&self, path: SurfacePath) -> Self { + fn update_path(&self, path: SurfacePath) -> Self { Edge::new( path, self.boundary(), diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 143b35c92..7c7c4dfa0 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -403,7 +403,7 @@ mod tests { .update_edge( cycle.edges().nth_circular(0), |edge| { - edge.replace_path(edge.path().reverse()) + edge.update_path(edge.path().reverse()) .replace_boundary( edge.boundary().reverse(), ) From e3c4792e2c26e0122c5b7f277262c38a5ef61c46 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:24:29 +0200 Subject: [PATCH 04/29] Switch `UpdateEdge::update_path` to new style --- crates/fj-core/src/operations/update/edge.rs | 12 +++++++++--- crates/fj-core/src/validate/shell.rs | 12 +++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index b701053aa..25f639ef3 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -10,7 +10,10 @@ use crate::{ pub trait UpdateEdge { /// Replace the path of the edge #[must_use] - fn update_path(&self, path: SurfacePath) -> Self; + fn update_path( + &self, + update: impl FnOnce(SurfacePath) -> SurfacePath, + ) -> Self; /// Replace the boundary of the edge #[must_use] @@ -26,9 +29,12 @@ pub trait UpdateEdge { } impl UpdateEdge for Edge { - fn update_path(&self, path: SurfacePath) -> Self { + fn update_path( + &self, + update: impl FnOnce(SurfacePath) -> SurfacePath, + ) -> Self { Edge::new( - path, + update(self.path()), self.boundary(), self.curve().clone(), self.start_vertex().clone(), diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 7c7c4dfa0..7700f399c 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -403,11 +403,13 @@ mod tests { .update_edge( cycle.edges().nth_circular(0), |edge| { - edge.update_path(edge.path().reverse()) - .replace_boundary( - edge.boundary().reverse(), - ) - .insert(&mut services) + edge.update_path(|_| { + edge.path().reverse() + }) + .replace_boundary( + edge.boundary().reverse(), + ) + .insert(&mut services) }, ) .insert(&mut services) From 7db42f7c8c4ec480ee2439bdb23f4c291ce9e27f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:25:10 +0200 Subject: [PATCH 05/29] Refactor --- crates/fj-core/src/validate/shell.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 7700f399c..762a8d6db 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -403,13 +403,11 @@ mod tests { .update_edge( cycle.edges().nth_circular(0), |edge| { - edge.update_path(|_| { - edge.path().reverse() - }) - .replace_boundary( - edge.boundary().reverse(), - ) - .insert(&mut services) + edge.update_path(|path| path.reverse()) + .replace_boundary( + edge.boundary().reverse(), + ) + .insert(&mut services) }, ) .insert(&mut services) From 9a0f3030864b439feda6b637a349b154b0d09656 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:25:50 +0200 Subject: [PATCH 06/29] Update trait method name --- crates/fj-core/src/operations/update/edge.rs | 4 ++-- crates/fj-core/src/validate/shell.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index 25f639ef3..76341561b 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -17,7 +17,7 @@ pub trait UpdateEdge { /// Replace the boundary of the edge #[must_use] - fn replace_boundary(&self, boundary: CurveBoundary>) -> Self; + fn update_boundary(&self, boundary: CurveBoundary>) -> Self; /// Replace the curve of the edge #[must_use] @@ -41,7 +41,7 @@ impl UpdateEdge for Edge { ) } - fn replace_boundary(&self, boundary: CurveBoundary>) -> Self { + fn update_boundary(&self, boundary: CurveBoundary>) -> Self { Edge::new( self.path(), boundary, diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 762a8d6db..dc284aafd 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -404,7 +404,7 @@ mod tests { cycle.edges().nth_circular(0), |edge| { edge.update_path(|path| path.reverse()) - .replace_boundary( + .update_boundary( edge.boundary().reverse(), ) .insert(&mut services) From ac524737dee0160a23dda41b5e082dfe477ce058 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:27:14 +0200 Subject: [PATCH 07/29] Switch `UpdateEdge::update_boundary` to new style --- crates/fj-core/src/operations/update/edge.rs | 12 +++++++++--- crates/fj-core/src/validate/shell.rs | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index 76341561b..d8abced94 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -17,7 +17,10 @@ pub trait UpdateEdge { /// Replace the boundary of the edge #[must_use] - fn update_boundary(&self, boundary: CurveBoundary>) -> Self; + fn update_boundary( + &self, + update: impl FnOnce(CurveBoundary>) -> CurveBoundary>, + ) -> Self; /// Replace the curve of the edge #[must_use] @@ -41,10 +44,13 @@ impl UpdateEdge for Edge { ) } - fn update_boundary(&self, boundary: CurveBoundary>) -> Self { + fn update_boundary( + &self, + update: impl FnOnce(CurveBoundary>) -> CurveBoundary>, + ) -> Self { Edge::new( self.path(), - boundary, + update(self.boundary()), self.curve().clone(), self.start_vertex().clone(), ) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index dc284aafd..46114d3d1 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -404,9 +404,9 @@ mod tests { cycle.edges().nth_circular(0), |edge| { edge.update_path(|path| path.reverse()) - .update_boundary( - edge.boundary().reverse(), - ) + .update_boundary(|_| { + edge.boundary().reverse() + }) .insert(&mut services) }, ) From a6b0baf9afebbea751628590a236b3540d0d1e1f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:29:00 +0200 Subject: [PATCH 08/29] Refactor --- crates/fj-core/src/validate/shell.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 46114d3d1..6fb43b642 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -404,8 +404,8 @@ mod tests { cycle.edges().nth_circular(0), |edge| { edge.update_path(|path| path.reverse()) - .update_boundary(|_| { - edge.boundary().reverse() + .update_boundary(|boundary| { + boundary.reverse() }) .insert(&mut services) }, From e19a45a846b010ead8ecdeeddf78769deb32fe6d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:29:55 +0200 Subject: [PATCH 09/29] Update trait method name --- crates/fj-core/src/algorithms/sweep/edge.rs | 2 +- crates/fj-core/src/operations/join/cycle.rs | 4 ++-- crates/fj-core/src/operations/update/edge.rs | 4 ++-- crates/fj-core/src/validate/shell.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/fj-core/src/algorithms/sweep/edge.rs b/crates/fj-core/src/algorithms/sweep/edge.rs index 0336d2c2d..a93263f66 100644 --- a/crates/fj-core/src/algorithms/sweep/edge.rs +++ b/crates/fj-core/src/algorithms/sweep/edge.rs @@ -89,7 +89,7 @@ impl Sweep for (&Edge, &Handle, &Surface, Option) { .replace_start_vertex(start_vertex); let edge = if let Some(curve) = curve { - edge.replace_curve(curve) + edge.update_curve(curve) } else { edge }; diff --git a/crates/fj-core/src/operations/join/cycle.rs b/crates/fj-core/src/operations/join/cycle.rs index c58aa4d60..077ede054 100644 --- a/crates/fj-core/src/operations/join/cycle.rs +++ b/crates/fj-core/src/operations/join/cycle.rs @@ -84,7 +84,7 @@ impl JoinCycle for Cycle { self.add_edges(edges.into_iter().circular_tuple_windows().map( |((prev, _, _), (edge, curve, boundary))| { Edge::unjoined(curve, boundary, services) - .replace_curve(edge.curve().clone()) + .update_curve(edge.curve().clone()) .replace_start_vertex(prev.start_vertex().clone()) .insert(services) }, @@ -111,7 +111,7 @@ impl JoinCycle for Cycle { cycle .update_edge(self.edges().nth_circular(index), |edge| { - edge.replace_curve(edge_other.curve().clone()) + edge.update_curve(edge_other.curve().clone()) .replace_start_vertex( other .edges() diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index d8abced94..4fd0e5bec 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -24,7 +24,7 @@ pub trait UpdateEdge { /// Replace the curve of the edge #[must_use] - fn replace_curve(&self, curve: Handle) -> Self; + fn update_curve(&self, curve: Handle) -> Self; /// Replace the start vertex of the edge #[must_use] @@ -56,7 +56,7 @@ impl UpdateEdge for Edge { ) } - fn replace_curve(&self, curve: Handle) -> Self { + fn update_curve(&self, curve: Handle) -> Self { Edge::new( self.path(), self.boundary(), diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 6fb43b642..6a62fbfb5 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -451,7 +451,7 @@ mod tests { let curve = Curve::new().insert(&mut services); - edge.replace_curve(curve) + edge.update_curve(curve) .insert(&mut services) }, ) From a7fe1bfd116cb93dc7977f411d93e52a14329baa Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:31:26 +0200 Subject: [PATCH 10/29] Switch `UpdateEdge::update_curve` to new style --- crates/fj-core/src/algorithms/sweep/edge.rs | 2 +- crates/fj-core/src/operations/join/cycle.rs | 4 ++-- crates/fj-core/src/operations/update/edge.rs | 12 +++++++++--- crates/fj-core/src/validate/shell.rs | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/crates/fj-core/src/algorithms/sweep/edge.rs b/crates/fj-core/src/algorithms/sweep/edge.rs index a93263f66..63a5c1828 100644 --- a/crates/fj-core/src/algorithms/sweep/edge.rs +++ b/crates/fj-core/src/algorithms/sweep/edge.rs @@ -89,7 +89,7 @@ impl Sweep for (&Edge, &Handle, &Surface, Option) { .replace_start_vertex(start_vertex); let edge = if let Some(curve) = curve { - edge.update_curve(curve) + edge.update_curve(|_| curve) } else { edge }; diff --git a/crates/fj-core/src/operations/join/cycle.rs b/crates/fj-core/src/operations/join/cycle.rs index 077ede054..8a627a6dd 100644 --- a/crates/fj-core/src/operations/join/cycle.rs +++ b/crates/fj-core/src/operations/join/cycle.rs @@ -84,7 +84,7 @@ impl JoinCycle for Cycle { self.add_edges(edges.into_iter().circular_tuple_windows().map( |((prev, _, _), (edge, curve, boundary))| { Edge::unjoined(curve, boundary, services) - .update_curve(edge.curve().clone()) + .update_curve(|_| edge.curve().clone()) .replace_start_vertex(prev.start_vertex().clone()) .insert(services) }, @@ -111,7 +111,7 @@ impl JoinCycle for Cycle { cycle .update_edge(self.edges().nth_circular(index), |edge| { - edge.update_curve(edge_other.curve().clone()) + edge.update_curve(|_| edge_other.curve().clone()) .replace_start_vertex( other .edges() diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index 4fd0e5bec..dcfe065ca 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -24,7 +24,10 @@ pub trait UpdateEdge { /// Replace the curve of the edge #[must_use] - fn update_curve(&self, curve: Handle) -> Self; + fn update_curve( + &self, + update: impl FnOnce(&Handle) -> Handle, + ) -> Self; /// Replace the start vertex of the edge #[must_use] @@ -56,11 +59,14 @@ impl UpdateEdge for Edge { ) } - fn update_curve(&self, curve: Handle) -> Self { + fn update_curve( + &self, + update: impl FnOnce(&Handle) -> Handle, + ) -> Self { Edge::new( self.path(), self.boundary(), - curve, + update(self.curve()), self.start_vertex().clone(), ) } diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 6a62fbfb5..051ff3cb0 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -451,7 +451,7 @@ mod tests { let curve = Curve::new().insert(&mut services); - edge.update_curve(curve) + edge.update_curve(|_| curve) .insert(&mut services) }, ) From dd16cad107f6f6d2b9f8f3c9f1cd4c5672c366fe Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:32:00 +0200 Subject: [PATCH 11/29] Inline redundant variable --- crates/fj-core/src/validate/shell.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 051ff3cb0..f7e502326 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -448,11 +448,10 @@ mod tests { .update_edge( cycle.edges().nth_circular(0), |edge| { - let curve = - Curve::new().insert(&mut services); - - edge.update_curve(|_| curve) - .insert(&mut services) + edge.update_curve(|_| { + Curve::new().insert(&mut services) + }) + .insert(&mut services) }, ) .insert(&mut services) From a393bf42acfdf281b8639db0e4524f346fcdaba4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:32:56 +0200 Subject: [PATCH 12/29] Update trait method name --- crates/fj-core/src/algorithms/sweep/edge.rs | 2 +- crates/fj-core/src/operations/join/cycle.rs | 6 +++--- crates/fj-core/src/operations/update/edge.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/fj-core/src/algorithms/sweep/edge.rs b/crates/fj-core/src/algorithms/sweep/edge.rs index 63a5c1828..6367e7f41 100644 --- a/crates/fj-core/src/algorithms/sweep/edge.rs +++ b/crates/fj-core/src/algorithms/sweep/edge.rs @@ -86,7 +86,7 @@ impl Sweep for (&Edge, &Handle, &Surface, Option) { Some(boundary), services, ) - .replace_start_vertex(start_vertex); + .update_start_vertex(start_vertex); let edge = if let Some(curve) = curve { edge.update_curve(|_| curve) diff --git a/crates/fj-core/src/operations/join/cycle.rs b/crates/fj-core/src/operations/join/cycle.rs index 8a627a6dd..3593b8bdd 100644 --- a/crates/fj-core/src/operations/join/cycle.rs +++ b/crates/fj-core/src/operations/join/cycle.rs @@ -85,7 +85,7 @@ impl JoinCycle for Cycle { |((prev, _, _), (edge, curve, boundary))| { Edge::unjoined(curve, boundary, services) .update_curve(|_| edge.curve().clone()) - .replace_start_vertex(prev.start_vertex().clone()) + .update_start_vertex(prev.start_vertex().clone()) .insert(services) }, )) @@ -112,7 +112,7 @@ impl JoinCycle for Cycle { cycle .update_edge(self.edges().nth_circular(index), |edge| { edge.update_curve(|_| edge_other.curve().clone()) - .replace_start_vertex( + .update_start_vertex( other .edges() .nth_circular(index_other + 1) @@ -122,7 +122,7 @@ impl JoinCycle for Cycle { .insert(services) }) .update_edge(self.edges().nth_circular(index + 1), |edge| { - edge.replace_start_vertex( + edge.update_start_vertex( edge_other.start_vertex().clone(), ) .insert(services) diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index dcfe065ca..41968a7aa 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -31,7 +31,7 @@ pub trait UpdateEdge { /// Replace the start vertex of the edge #[must_use] - fn replace_start_vertex(&self, start_vertex: Handle) -> Self; + fn update_start_vertex(&self, start_vertex: Handle) -> Self; } impl UpdateEdge for Edge { @@ -71,7 +71,7 @@ impl UpdateEdge for Edge { ) } - fn replace_start_vertex(&self, start_vertex: Handle) -> Self { + fn update_start_vertex(&self, start_vertex: Handle) -> Self { Edge::new( self.path(), self.boundary(), From c30421c4ac3b48f28e41ffa77aad68b86778f032 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:34:15 +0200 Subject: [PATCH 13/29] Switch `update_start_vertex` to new style --- crates/fj-core/src/algorithms/sweep/edge.rs | 2 +- crates/fj-core/src/operations/join/cycle.rs | 14 +++++++------- crates/fj-core/src/operations/update/edge.rs | 12 +++++++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/crates/fj-core/src/algorithms/sweep/edge.rs b/crates/fj-core/src/algorithms/sweep/edge.rs index 6367e7f41..5428d29a9 100644 --- a/crates/fj-core/src/algorithms/sweep/edge.rs +++ b/crates/fj-core/src/algorithms/sweep/edge.rs @@ -86,7 +86,7 @@ impl Sweep for (&Edge, &Handle, &Surface, Option) { Some(boundary), services, ) - .update_start_vertex(start_vertex); + .update_start_vertex(|_| start_vertex); let edge = if let Some(curve) = curve { edge.update_curve(|_| curve) diff --git a/crates/fj-core/src/operations/join/cycle.rs b/crates/fj-core/src/operations/join/cycle.rs index 3593b8bdd..4ecd16c0a 100644 --- a/crates/fj-core/src/operations/join/cycle.rs +++ b/crates/fj-core/src/operations/join/cycle.rs @@ -85,7 +85,7 @@ impl JoinCycle for Cycle { |((prev, _, _), (edge, curve, boundary))| { Edge::unjoined(curve, boundary, services) .update_curve(|_| edge.curve().clone()) - .update_start_vertex(prev.start_vertex().clone()) + .update_start_vertex(|_| prev.start_vertex().clone()) .insert(services) }, )) @@ -112,19 +112,19 @@ impl JoinCycle for Cycle { cycle .update_edge(self.edges().nth_circular(index), |edge| { edge.update_curve(|_| edge_other.curve().clone()) - .update_start_vertex( + .update_start_vertex(|_| { other .edges() .nth_circular(index_other + 1) .start_vertex() - .clone(), - ) + .clone() + }) .insert(services) }) .update_edge(self.edges().nth_circular(index + 1), |edge| { - edge.update_start_vertex( - edge_other.start_vertex().clone(), - ) + edge.update_start_vertex(|_| { + edge_other.start_vertex().clone() + }) .insert(services) }) }, diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index 41968a7aa..a168c366b 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -31,7 +31,10 @@ pub trait UpdateEdge { /// Replace the start vertex of the edge #[must_use] - fn update_start_vertex(&self, start_vertex: Handle) -> Self; + fn update_start_vertex( + &self, + update: impl FnOnce(&Handle) -> Handle, + ) -> Self; } impl UpdateEdge for Edge { @@ -71,12 +74,15 @@ impl UpdateEdge for Edge { ) } - fn update_start_vertex(&self, start_vertex: Handle) -> Self { + fn update_start_vertex( + &self, + update: impl FnOnce(&Handle) -> Handle, + ) -> Self { Edge::new( self.path(), self.boundary(), self.curve().clone(), - start_vertex, + update(self.start_vertex()), ) } } From ee0f5cc72ecb5fb248bc6deb2aa73f24a54e8dcc Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:35:02 +0200 Subject: [PATCH 14/29] Update documentation of `UpdateEdge` --- crates/fj-core/src/operations/update/edge.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/fj-core/src/operations/update/edge.rs b/crates/fj-core/src/operations/update/edge.rs index a168c366b..b1b180def 100644 --- a/crates/fj-core/src/operations/update/edge.rs +++ b/crates/fj-core/src/operations/update/edge.rs @@ -8,28 +8,28 @@ use crate::{ /// Update a [`Edge`] pub trait UpdateEdge { - /// Replace the path of the edge + /// Update the path of the edge #[must_use] fn update_path( &self, update: impl FnOnce(SurfacePath) -> SurfacePath, ) -> Self; - /// Replace the boundary of the edge + /// Update the boundary of the edge #[must_use] fn update_boundary( &self, update: impl FnOnce(CurveBoundary>) -> CurveBoundary>, ) -> Self; - /// Replace the curve of the edge + /// Update the curve of the edge #[must_use] fn update_curve( &self, update: impl FnOnce(&Handle) -> Handle, ) -> Self; - /// Replace the start vertex of the edge + /// Update the start vertex of the edge #[must_use] fn update_start_vertex( &self, From dbb4812d030336d17e2c3b54367b7c83d3578ac0 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:35:34 +0200 Subject: [PATCH 15/29] Update doc comment --- crates/fj-core/src/operations/update/face.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/update/face.rs b/crates/fj-core/src/operations/update/face.rs index 4950e0096..19de81253 100644 --- a/crates/fj-core/src/operations/update/face.rs +++ b/crates/fj-core/src/operations/update/face.rs @@ -6,7 +6,7 @@ use crate::{ /// Update a [`Face`] pub trait UpdateFace { - /// Replace the region of the face + /// Update the region of the face #[must_use] fn update_region( &self, From 9f3d97f982396658cec8d2373ef265a9d3cb1fd3 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:36:02 +0200 Subject: [PATCH 16/29] Rename argument to increase consistency --- crates/fj-core/src/operations/update/face.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/operations/update/face.rs b/crates/fj-core/src/operations/update/face.rs index 19de81253..b61717da7 100644 --- a/crates/fj-core/src/operations/update/face.rs +++ b/crates/fj-core/src/operations/update/face.rs @@ -10,16 +10,16 @@ pub trait UpdateFace { #[must_use] fn update_region( &self, - f: impl FnOnce(&Handle) -> Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self; } impl UpdateFace for Face { fn update_region( &self, - f: impl FnOnce(&Handle) -> Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self { - let region = f(self.region()); + let region = update(self.region()); Face::new(self.surface().clone(), region) } } @@ -27,8 +27,8 @@ impl UpdateFace for Face { impl UpdateFace for Polygon { fn update_region( &self, - f: impl FnOnce(&Handle) -> Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self { - self.replace_face(self.face.update_region(f)) + self.replace_face(self.face.update_region(update)) } } From d023113081584fea61d64381c681b2cac8a8a9e5 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:36:43 +0200 Subject: [PATCH 17/29] Fix typo in doc comment --- crates/fj-core/src/operations/update/region.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/update/region.rs b/crates/fj-core/src/operations/update/region.rs index f32fd4b23..6f3e908f5 100644 --- a/crates/fj-core/src/operations/update/region.rs +++ b/crates/fj-core/src/operations/update/region.rs @@ -12,7 +12,7 @@ pub trait UpdateRegion { f: impl FnOnce(&Handle) -> Handle, ) -> Self; - /// Add the provides interiors to the region + /// Add the provided interiors to the region #[must_use] fn add_interiors( &self, From eb746ed4c83be7e6eedc98a240408d70e8299eee Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:37:08 +0200 Subject: [PATCH 18/29] Rename argument to increase consistency --- crates/fj-core/src/operations/update/region.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-core/src/operations/update/region.rs b/crates/fj-core/src/operations/update/region.rs index 6f3e908f5..99813797d 100644 --- a/crates/fj-core/src/operations/update/region.rs +++ b/crates/fj-core/src/operations/update/region.rs @@ -9,7 +9,7 @@ pub trait UpdateRegion { #[must_use] fn update_exterior( &self, - f: impl FnOnce(&Handle) -> Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self; /// Add the provided interiors to the region @@ -23,9 +23,9 @@ pub trait UpdateRegion { impl UpdateRegion for Region { fn update_exterior( &self, - f: impl FnOnce(&Handle) -> Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self { - let exterior = f(self.exterior()); + let exterior = update(self.exterior()); Region::new(exterior, self.interiors().iter().cloned(), self.color()) } From c28f768a410474e8f515e41ff7c16cd3ccccb1f6 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:37:47 +0200 Subject: [PATCH 19/29] Update trait method name --- crates/fj-core/src/operations/update/shell.rs | 4 ++-- crates/fj-core/src/validate/shell.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/fj-core/src/operations/update/shell.rs b/crates/fj-core/src/operations/update/shell.rs index eb7d78928..b708040bd 100644 --- a/crates/fj-core/src/operations/update/shell.rs +++ b/crates/fj-core/src/operations/update/shell.rs @@ -11,7 +11,7 @@ pub trait UpdateShell { /// Replace a face of the shell #[must_use] - fn replace_face( + fn update_face( &self, original: &Handle, replacement: Handle, @@ -28,7 +28,7 @@ impl UpdateShell for Shell { Shell::new(faces) } - fn replace_face( + fn update_face( &self, original: &Handle, replacement: Handle, diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index f7e502326..39e740fad 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -391,7 +391,7 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.replace_face( + let invalid = valid.shell.update_face( &valid.abc.face, valid .abc @@ -436,7 +436,7 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.replace_face( + let invalid = valid.shell.update_face( &valid.abc.face, valid .abc @@ -498,7 +498,7 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.replace_face( + let invalid = valid.shell.update_face( &valid.abc.face, valid.abc.face.reverse(&mut services).insert(&mut services), ); From 18c57adfa533824768e6d7b662b92166c7e9e121 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:48:42 +0200 Subject: [PATCH 20/29] Implement `IntoIterator` for `Handles` --- crates/fj-core/src/objects/handles.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/objects/handles.rs b/crates/fj-core/src/objects/handles.rs index a2ed0c6f1..d0c488368 100644 --- a/crates/fj-core/src/objects/handles.rs +++ b/crates/fj-core/src/objects/handles.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeSet, fmt::Debug, slice}; +use std::{collections::BTreeSet, fmt::Debug, slice, vec}; use itertools::Itertools; @@ -109,6 +109,15 @@ where } } +impl IntoIterator for Handles { + type Item = Handle; + type IntoIter = vec::IntoIter>; + + fn into_iter(self) -> Self::IntoIter { + self.inner.into_iter() + } +} + impl<'r, T> IntoIterator for &'r Handles { // You might wonder why we're returning references to handles here, when // `Handle` already is kind of reference, and easily cloned. From 80fc3b2908da7bb5364cfb9f295a46f17dc8cfa5 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:49:08 +0200 Subject: [PATCH 21/29] Add `Handles::update` --- crates/fj-core/src/objects/handles.rs | 34 +++++++++++++++++++ crates/fj-core/src/operations/update/cycle.rs | 19 ++--------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/crates/fj-core/src/objects/handles.rs b/crates/fj-core/src/objects/handles.rs index d0c488368..1114a8f86 100644 --- a/crates/fj-core/src/objects/handles.rs +++ b/crates/fj-core/src/objects/handles.rs @@ -98,6 +98,40 @@ impl Handles { pub fn pairs(&self) -> impl Iterator, &Handle)> { self.iter().circular_tuple_windows() } + + /// Create a new instance in which the provided item is updated + /// + /// # Panics + /// + /// Panics, if the provided item is not present. + /// Panics, if the update results in a duplicate item. + #[must_use] + pub fn update( + &self, + handle: &Handle, + update: impl FnOnce(&Handle) -> Handle, + ) -> Self + where + T: Debug + Ord, + { + let mut updated = Some(update(handle)); + + let items = self.iter().map(|h| { + if h.id() == handle.id() { + updated + .take() + .expect("`Handles` should not contain same item twice") + } else { + h.clone() + } + }); + + let handles = items.collect(); + + assert!(updated.is_none(), "Edge not found in cycle"); + + handles + } } impl FromIterator> for Handles diff --git a/crates/fj-core/src/operations/update/cycle.rs b/crates/fj-core/src/operations/update/cycle.rs index 4765bdda5..1bc4d344d 100644 --- a/crates/fj-core/src/operations/update/cycle.rs +++ b/crates/fj-core/src/operations/update/cycle.rs @@ -33,22 +33,7 @@ impl UpdateCycle for Cycle { edge: &Handle, update: impl FnOnce(&Handle) -> Handle, ) -> Self { - let mut updated = Some(update(edge)); - - let edges = self.edges().iter().map(|e| { - if e.id() == edge.id() { - updated - .take() - .expect("Cycle should not contain same edge twice") - } else { - e.clone() - } - }); - - let cycle = Cycle::new(edges); - - assert!(updated.is_none(), "Edge not found in cycle"); - - cycle + let edges = self.edges().update(edge, update); + Cycle::new(edges) } } From 4811a0dabd304c207529c4f565a6a06764fc2399 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:50:28 +0200 Subject: [PATCH 22/29] Update doc comment --- crates/fj-core/src/operations/update/cycle.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/update/cycle.rs b/crates/fj-core/src/operations/update/cycle.rs index 1bc4d344d..3a67bf54b 100644 --- a/crates/fj-core/src/operations/update/cycle.rs +++ b/crates/fj-core/src/operations/update/cycle.rs @@ -13,7 +13,9 @@ pub trait UpdateCycle { /// /// # Panics /// - /// Panics, if the provided edge is not part of the cycle. + /// Uses [`Handles::update`] internally, and panics for the same reasons. + /// + /// [`Handles::update`]: crate::objects::Handles::update #[must_use] fn update_edge( &self, From b0a1489575c1d4e10610c58a664e834e9b57f2e4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:51:02 +0200 Subject: [PATCH 23/29] Rename argument to prepare for follow-on change --- crates/fj-core/src/operations/update/shell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-core/src/operations/update/shell.rs b/crates/fj-core/src/operations/update/shell.rs index b708040bd..4f1861fa0 100644 --- a/crates/fj-core/src/operations/update/shell.rs +++ b/crates/fj-core/src/operations/update/shell.rs @@ -33,11 +33,11 @@ impl UpdateShell for Shell { original: &Handle, replacement: Handle, ) -> Self { - let faces = self.faces().iter().map(|face| { - if face.id() == original.id() { + let faces = self.faces().iter().map(|f| { + if f.id() == original.id() { replacement.clone() } else { - face.clone() + f.clone() } }); From eecabd464eb0483bde4e7e0318f32779bc8b2d6a Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:51:25 +0200 Subject: [PATCH 24/29] Rename argument to increase consistency --- crates/fj-core/src/operations/update/shell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-core/src/operations/update/shell.rs b/crates/fj-core/src/operations/update/shell.rs index 4f1861fa0..d1e4e32d5 100644 --- a/crates/fj-core/src/operations/update/shell.rs +++ b/crates/fj-core/src/operations/update/shell.rs @@ -13,7 +13,7 @@ pub trait UpdateShell { #[must_use] fn update_face( &self, - original: &Handle, + face: &Handle, replacement: Handle, ) -> Self; @@ -30,11 +30,11 @@ impl UpdateShell for Shell { fn update_face( &self, - original: &Handle, + face: &Handle, replacement: Handle, ) -> Self { let faces = self.faces().iter().map(|f| { - if f.id() == original.id() { + if f.id() == face.id() { replacement.clone() } else { f.clone() From 78d4173b12e98825e104fc2b3383b0a5c8717d8b Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:53:37 +0200 Subject: [PATCH 25/29] Switch `UpdateShell::update_face` to new style --- crates/fj-core/src/operations/update/shell.rs | 13 +++--------- crates/fj-core/src/validate/shell.rs | 21 ++++++++----------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/crates/fj-core/src/operations/update/shell.rs b/crates/fj-core/src/operations/update/shell.rs index d1e4e32d5..e9d21cb89 100644 --- a/crates/fj-core/src/operations/update/shell.rs +++ b/crates/fj-core/src/operations/update/shell.rs @@ -14,7 +14,7 @@ pub trait UpdateShell { fn update_face( &self, face: &Handle, - replacement: Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self; /// Remove a face from the shell @@ -31,16 +31,9 @@ impl UpdateShell for Shell { fn update_face( &self, face: &Handle, - replacement: Handle, + update: impl FnOnce(&Handle) -> Handle, ) -> Self { - let faces = self.faces().iter().map(|f| { - if f.id() == face.id() { - replacement.clone() - } else { - f.clone() - } - }); - + let faces = self.faces().update(face, update); Shell::new(faces) } diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 39e740fad..65714edca 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -391,8 +391,7 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.update_face( - &valid.abc.face, + let invalid = valid.shell.update_face(&valid.abc.face, |_| { valid .abc .face @@ -414,8 +413,8 @@ mod tests { }) .insert(&mut services) }) - .insert(&mut services), - ); + .insert(&mut services) + }); valid.shell.validate_and_return_first_error()?; assert_contains_err!( @@ -436,8 +435,7 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.update_face( - &valid.abc.face, + let invalid = valid.shell.update_face(&valid.abc.face, |_| { valid .abc .face @@ -458,8 +456,8 @@ mod tests { }) .insert(&mut services) }) - .insert(&mut services), - ); + .insert(&mut services) + }); valid.shell.validate_and_return_first_error()?; assert_contains_err!( @@ -498,10 +496,9 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.update_face( - &valid.abc.face, - valid.abc.face.reverse(&mut services).insert(&mut services), - ); + let invalid = valid.shell.update_face(&valid.abc.face, |_| { + valid.abc.face.reverse(&mut services).insert(&mut services) + }); valid.shell.validate_and_return_first_error()?; assert_contains_err!( From d48cf69f615d1177f61e279cc0abb6c79d01d420 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:54:30 +0200 Subject: [PATCH 26/29] Refactor --- crates/fj-core/src/validate/shell.rs | 43 +++++++++++++--------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 65714edca..d0c44b403 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -391,29 +391,26 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.update_face(&valid.abc.face, |_| { - valid - .abc - .face - .update_region(|region| { - region - .update_exterior(|cycle| { - cycle - .update_edge( - cycle.edges().nth_circular(0), - |edge| { - edge.update_path(|path| path.reverse()) - .update_boundary(|boundary| { - boundary.reverse() - }) - .insert(&mut services) - }, - ) - .insert(&mut services) - }) - .insert(&mut services) - }) - .insert(&mut services) + let invalid = valid.shell.update_face(&valid.abc.face, |face| { + face.update_region(|region| { + region + .update_exterior(|cycle| { + cycle + .update_edge( + cycle.edges().nth_circular(0), + |edge| { + edge.update_path(|path| path.reverse()) + .update_boundary(|boundary| { + boundary.reverse() + }) + .insert(&mut services) + }, + ) + .insert(&mut services) + }) + .insert(&mut services) + }) + .insert(&mut services) }); valid.shell.validate_and_return_first_error()?; From 979c1b4888171d9c53ffc65301545aa46bb9bef4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:55:16 +0200 Subject: [PATCH 27/29] Refactor --- crates/fj-core/src/validate/shell.rs | 41 +++++++++++++--------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index d0c44b403..4dbc48a94 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -432,28 +432,25 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.update_face(&valid.abc.face, |_| { - valid - .abc - .face - .update_region(|region| { - region - .update_exterior(|cycle| { - cycle - .update_edge( - cycle.edges().nth_circular(0), - |edge| { - edge.update_curve(|_| { - Curve::new().insert(&mut services) - }) - .insert(&mut services) - }, - ) - .insert(&mut services) - }) - .insert(&mut services) - }) - .insert(&mut services) + let invalid = valid.shell.update_face(&valid.abc.face, |face| { + face.update_region(|region| { + region + .update_exterior(|cycle| { + cycle + .update_edge( + cycle.edges().nth_circular(0), + |edge| { + edge.update_curve(|_| { + Curve::new().insert(&mut services) + }) + .insert(&mut services) + }, + ) + .insert(&mut services) + }) + .insert(&mut services) + }) + .insert(&mut services) }); valid.shell.validate_and_return_first_error()?; From 119bf9dfd2aeed2eea6c08a046aef56652c2e2f2 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:55:38 +0200 Subject: [PATCH 28/29] Refactor --- crates/fj-core/src/validate/shell.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 4dbc48a94..58be7983d 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -490,8 +490,8 @@ mod tests { [[0., 0., 0.], [0., 1., 0.], [1., 0., 0.], [0., 0., 1.]], &mut services, ); - let invalid = valid.shell.update_face(&valid.abc.face, |_| { - valid.abc.face.reverse(&mut services).insert(&mut services) + let invalid = valid.shell.update_face(&valid.abc.face, |face| { + face.reverse(&mut services).insert(&mut services) }); valid.shell.validate_and_return_first_error()?; From d38a23504f089b5579b32c8152a66498b8fc2e67 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 26 Sep 2023 08:56:30 +0200 Subject: [PATCH 29/29] Update doc comment --- crates/fj-core/src/operations/update/shell.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/update/shell.rs b/crates/fj-core/src/operations/update/shell.rs index e9d21cb89..95118ab00 100644 --- a/crates/fj-core/src/operations/update/shell.rs +++ b/crates/fj-core/src/operations/update/shell.rs @@ -9,7 +9,13 @@ pub trait UpdateShell { #[must_use] fn add_faces(&self, faces: impl IntoIterator>) -> Self; - /// Replace a face of the shell + /// Update a face of the shell + /// + /// # Panics + /// + /// Uses [`Handles::update`] internally, and panics for the same reasons. + /// + /// [`Handles::update`]: crate::objects::Handles::update #[must_use] fn update_face( &self,