From 0728a06967d4ea4a2e1917d71dc5efce8a591929 Mon Sep 17 00:00:00 2001 From: Thomas Guillod Date: Mon, 20 Jan 2025 15:24:10 -0500 Subject: [PATCH] remove useless if/else --- pypeec/lib_mesher/mesher_stl.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pypeec/lib_mesher/mesher_stl.py b/pypeec/lib_mesher/mesher_stl.py index 21cbd529..2664853f 100644 --- a/pypeec/lib_mesher/mesher_stl.py +++ b/pypeec/lib_mesher/mesher_stl.py @@ -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