Skip to content

Commit

Permalink
remove useless if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Jan 20, 2025
1 parent f02ef17 commit 0728a06
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pypeec/lib_mesher/mesher_stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,11 @@ def _get_voxelize_stl(pts, connect, mesh, thr):
# create a boolean mask
mask = selection["SelectedPoints"].view(bool)

# find the voxel indices
if np.any(mask):
# count the number of test points per voxel
count = connect * mask
# count the number of test points per voxel
count = connect * mask

# get the indices of the extracted voxels
idx_voxel = np.flatnonzero(count >= thr)
else:
idx_voxel = np.empty(0, dtype=np.int64)
# get the indices of the extracted voxels
idx_voxel = np.flatnonzero(count >= thr)

return idx_voxel

Expand Down

0 comments on commit 0728a06

Please sign in to comment.