Skip to content

Commit

Permalink
fixed clip logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kip-hart committed Jun 23, 2021
1 parent 52526d5 commit 93c817c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/microstructpy/meshing/polymesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,6 @@ def kp_loop(kp_pairs):

def _clip_cell(cell_data, domain):
domain_name = type(domain).__name__.lower()
if domain_name in ['rectangle', 'square', 'box', 'cube']:
return _tess2pyvoro(cell_data)

if domain.n_dim == 2:
# Take the portion of the cell in the z=0 plane
pts_3d = np.array(cell_data.vertices())
Expand Down Expand Up @@ -1140,9 +1137,10 @@ def _clip_cell(cell_data, domain):
}
return new_cell_data

w_str = 'Cannot clip cells to fit to a ' + domain_name + '.'
w_str = ' Currently boxes are the only suppported 3D geometries.'
warnings.warn(w_str, RuntimeWarning)
if domain_name not in ['rectangle', 'square', 'box', 'cube']:
w_str = 'Cannot clip cells to fit to a ' + domain_name + '.'
w_str = ' Currently boxes are the only suppported 3D geometries.'
warnings.warn(w_str, RuntimeWarning)
return _tess2pyvoro(cell_data)


Expand Down

0 comments on commit 93c817c

Please sign in to comment.