diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 7eb28caca..76e13e0c6 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() 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