From 2a5c9555abb69d07d741bc6f0250baa7dc53200c Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Fri, 7 Feb 2025 17:47:06 -0500 Subject: [PATCH] nurbs bugfix singleton point evaluation --- nurbs.scad | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nurbs.scad b/nurbs.scad index 4852256d..5178dae7 100644 --- a/nurbs.scad +++ b/nurbs.scad @@ -19,7 +19,7 @@ include // Section: NURBS Curves // Function: nurbs_curve() -// Synopsis: Computes one more more points on a NURBS curve. +// Synopsis: Computes one or more points on a NURBS curve. // SynTags: Path // Topics: NURBS Curves // See Also: debug_nurbs() @@ -174,8 +174,8 @@ include function nurbs_curve(control,degree,splinesteps,u, mult,weights,type="clamped",knots) = assert(num_defined([splinesteps,u])==1, "Must define exactly one of u and splinesteps") - is_finite(u) ? nurbs_curve(control,degree,[u],mult,weights,type=type)[0] - : assert(is_undef(splinesteps) || (is_int(splinesteps) || splinesteps>0), "splinesteps must be a positive integer") + is_finite(u) ? nurbs_curve(control,degree,u=[u],mult,weights,type=type)[0] + : assert(is_undef(splinesteps) || (is_int(splinesteps) && splinesteps>0), "splinesteps must be a positive integer") let(u=is_range(u) ? list(u) : u) assert(is_undef(u) || (is_vector(u) && min(u)>=0 && max(u)<=1), "u must be a list of points on the interval [0,1] or a range contained in that interval") is_def(weights) ? assert(is_vector(weights, len(control)), "Weights should be a vector whose length is the number of control points")