diff --git a/crates/fj-kernel/src/algorithms/approx/edge.rs b/crates/fj-kernel/src/algorithms/approx/edge.rs index 63bbca52e..4e8b1e52d 100644 --- a/crates/fj-kernel/src/algorithms/approx/edge.rs +++ b/crates/fj-kernel/src/algorithms/approx/edge.rs @@ -23,7 +23,8 @@ impl Approx for &HalfEdge { cache: &mut Self::Cache, ) -> Self::Approximation { let &[a, b] = self.vertices(); - let range = RangeOnPath::new([a, b].map(|vertex| vertex.position())); + let boundary = [a, b].map(|vertex| vertex.position()); + let range = RangeOnPath { boundary }; let first = ApproxPoint::new( a.surface_form().position(), diff --git a/crates/fj-kernel/src/algorithms/approx/path.rs b/crates/fj-kernel/src/algorithms/approx/path.rs index 15df4bb18..ef704642a 100644 --- a/crates/fj-kernel/src/algorithms/approx/path.rs +++ b/crates/fj-kernel/src/algorithms/approx/path.rs @@ -59,33 +59,8 @@ impl Approx for (GlobalPath, RangeOnPath) { /// The range on which a path should be approximated #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] pub struct RangeOnPath { - boundary: [Point<1>; 2], -} - -impl RangeOnPath { - /// Construct an instance of `RangeOnCurve` - /// - /// Ranges are normalized on construction, meaning that the order of - /// vertices passed to this constructor does not influence the range that is - /// constructed. - /// - /// This is done to prevent bugs during mesh construction: The curve - /// approximation code is regularly faced with ranges that are reversed - /// versions of each other. This can lead to slightly different - /// approximations, which in turn leads to the aforementioned invalid - /// meshes. - /// - /// The caller can use `is_reversed` to determine, if the range was reversed - /// during normalization, to adjust the approximation accordingly. - pub fn new(boundary: [impl Into>; 2]) -> Self { - let boundary = boundary.map(Into::into); - Self { boundary } - } - - /// Access the boundary of the range - pub fn boundary(&self) -> [Point<1>; 2] { - self.boundary - } + /// The boundary of the range + pub boundary: [Point<1>; 2], } impl From<[T; 2]> for RangeOnPath @@ -93,7 +68,8 @@ where T: Into>, { fn from(boundary: [T; 2]) -> Self { - Self::new(boundary) + let boundary = boundary.map(Into::into); + Self { boundary } } }