diff --git a/chop/pyr3d.py b/chop/pyr3d.py index 3833ad5..62b5b52 100644 --- a/chop/pyr3d.py +++ b/chop/pyr3d.py @@ -49,7 +49,7 @@ def split(poly, plane, left_only: bool = False): right_inds = numpy.where(right)[0] right_inds3 = numpy.repeat(right_inds, 3) - pnbr_inds = numpy.tile(numpy.arange(3), num_right) + pnbr_inds = numpy.arange(3 * num_right) % 3 # array of [[clipped vertex (cv0), connected vertex pv00], [cv0, pv01], [cv0, pv02], [cv1, pv10], ...] # which is effectively a list of all edges which touch the right half-plane diff --git a/chop/util.py b/chop/util.py index 9e0db11..12e8888 100644 --- a/chop/util.py +++ b/chop/util.py @@ -35,7 +35,7 @@ def find_faces(neighbors): num_verts = neighbors.shape[0] edge_id = numpy.arange(3 * num_verts) - nxt_edge = numpy.tile(numpy.arange(3), num_verts) + nxt_edge = numpy.arange(num_verts * 3) % 3 vstart = edge_id // 3 vcur = vstart.copy() vnext = neighbors[vcur, nxt_edge]