Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cadquery/occ_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cadquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading