diff --git a/crates/fj-kernel/src/algorithms/sweep/edge.rs b/crates/fj-kernel/src/algorithms/sweep/edge.rs index f1f2005f6..36f745545 100644 --- a/crates/fj-kernel/src/algorithms/sweep/edge.rs +++ b/crates/fj-kernel/src/algorithms/sweep/edge.rs @@ -71,7 +71,6 @@ impl Sweep for (HalfEdge, Color) { vertex.position(), curve.clone(), surface_vertex, - *vertex.global_form(), ) }) }; @@ -134,18 +133,13 @@ impl Sweep for (HalfEdge, Color) { (b_vertex, b_surface, b_global), ]; - vertices.map(|(vertex, point_surface, vertex_global)| { - let vertex_surface = SurfaceVertex::new( + vertices.map(|(vertex, point_surface, global_form)| { + let surface_form = SurfaceVertex::new( point_surface, surface.clone(), - vertex_global, + global_form, ); - Vertex::new( - vertex.position(), - curve.clone(), - vertex_surface, - vertex_global, - ) + Vertex::new(vertex.position(), curve.clone(), surface_form) }) }; diff --git a/crates/fj-kernel/src/algorithms/sweep/vertex.rs b/crates/fj-kernel/src/algorithms/sweep/vertex.rs index 2f9eb4df2..04835a3ac 100644 --- a/crates/fj-kernel/src/algorithms/sweep/vertex.rs +++ b/crates/fj-kernel/src/algorithms/sweep/vertex.rs @@ -104,18 +104,11 @@ impl Sweep for (Vertex, Handle) { }, ); - // Can be cleaned up, once `zip` is stable: - // https://doc.rust-lang.org/std/primitive.array.html#method.zip - let [a_surface, b_surface] = vertices_surface; - let [a_global, b_global] = vertices_global; - let vertices = [(a_surface, a_global), (b_surface, b_global)]; - - vertices.map(|(vertex_surface, vertex_global)| { + vertices_surface.map(|surface_form| { Vertex::new( - [vertex_surface.position().v], + [surface_form.position().v], curve.clone(), - vertex_surface, - vertex_global, + surface_form, ) }) }; diff --git a/crates/fj-kernel/src/algorithms/validate/mod.rs b/crates/fj-kernel/src/algorithms/validate/mod.rs index c6901c89d..bc294e214 100644 --- a/crates/fj-kernel/src/algorithms/validate/mod.rs +++ b/crates/fj-kernel/src/algorithms/validate/mod.rs @@ -205,14 +205,9 @@ mod tests { Point::from([Scalar::ZERO + deviation]), curve.clone(), a_surface, - a_global, - ); - let b = Vertex::new( - Point::from([Scalar::ONE]), - curve.clone(), - b_surface, - b_global, ); + let b = + Vertex::new(Point::from([Scalar::ONE]), curve.clone(), b_surface); let vertices = [a, b]; let global_edge = GlobalEdge::partial() diff --git a/crates/fj-kernel/src/iter.rs b/crates/fj-kernel/src/iter.rs index 51a11b1c0..2c3ba1047 100644 --- a/crates/fj-kernel/src/iter.rs +++ b/crates/fj-kernel/src/iter.rs @@ -589,7 +589,7 @@ mod tests { let global_vertex = GlobalVertex::from_position([0., 0., 0.]); let surface_vertex = SurfaceVertex::new([0., 0.], surface, global_vertex); - let object = Vertex::new([0.], curve, surface_vertex, global_vertex); + let object = Vertex::new([0.], curve, surface_vertex); assert_eq!(1, object.curve_iter().count()); assert_eq!(0, object.cycle_iter().count()); diff --git a/crates/fj-kernel/src/objects/vertex.rs b/crates/fj-kernel/src/objects/vertex.rs index 1751cbac2..88f35dee8 100644 --- a/crates/fj-kernel/src/objects/vertex.rs +++ b/crates/fj-kernel/src/objects/vertex.rs @@ -15,7 +15,6 @@ pub struct Vertex { position: Point<1>, curve: Handle, surface_form: SurfaceVertex, - global_form: GlobalVertex, } impl Vertex { @@ -27,7 +26,6 @@ impl Vertex { position: impl Into>, curve: Handle, surface_form: SurfaceVertex, - global_form: GlobalVertex, ) -> Self { let position = position.into(); @@ -36,17 +34,11 @@ impl Vertex { surface_form.surface().id(), "Surface form of vertex must be defined on same surface as curve", ); - assert_eq!( - surface_form.global_form(), - &global_form, - "Vertex and its surface form must have same global form", - ); Self { position, curve, surface_form, - global_form, } } @@ -67,7 +59,7 @@ impl Vertex { /// Access the global form of this vertex pub fn global_form(&self) -> &GlobalVertex { - &self.global_form + self.surface_form.global_form() } } diff --git a/crates/fj-kernel/src/partial/objects/vertex.rs b/crates/fj-kernel/src/partial/objects/vertex.rs index 25b6d551c..0c020e390 100644 --- a/crates/fj-kernel/src/partial/objects/vertex.rs +++ b/crates/fj-kernel/src/partial/objects/vertex.rs @@ -110,9 +110,7 @@ impl PartialVertex { }) .into_full(stores); - let global_form = *surface_form.global_form(); - - Vertex::new(position, curve, surface_form, global_form) + Vertex::new(position, curve, surface_form) } }