diff --git a/geometry.scad b/geometry.scad index 37326e1..2ee3b7e 100644 --- a/geometry.scad +++ b/geometry.scad @@ -253,8 +253,8 @@ function line_intersection(line1, line2, bounded1, bounded2, bounded, eps=EPSILO // pt = line_closest_point(line, pt, [bounded]); // Topics: Geometry, Lines, Distance // Description: -// Returns the point on the given 2D or 3D line, segment or ray that is closest to the given point `pt`. -// The inputs `line` and `pt` args should either both be 2D or both 3D. The parameter bounded indicates +// Returns the point on the given line, segment or ray that is closest to the given point `pt`. +// The inputs `line` and `pt` args should be of the same dimension. The parameter bounded indicates // whether the points of `line` should be treated as endpoints. // Arguments: // line = A list of two points that are on the unbounded line. diff --git a/paths.scad b/paths.scad index 9b41982..a13612a 100644 --- a/paths.scad +++ b/paths.scad @@ -523,8 +523,8 @@ function is_path_simple(path, closed, eps=EPSILON) = // Finds the closest path segment, and point on that segment to the given point. // Returns `[SEGNUM, POINT]` // Arguments: -// path = The path to find the closest point on. -// pt = the point to find the closest point to. +// path = path of any dimension or a 1-region +// pt = the point to find the closest point to // closed = // Example(2D): // path = circle(d=100,$fn=6); @@ -535,7 +535,7 @@ function is_path_simple(path, closed, eps=EPSILON) = // color("red") translate(closest[1]) circle(d=3, $fn=12); function path_closest_point(path, pt, closed=true) = let(path = force_path(path)) - assert(is_path(path,[2,3]), "Must give 2D or 3D path.") + assert(is_path(path), "Input must be a path") assert(is_vector(pt, len(path[0])), "Input pt must be a compatible vector") assert(is_bool(closed)) let(