diff --git a/crates/fj-kernel/src/algorithms/sweep/vertex.rs b/crates/fj-kernel/src/algorithms/sweep/vertex.rs index 4bf5f662a..05ae32dcd 100644 --- a/crates/fj-kernel/src/algorithms/sweep/vertex.rs +++ b/crates/fj-kernel/src/algorithms/sweep/vertex.rs @@ -2,7 +2,7 @@ use fj_math::Vector; use crate::{ insert::Insert, - objects::{GlobalCurve, GlobalEdge, GlobalVertex, Objects}, + objects::{GlobalEdge, GlobalVertex, Objects}, services::Service, storage::Handle, }; @@ -18,8 +18,6 @@ impl Sweep for Handle { cache: &mut SweepCache, objects: &mut Service, ) -> Self::Swept { - let curve = GlobalCurve.insert(objects); - let a = self.clone(); let b = cache .global_vertex @@ -30,8 +28,7 @@ impl Sweep for Handle { .clone(); let vertices = [a, b]; - let global_edge = - GlobalEdge::new(curve, vertices.clone()).insert(objects); + let global_edge = GlobalEdge::new(vertices.clone()).insert(objects); // The vertices of the returned `GlobalEdge` are in normalized order, // which means the order can't be relied upon by the caller. Return the diff --git a/crates/fj-kernel/src/algorithms/transform/edge.rs b/crates/fj-kernel/src/algorithms/transform/edge.rs index 4c5b7b242..1b3be7b98 100644 --- a/crates/fj-kernel/src/algorithms/transform/edge.rs +++ b/crates/fj-kernel/src/algorithms/transform/edge.rs @@ -43,15 +43,11 @@ impl TransformObject for GlobalEdge { objects: &mut Service, cache: &mut TransformCache, ) -> Self { - let curve = self - .curve() - .clone() - .transform_with_cache(transform, objects, cache); let vertices = self.vertices().access_in_normalized_order().map(|vertex| { vertex.transform_with_cache(transform, objects, cache) }); - Self::new(curve, vertices) + Self::new(vertices) } } diff --git a/crates/fj-kernel/src/builder/edge.rs b/crates/fj-kernel/src/builder/edge.rs index eacb8d1eb..a740408b3 100644 --- a/crates/fj-kernel/src/builder/edge.rs +++ b/crates/fj-kernel/src/builder/edge.rs @@ -223,9 +223,6 @@ impl HalfEdgeBuilder for PartialHalfEdge { other: &Partial, surface: &SurfaceGeometry, ) { - let global_curve = other.read().global_form.read().curve.clone(); - self.global_form.write().curve = global_curve; - self.curve.write().path = other.read().curve.read().path.as_ref().and_then(|path| { // We have information about the other edge's surface available. diff --git a/crates/fj-kernel/src/objects/full/edge.rs b/crates/fj-kernel/src/objects/full/edge.rs index 7ff6415a6..0f5025e13 100644 --- a/crates/fj-kernel/src/objects/full/edge.rs +++ b/crates/fj-kernel/src/objects/full/edge.rs @@ -2,8 +2,8 @@ use fj_interop::ext::ArrayExt; use fj_math::Point; use crate::{ - objects::{Curve, GlobalCurve, GlobalVertex, SurfaceVertex}, - storage::{Handle, HandleWrapper}, + objects::{Curve, GlobalVertex, SurfaceVertex}, + storage::Handle, }; /// A directed edge, defined in a surface's 2D space @@ -104,7 +104,6 @@ impl HalfEdge { /// between [`HalfEdge`] and `GlobalEdge`. #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct GlobalEdge { - curve: HandleWrapper, vertices: VerticesInNormalizedOrder, } @@ -114,19 +113,10 @@ impl GlobalEdge { /// The order of `vertices` is irrelevant. Two `GlobalEdge`s with the same /// `curve` and `vertices` will end up being equal, regardless of the order /// of `vertices` here. - pub fn new( - curve: impl Into>, - vertices: [Handle; 2], - ) -> Self { - let curve = curve.into(); + pub fn new(vertices: [Handle; 2]) -> Self { let (vertices, _) = VerticesInNormalizedOrder::new(vertices); - Self { curve, vertices } - } - - /// Access the curve that defines the edge's geometry - pub fn curve(&self) -> &Handle { - &self.curve + Self { vertices } } /// Access the vertices that bound the edge on the curve diff --git a/crates/fj-kernel/src/partial/objects/edge.rs b/crates/fj-kernel/src/partial/objects/edge.rs index ada1c7338..ffaece70d 100644 --- a/crates/fj-kernel/src/partial/objects/edge.rs +++ b/crates/fj-kernel/src/partial/objects/edge.rs @@ -5,8 +5,7 @@ use fj_math::Point; use crate::{ objects::{ - Curve, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Objects, - SurfaceVertex, + Curve, GlobalEdge, GlobalVertex, HalfEdge, Objects, SurfaceVertex, }, partial::{FullToPartialCache, Partial, PartialObject}, services::Service, @@ -84,7 +83,6 @@ impl Default for PartialHalfEdge { let global_form = Partial::from_partial(PartialGlobalEdge { vertices: global_vertices, - ..Default::default() }); Self { @@ -98,9 +96,6 @@ impl Default for PartialHalfEdge { /// A partial [`GlobalEdge`] #[derive(Clone, Debug, Default)] pub struct PartialGlobalEdge { - /// The curve that defines the edge's geometry - pub curve: Partial, - /// The vertices that bound the edge on the curve pub vertices: [Partial; 2], } @@ -113,7 +108,6 @@ impl PartialObject for PartialGlobalEdge { cache: &mut FullToPartialCache, ) -> Self { Self { - curve: Partial::from_full(global_edge.curve().clone(), cache), vertices: global_edge .vertices() .access_in_normalized_order() @@ -122,9 +116,7 @@ impl PartialObject for PartialGlobalEdge { } fn build(self, objects: &mut Service) -> Self::Full { - let curve = self.curve.build(objects); let vertices = self.vertices.map(|vertex| vertex.build(objects)); - - GlobalEdge::new(curve, vertices) + GlobalEdge::new(vertices) } }