From 1e05acbccb11f06792da3303b0cdf7585ed67cad Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 2 Oct 2026 09:54:55 -0400 Subject: [PATCH 1/3] Added guard against n_sided build call not converging --- cadquery/occ_impl/shapes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 7eb28caca..5d377921d 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -3631,6 +3631,13 @@ def makeNSidedSurface( # build, fix and return n_sided.Build() + # Fail clearly if the solver could not converge (otherwise StdFail_NotDone is issued) + if not n_sided.IsDone(): + raise ValueError( + "makeNSidedSurface: The filling algorithm failed to converge." + "Try a larger nbPtsOnCur or degree, or a looser tol3d" + ) + face = n_sided.Shape() return Face(face).fix() From c96e8af0f29572adec83ef8169bd64d9920829a0 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 2 Oct 2026 10:03:05 -0400 Subject: [PATCH 2/3] Missed a space at the end of one of the string literals --- cadquery/occ_impl/shapes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 5d377921d..76e13e0c6 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -3634,7 +3634,7 @@ def makeNSidedSurface( # Fail clearly if the solver could not converge (otherwise StdFail_NotDone is issued) if not n_sided.IsDone(): raise ValueError( - "makeNSidedSurface: The filling algorithm failed to converge." + "makeNSidedSurface: The filling algorithm failed to converge. " "Try a larger nbPtsOnCur or degree, or a looser tol3d" ) From 3026edfe5b9dd0d46650d970e62f5c3cf2fe8216 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 2 Oct 2026 13:13:59 -0400 Subject: [PATCH 3/3] Expanded test to cover the new raise --- tests/test_cadquery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_cadquery.py b/tests/test_cadquery.py index a1de3c957..a3582d603 100644 --- a/tests/test_cadquery.py +++ b/tests/test_cadquery.py @@ -5746,6 +5746,10 @@ def test_makeNSidedSurface(self): with raises(ValueError): Face.makeNSidedSurface(outer_w, [[0, 0, 1]]) + # empty boundary so that filler reports not-done + with raises(ValueError): + Face.makeNSidedSurface([], []) + def test_toVtk(self): from vtkmodules.vtkCommonDataModel import vtkPolyData