diff --git a/crates/fj-kernel/src/algorithms/approx/edge.rs b/crates/fj-kernel/src/algorithms/approx/edge.rs index cf76001e0..15a90f065 100644 --- a/crates/fj-kernel/src/algorithms/approx/edge.rs +++ b/crates/fj-kernel/src/algorithms/approx/edge.rs @@ -14,26 +14,27 @@ impl Approx for Edge { (): Self::Params, ) -> Self::Approximation { // The range is only used for circles right now. - let range = { - let start_curve = Point::from([Scalar::ZERO]); - let end_curve = Point::from([Scalar::TAU]); - - // We're dealing with a circle here. Start and end are identical - // points, in global coordinates. - let point_global = self - .global() - .curve() - .kind() - .point_from_curve_coords(start_curve); - - RangeOnCurve { - boundary: [ - (start_curve, point_global), - (end_curve, point_global), - ], + let boundary = match self.vertices().get() { + Some(vertices) => vertices + .map(|vertex| (vertex.position(), vertex.global().position())), + None => { + let start_curve = Point::from([Scalar::ZERO]); + let end_curve = Point::from([Scalar::TAU]); + + // We're dealing with a circle here. Start and end are identical + // points, in global coordinates. + let point_global = self + .global() + .curve() + .kind() + .point_from_curve_coords(start_curve); + + [(start_curve, point_global), (end_curve, point_global)] } }; + let range = RangeOnCurve { boundary }; + self.curve().approx(tolerance, range) } }