From 80617627c15406a548db1c981db5e22059ad6a72 Mon Sep 17 00:00:00 2001 From: asp <128797936+ASP-SuperExplorer@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:28:26 +0800 Subject: [PATCH 1/2] Fix parametricCurve default smoothing --- cadquery/cq.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 8d5a4cd25..67493021f 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -1945,7 +1945,7 @@ def parametricCurve( tol: float = 1e-6, minDeg: int = 1, maxDeg: int = 6, - smoothing: Optional[Tuple[float, float, float]] = (1, 1, 1), + smoothing: Optional[Tuple[float, float, float]] = None, makeWire: bool = True, ) -> T: """ @@ -1959,7 +1959,7 @@ def parametricCurve( :param tol: tolerance of the algorithm (default: 1e-6) :param minDeg: minimum spline degree (default: 1) :param maxDeg: maximum spline degree (default: 6) - :param smoothing: optional parameters for the variational smoothing algorithm (default: (1,1,1)) + :param smoothing: optional parameters for the variational smoothing algorithm (default: None) :param makeWire: convert the resulting spline edge to a wire :return: a Workplane object with the current point unchanged From 252c4f7fbeca47465507b27e5f5f32ceab640294 Mon Sep 17 00:00:00 2001 From: asp <128797936+ASP-SuperExplorer@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:28:35 +0800 Subject: [PATCH 2/2] Add regression test for parametric helix --- tests/test_cadquery.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_cadquery.py b/tests/test_cadquery.py index a1de3c957..f90af3861 100644 --- a/tests/test_cadquery.py +++ b/tests/test_cadquery.py @@ -3996,6 +3996,24 @@ def testParametricCurve(self): self.assertEqual(len(res_edge.ctx.pendingEdges), 1) self.assertEqual(len(res_edge.ctx.pendingWires), 0) + def testParametricCurveHelixIntegerTurns(self): + def func(t): + return ( + math.cos(t * math.pi * 2), + math.sin(t * math.pi * 2), + t, + ) + + res = Workplane("XY").parametricCurve(func, stop=4) + edge = res.val().Edges()[0] + points = [edge.positionAt(i / 50) for i in range(51)] + radii = [math.sqrt(p.x**2 + p.y**2) for p in points] + + self.assertAlmostEqual(edge.startPoint().x, 1, 6) + self.assertAlmostEqual(edge.endPoint().x, 1, 6) + self.assertAlmostEqual(edge.endPoint().z, 4, 6) + self.assertLess(max(abs(r - 1) for r in radii), 1e-4) + def testMakeShellSolid(self): c0 = math.sqrt(2) / 4