From dd82169466033d8e39e7dcc6eaf7f619acd4c867 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 15:26:40 +0200 Subject: [PATCH 01/11] Re-exports all builders --- crates/fj-kernel/src/topology/edges.rs | 2 +- crates/fj-kernel/src/topology/faces.rs | 2 +- crates/fj-kernel/src/topology/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index f6906b96e..6686b397e 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -5,7 +5,7 @@ use crate::{ shape::{Handle, Shape}, }; -use super::{builder::CycleBuilder, vertices::Vertex, EdgeBuilder}; +use super::{vertices::Vertex, CycleBuilder, EdgeBuilder}; /// A cycle of connected edges /// diff --git a/crates/fj-kernel/src/topology/faces.rs b/crates/fj-kernel/src/topology/faces.rs index bacbdcb7d..598b79da6 100644 --- a/crates/fj-kernel/src/topology/faces.rs +++ b/crates/fj-kernel/src/topology/faces.rs @@ -8,7 +8,7 @@ use crate::{ shape::{Handle, Shape}, }; -use super::{builder::FaceBuilder, edges::Cycle}; +use super::{edges::Cycle, FaceBuilder}; /// A face of a shape /// diff --git a/crates/fj-kernel/src/topology/mod.rs b/crates/fj-kernel/src/topology/mod.rs index c7b29905f..e29361c45 100644 --- a/crates/fj-kernel/src/topology/mod.rs +++ b/crates/fj-kernel/src/topology/mod.rs @@ -22,7 +22,7 @@ mod faces; mod vertices; pub use self::{ - builder::{EdgeBuilder, VertexBuilder}, + builder::{CycleBuilder, EdgeBuilder, FaceBuilder, VertexBuilder}, edges::{Cycle, Edge}, faces::Face, vertices::Vertex, From 2760fc75c4741ef6a4e110bc75cc114c07509741 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 15:29:04 +0200 Subject: [PATCH 02/11] Simplify `use` statement --- crates/fj-kernel/src/topology/faces.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/topology/faces.rs b/crates/fj-kernel/src/topology/faces.rs index 598b79da6..74aceaf03 100644 --- a/crates/fj-kernel/src/topology/faces.rs +++ b/crates/fj-kernel/src/topology/faces.rs @@ -8,7 +8,7 @@ use crate::{ shape::{Handle, Shape}, }; -use super::{edges::Cycle, FaceBuilder}; +use super::{Cycle, FaceBuilder}; /// A face of a shape /// From ebf32471c7cb1b3ffd88670d730154845e3bcb65 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 15:29:55 +0200 Subject: [PATCH 03/11] Move `Cycle` to dedicated module --- crates/fj-kernel/src/topology/cycles.rs | 55 +++++++++++++++++++++++++ crates/fj-kernel/src/topology/edges.rs | 52 +---------------------- crates/fj-kernel/src/topology/mod.rs | 4 +- 3 files changed, 59 insertions(+), 52 deletions(-) create mode 100644 crates/fj-kernel/src/topology/cycles.rs diff --git a/crates/fj-kernel/src/topology/cycles.rs b/crates/fj-kernel/src/topology/cycles.rs new file mode 100644 index 000000000..1373815ed --- /dev/null +++ b/crates/fj-kernel/src/topology/cycles.rs @@ -0,0 +1,55 @@ +use std::hash::{Hash, Hasher}; + +use crate::shape::{Handle, Shape}; + +use super::{CycleBuilder, Edge}; + +/// A cycle of connected edges +/// +/// The end of each edge in the cycle must connect to the beginning of the next +/// edge. The end of the last edge must connect to the beginning of the first +/// one. +/// +/// # Equality +/// +/// Please refer to [`crate::kernel::topology`] for documentation on the +/// equality of topological objects. +/// +/// # Validation +/// +/// A cycle that is part of a [`Shape`] must be structurally sound. That means +/// the edges it refers to, must be part of the same shape. +#[derive(Clone, Debug, Eq, Ord, PartialOrd)] +pub struct Cycle { + /// The edges that make up the cycle + pub edges: Vec>, +} + +impl Cycle { + /// Build a cycle using the [`CycleBuilder`] API + pub fn builder(shape: &mut Shape) -> CycleBuilder { + CycleBuilder::new(shape) + } + + /// Access the edges that this cycle refers to + /// + /// This is a convenience method that saves the caller from dealing with the + /// [`Handle`]s. + pub fn edges(&self) -> impl Iterator + '_ { + self.edges.iter().map(|handle| handle.get()) + } +} + +impl PartialEq for Cycle { + fn eq(&self, other: &Self) -> bool { + self.edges().eq(other.edges()) + } +} + +impl Hash for Cycle { + fn hash(&self, state: &mut H) { + for edge in self.edges() { + edge.hash(state); + } + } +} diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index 6686b397e..3ada9dbd2 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -5,57 +5,7 @@ use crate::{ shape::{Handle, Shape}, }; -use super::{vertices::Vertex, CycleBuilder, EdgeBuilder}; - -/// A cycle of connected edges -/// -/// The end of each edge in the cycle must connect to the beginning of the next -/// edge. The end of the last edge must connect to the beginning of the first -/// one. -/// -/// # Equality -/// -/// Please refer to [`crate::kernel::topology`] for documentation on the -/// equality of topological objects. -/// -/// # Validation -/// -/// A cycle that is part of a [`Shape`] must be structurally sound. That means -/// the edges it refers to, must be part of the same shape. -#[derive(Clone, Debug, Eq, Ord, PartialOrd)] -pub struct Cycle { - /// The edges that make up the cycle - pub edges: Vec>, -} - -impl Cycle { - /// Build a cycle using the [`CycleBuilder`] API - pub fn builder(shape: &mut Shape) -> CycleBuilder { - CycleBuilder::new(shape) - } - - /// Access the edges that this cycle refers to - /// - /// This is a convenience method that saves the caller from dealing with the - /// [`Handle`]s. - pub fn edges(&self) -> impl Iterator + '_ { - self.edges.iter().map(|handle| handle.get()) - } -} - -impl PartialEq for Cycle { - fn eq(&self, other: &Self) -> bool { - self.edges().eq(other.edges()) - } -} - -impl Hash for Cycle { - fn hash(&self, state: &mut H) { - for edge in self.edges() { - edge.hash(state); - } - } -} +use super::{vertices::Vertex, EdgeBuilder}; /// An edge of a shape /// diff --git a/crates/fj-kernel/src/topology/mod.rs b/crates/fj-kernel/src/topology/mod.rs index e29361c45..108570065 100644 --- a/crates/fj-kernel/src/topology/mod.rs +++ b/crates/fj-kernel/src/topology/mod.rs @@ -17,13 +17,15 @@ //! refer to objects in the same memory location. mod builder; +mod cycles; mod edges; mod faces; mod vertices; pub use self::{ builder::{CycleBuilder, EdgeBuilder, FaceBuilder, VertexBuilder}, - edges::{Cycle, Edge}, + cycles::Cycle, + edges::Edge, faces::Face, vertices::Vertex, }; From c1a5b0ee54be1e3945dc4c4a5a08e99b6f7fde73 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 15:32:24 +0200 Subject: [PATCH 04/11] Add type `EdgeVertex` --- crates/fj-kernel/src/topology/edges.rs | 5 ++++- crates/fj-kernel/src/topology/mod.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index 3ada9dbd2..f8aadf0db 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -42,7 +42,7 @@ pub struct Edge { /// It got in the way of some work, however, so it made sense to simplify /// it by storing 3D vertices. It will probably make sense to revert this /// and store 1D vertices again, at some point. - pub vertices: Option<[Handle; 2]>, + pub vertices: Option<[EdgeVertex; 2]>, } impl Edge { @@ -80,3 +80,6 @@ impl Hash for Edge { self.vertices().hash(state); } } + +/// A vertex of an edge +pub type EdgeVertex = Handle; diff --git a/crates/fj-kernel/src/topology/mod.rs b/crates/fj-kernel/src/topology/mod.rs index 108570065..02c835531 100644 --- a/crates/fj-kernel/src/topology/mod.rs +++ b/crates/fj-kernel/src/topology/mod.rs @@ -25,7 +25,7 @@ mod vertices; pub use self::{ builder::{CycleBuilder, EdgeBuilder, FaceBuilder, VertexBuilder}, cycles::Cycle, - edges::Edge, + edges::{Edge, EdgeVertex}, faces::Face, vertices::Vertex, }; From 98b3387b967114f0475ffc7b215f5d7ca8afe14d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 15:43:24 +0200 Subject: [PATCH 05/11] Add `Edge::new` --- crates/fj-kernel/src/topology/edges.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index f8aadf0db..c22c8d3f1 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -46,6 +46,14 @@ pub struct Edge { } impl Edge { + /// Construct an instance of `Edge` + pub fn new( + curve: Handle, + vertices: Option<[Handle; 2]>, + ) -> Self { + Self { curve, vertices } + } + /// Build an edge using the [`EdgeBuilder`] API pub fn builder(shape: &mut Shape) -> EdgeBuilder { EdgeBuilder::new(shape) From 2a9af3982ec975620d482e6b7bebb9306db03ea2 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 16:00:37 +0200 Subject: [PATCH 06/11] Refactor --- crates/fj-operations/src/group.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/fj-operations/src/group.rs b/crates/fj-operations/src/group.rs index 3d3f37055..b7c656628 100644 --- a/crates/fj-operations/src/group.rs +++ b/crates/fj-operations/src/group.rs @@ -66,14 +66,14 @@ fn copy_shape(orig: Shape, target: &mut Shape) { vertices.insert(vertex_orig, vertex); } for edge_orig in orig.edges() { - let edge = target - .insert(Edge { - curve: curves[&edge_orig.get().curve].clone(), - vertices: edge_orig.get().vertices.as_ref().map(|vs| { - vs.clone().map(|vertex| vertices[&vertex].clone()) - }), - }) - .unwrap(); + let curve = curves[&edge_orig.get().curve].clone(); + let vertices = edge_orig + .get() + .vertices + .as_ref() + .map(|vs| vs.clone().map(|vertex| vertices[&vertex].clone())); + + let edge = target.insert(Edge { curve, vertices }).unwrap(); edges.insert(edge_orig, edge); } for cycle_orig in orig.cycles() { From 439d56e1eea1362ba9a01d674b9fa4517d3dca0d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 16:01:17 +0200 Subject: [PATCH 07/11] Make use of `Edge::new` --- crates/fj-kernel/src/algorithms/sweep.rs | 22 ++++++---------------- crates/fj-kernel/src/shape/api.rs | 10 ++-------- crates/fj-kernel/src/topology/builder.rs | 5 +---- crates/fj-operations/src/difference_2d.rs | 2 +- crates/fj-operations/src/group.rs | 2 +- 5 files changed, 11 insertions(+), 30 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 8eadca5f0..9c539116d 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -53,17 +53,10 @@ pub fn sweep_shape( let vertices_top = source_to_top.vertices_for_edge(&edge_source); let edge_bottom = target - .insert(Edge { - curve: curve_bottom, - vertices: vertices_bottom, - }) - .unwrap(); - let edge_top = target - .insert(Edge { - curve: curve_top, - vertices: vertices_top, - }) + .insert(Edge::new(curve_bottom, vertices_bottom)) .unwrap(); + let edge_top = + target.insert(Edge::new(curve_top, vertices_top)).unwrap(); source_to_bottom .edges @@ -193,13 +186,10 @@ pub fn sweep_shape( .clone(); target - .insert(Edge { + .insert(Edge::new( curve, - vertices: Some([ - vertex_bottom, - vertex_top, - ]), - }) + Some([vertex_bottom, vertex_top]), + )) .unwrap() }) .clone() diff --git a/crates/fj-kernel/src/shape/api.rs b/crates/fj-kernel/src/shape/api.rs index 4c3e9e7e3..77d5a1f62 100644 --- a/crates/fj-kernel/src/shape/api.rs +++ b/crates/fj-kernel/src/shape/api.rs @@ -301,10 +301,7 @@ mod tests { // Shouldn't work. Nothing has been added to `shape`. let err = shape - .insert(Edge { - curve: curve.clone(), - vertices: Some([a.clone(), b.clone()]), - }) + .insert(Edge::new(curve.clone(), Some([a.clone(), b.clone()]))) .unwrap_err(); assert!(err.missing_curve(&curve)); assert!(err.missing_vertex(&a)); @@ -315,10 +312,7 @@ mod tests { let b = Vertex::builder(&mut shape).build_from_point([2., 0., 0.])?; // Everything has been added to `shape` now. Should work! - shape.insert(Edge { - curve, - vertices: Some([a, b]), - })?; + shape.insert(Edge::new(curve, Some([a, b])))?; Ok(()) } diff --git a/crates/fj-kernel/src/topology/builder.rs b/crates/fj-kernel/src/topology/builder.rs index 66c72fb12..bb763a61f 100644 --- a/crates/fj-kernel/src/topology/builder.rs +++ b/crates/fj-kernel/src/topology/builder.rs @@ -88,10 +88,7 @@ impl<'r> EdgeBuilder<'r> { let curve = self.shape.insert(Curve::Line(Line::from_points( vertices.clone().map(|vertex| vertex.get().point()), )))?; - let edge = self.shape.insert(Edge { - curve, - vertices: Some(vertices), - })?; + let edge = self.shape.insert(Edge::new(curve, Some(vertices)))?; Ok(edge) } diff --git a/crates/fj-operations/src/difference_2d.rs b/crates/fj-operations/src/difference_2d.rs index 69d8438a0..1c5587d0a 100644 --- a/crates/fj-operations/src/difference_2d.rs +++ b/crates/fj-operations/src/difference_2d.rs @@ -121,7 +121,7 @@ fn add_cycle( vs }); - let edge = shape.insert(Edge { curve, vertices }).unwrap(); + let edge = shape.insert(Edge::new(curve, vertices)).unwrap(); edges.push(edge); } diff --git a/crates/fj-operations/src/group.rs b/crates/fj-operations/src/group.rs index b7c656628..30b785944 100644 --- a/crates/fj-operations/src/group.rs +++ b/crates/fj-operations/src/group.rs @@ -73,7 +73,7 @@ fn copy_shape(orig: Shape, target: &mut Shape) { .as_ref() .map(|vs| vs.clone().map(|vertex| vertices[&vertex].clone())); - let edge = target.insert(Edge { curve, vertices }).unwrap(); + let edge = target.insert(Edge::new(curve, vertices)).unwrap(); edges.insert(edge_orig, edge); } for cycle_orig in orig.cycles() { From c5250b27de736b6cb8f0d8bc02c905a8a9b6f6aa Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 16:02:51 +0200 Subject: [PATCH 08/11] Convert `EdgeVertex` into struct --- crates/fj-kernel/src/algorithms/sweep.rs | 8 +++++--- crates/fj-kernel/src/shape/validate.rs | 4 ++-- crates/fj-kernel/src/topology/edges.rs | 13 +++++++++++-- crates/fj-operations/src/group.rs | 8 +++----- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 9c539116d..97d99d0cc 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -168,7 +168,7 @@ pub fn sweep_shape( vertices_source.map(|vertex_source| { let vertex_bottom = source_to_bottom .vertices - .get(&vertex_source) + .get(&vertex_source.handle) .unwrap() .clone(); @@ -181,7 +181,7 @@ pub fn sweep_shape( let vertex_top = source_to_top .vertices - .get(&vertex_source) + .get(&vertex_source.handle) .unwrap() .clone(); @@ -256,7 +256,9 @@ impl Relation { edge: &Handle, ) -> Option<[Handle; 2]> { edge.get().vertices.map(|vertices| { - vertices.map(|vertex| self.vertices.get(&vertex).unwrap().clone()) + vertices.map(|vertex| { + self.vertices.get(&vertex.handle).unwrap().clone() + }) }) } diff --git a/crates/fj-kernel/src/shape/validate.rs b/crates/fj-kernel/src/shape/validate.rs index 1a119f654..2fba423f5 100644 --- a/crates/fj-kernel/src/shape/validate.rs +++ b/crates/fj-kernel/src/shape/validate.rs @@ -76,8 +76,8 @@ impl Validate for Edge { } for vertices in &self.vertices { for vertex in vertices { - if !stores.vertices.contains(vertex) { - missing_vertices.insert(vertex.clone()); + if !stores.vertices.contains(&vertex.handle) { + missing_vertices.insert(vertex.handle.clone()); } } } diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index c22c8d3f1..93bd6a3a4 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -51,6 +51,9 @@ impl Edge { curve: Handle, vertices: Option<[Handle; 2]>, ) -> Self { + let vertices = vertices + .map(|vertices| vertices.map(|handle| EdgeVertex { handle })); + Self { curve, vertices } } @@ -72,7 +75,9 @@ impl Edge { /// This is a convenience method that saves the caller from dealing with the /// [`Handle`]s. pub fn vertices(&self) -> Option<[Vertex; 2]> { - self.vertices.as_ref().map(|[a, b]| [a.get(), b.get()]) + self.vertices + .as_ref() + .map(|[a, b]| [a.handle.get(), b.handle.get()]) } } @@ -90,4 +95,8 @@ impl Hash for Edge { } /// A vertex of an edge -pub type EdgeVertex = Handle; +#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +pub struct EdgeVertex { + /// The handle to the vertex + pub handle: Handle, +} diff --git a/crates/fj-operations/src/group.rs b/crates/fj-operations/src/group.rs index 30b785944..27207032e 100644 --- a/crates/fj-operations/src/group.rs +++ b/crates/fj-operations/src/group.rs @@ -67,11 +67,9 @@ fn copy_shape(orig: Shape, target: &mut Shape) { } for edge_orig in orig.edges() { let curve = curves[&edge_orig.get().curve].clone(); - let vertices = edge_orig - .get() - .vertices - .as_ref() - .map(|vs| vs.clone().map(|vertex| vertices[&vertex].clone())); + let vertices = edge_orig.get().vertices.as_ref().map(|vs| { + vs.clone().map(|vertex| vertices[&vertex.handle].clone()) + }); let edge = target.insert(Edge::new(curve, vertices)).unwrap(); edges.insert(edge_orig, edge); From 7b180ce95cd86416dff91d818e6e3f6281f78ddf Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 16:08:38 +0200 Subject: [PATCH 09/11] Return `geometry::Point` from curve coord conv --- crates/fj-kernel/src/geometry/curves/mod.rs | 16 +++++++++++----- crates/fj-kernel/src/geometry/surfaces/swept.rs | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/fj-kernel/src/geometry/curves/mod.rs b/crates/fj-kernel/src/geometry/curves/mod.rs index 9c7c34d51..ec2925092 100644 --- a/crates/fj-kernel/src/geometry/curves/mod.rs +++ b/crates/fj-kernel/src/geometry/curves/mod.rs @@ -4,6 +4,8 @@ pub use self::circle::Circle; use fj_math::{Line, Point, Transform, Vector}; +use crate::geometry; + /// A one-dimensional shape /// /// The word "curve" is used as an umbrella term for all one-dimensional shapes, @@ -85,11 +87,15 @@ impl Curve { pub fn point_to_curve_coords( &self, point: impl Into>, - ) -> Point<1> { - match self { - Self::Circle(curve) => curve.point_to_circle_coords(point), - Self::Line(curve) => curve.point_to_line_coords(point), - } + ) -> geometry::Point<1> { + let point_3d = point.into(); + + let point_1d = match self { + Self::Circle(curve) => curve.point_to_circle_coords(point_3d), + Self::Line(curve) => curve.point_to_line_coords(point_3d), + }; + + geometry::Point::new(point_1d, point_3d) } /// Convert a point on the curve into model coordinates diff --git a/crates/fj-kernel/src/geometry/surfaces/swept.rs b/crates/fj-kernel/src/geometry/surfaces/swept.rs index 16fd4987a..f68206734 100644 --- a/crates/fj-kernel/src/geometry/surfaces/swept.rs +++ b/crates/fj-kernel/src/geometry/surfaces/swept.rs @@ -44,7 +44,7 @@ impl SweptCurve { ) -> Point<2> { let point = point.into(); - let u = self.curve.point_to_curve_coords(point).t; + let u = self.curve.point_to_curve_coords(point).native().t; let v = self.path_to_line().point_to_line_coords(point).t; Point::from([u, v]) From 1e9a14997b7ba4230d37524ee29cb14cf70ba96c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 16:09:32 +0200 Subject: [PATCH 10/11] Store local representation in `EdgeVertex` --- crates/fj-kernel/src/topology/edges.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index 93bd6a3a4..a2d7cabe2 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -1,7 +1,7 @@ use std::hash::{Hash, Hasher}; use crate::{ - geometry::Curve, + geometry::{self, Curve}, shape::{Handle, Shape}, }; @@ -51,8 +51,13 @@ impl Edge { curve: Handle, vertices: Option<[Handle; 2]>, ) -> Self { - let vertices = vertices - .map(|vertices| vertices.map(|handle| EdgeVertex { handle })); + let vertices = vertices.map(|vertices| { + vertices.map(|handle| { + let local = + curve.get().point_to_curve_coords(handle.get().point()); + EdgeVertex { handle, local } + }) + }); Self { curve, vertices } } @@ -99,4 +104,9 @@ impl Hash for Edge { pub struct EdgeVertex { /// The handle to the vertex pub handle: Handle, + + /// The local representation of the vertex + /// + /// Represents the vertex in terms of the coordinates of the edge's curve. + pub local: geometry::Point<1>, } From bae0d01ca006a575564d2ea2a95f5aace7731fe3 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 12 May 2022 16:13:57 +0200 Subject: [PATCH 11/11] Remove obsolete implementation note --- crates/fj-kernel/src/topology/edges.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/crates/fj-kernel/src/topology/edges.rs b/crates/fj-kernel/src/topology/edges.rs index a2d7cabe2..5c471da1b 100644 --- a/crates/fj-kernel/src/topology/edges.rs +++ b/crates/fj-kernel/src/topology/edges.rs @@ -32,16 +32,6 @@ pub struct Edge { /// /// If there are no such vertices, that means that both the curve and the /// edge are continuous (i.e. connected to themselves). - /// - /// # Implementation note - /// - /// Since these vertices bound the edge, they must lie on the curve. This - /// isn't enforced at all, however. It would make sense to store 1D vertices - /// here, and indeed, this was the case in the past. - /// - /// It got in the way of some work, however, so it made sense to simplify - /// it by storing 3D vertices. It will probably make sense to revert this - /// and store 1D vertices again, at some point. pub vertices: Option<[EdgeVertex; 2]>, }