use more argmin/argmax

This commit is contained in:
jan 2018-03-10 12:37:18 -08:00
commit 3b65d0b6ff

View file

@ -256,7 +256,7 @@ def reduce(poly, poly_order):
vcur = neighbors[vstart, pstart]
edge_visited[vstart, pstart] = 1
prv_edge = numpy.where(neighbors[vcur] == vstart)[0][0]
prv_edge = (neighbors[vcur] == vstart).argmin()
nxt_edge = (prv_edge + 1) % 3
edge_visited[vcur, nxt_edge] = 1
vnext = neighbors[vcur, nxt_edge]
@ -781,7 +781,7 @@ def init_brep(poly):
# Figure out index of back-reference
# and go ccw to next edge (clockwise face traversal)
np = numpy.where(neighbors[vnext] == vcur)[0][0]
np = (neighbors[vnext] == vcur).argmax()
pedge = (np + 1) % 3
vcur = vnext
@ -797,8 +797,8 @@ def init_brep(poly):
break
vstart = nv[0]
# Pick an unvisited edge
pedge = numpy.where(edge_visited[vstart] == 0)[0][0]
# Pick an unvisited edge; argmin is equivalent to looking for the first 0
pedge = edge_visited[vstart].argmin()
component_map[verts_in_component] = numpy.arange(numpy.count_nonzero(verts_in_component))
component = {