diff --git a/crates/fj-core/src/algorithms/approx/path.rs b/crates/fj-core/src/algorithms/approx/path.rs index 827a00ff8..8838d73b5 100644 --- a/crates/fj-core/src/algorithms/approx/path.rs +++ b/crates/fj-core/src/algorithms/approx/path.rs @@ -30,7 +30,7 @@ use std::iter; -use fj_math::{Circle, Point, Scalar, Sign}; +use fj_math::{Circle, Line, Point, Scalar, Sign}; use crate::geometry::{CurveBoundary, Geometry, GlobalPath, SurfacePath}; @@ -52,7 +52,7 @@ impl Approx for (&SurfacePath, CurveBoundary>) { SurfacePath::Circle(circle) => { approx_circle(circle, range, tolerance.into()) } - SurfacePath::Line(_) => vec![], + SurfacePath::Line(line) => approx_line(line), } } } @@ -73,7 +73,7 @@ impl Approx for (GlobalPath, CurveBoundary>) { GlobalPath::Circle(circle) => { approx_circle(&circle, range, tolerance.into()) } - GlobalPath::Line(_) => vec![], + GlobalPath::Line(line) => approx_line(&line), } } } @@ -100,6 +100,20 @@ fn approx_circle( points } +/// Approximate a line +/// +/// Since path approximation don't include the end points of the approximation +/// boundary, and a line does not require any other points to be fully defined, +/// this method always returns no points. +/// +/// The method still exists, to make the code that approximates lines easy to +/// find for anyone reading this module, as well as to provide a place to +/// document this fact about line approximations. +fn approx_line(line: &Line) -> Vec<(Point<1>, Point)> { + let _ = line; + Vec::new() +} + struct PathApproxParams { increment: Scalar, }