Skip to content

Commit

Permalink
catching and improving warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsellan committed Oct 19, 2023
1 parent 33ea1d7 commit e15bad0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gpytoolbox/remesh_botsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def remesh_botsch(V, F, i=10, h=None, project=True, feature=np.array([], dtype=i

# check that at least one vertex is not a boundary vertex
if feature.shape[0] == V.shape[0]:
warnings.warn("All vertices are detected as boundary vertices. The result will be the input mesh.")
warnings.warn("All vertices in the input mesh are either manually specified feature vertices or boundary vertices, meaning that this call to remesh_botsch will be a no-op.")

v, f = _remesh_botsch_cpp_impl(V, F.astype(np.int32), i, h, feature, project)

Expand Down
10 changes: 7 additions & 3 deletions src/gpytoolbox/sdf_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,13 @@ def remesh(V, F, i=10, h=None, project=True, feature=np.array([], dtype=int)):
i=i, h=h,
project=project, feature=feature)
elif dim==3:
V,F = remesh_botsch(V, F,
i=i, h=h,
project=project, feature=feature)
if V.shape[0]==len(feature):
# then the call to remesh_botsch is a no-op, because our flow has converged (active region is empty)
V,F = V.copy(), F.copy()
else:
V,F = remesh_botsch(V, F,
i=i, h=h,
project=project, feature=feature)
assert np.isfinite(V).all()
return V,F

Expand Down

0 comments on commit e15bad0

Please sign in to comment.