mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-10 10:09:02 +08:00
Rename 'tmp' to something a bit more meaningful.
Contributes to CURA-1512
This commit is contained in:
parent
5f0c96d4a5
commit
442b9f2af3
@ -53,8 +53,8 @@ class ConvexHullJob(Job):
|
|||||||
# This basically finds the unique rows in the array by treating them as opaque groups of bytes
|
# This basically finds the unique rows in the array by treating them as opaque groups of bytes
|
||||||
# which are as long as the 2 float64s in each row, and giving this view to numpy.unique() to munch.
|
# which are as long as the 2 float64s in each row, and giving this view to numpy.unique() to munch.
|
||||||
# See http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array
|
# See http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array
|
||||||
tmp = numpy.ascontiguousarray(vertex_data).view(numpy.dtype((numpy.void, vertex_data.dtype.itemsize * vertex_data.shape[1])))
|
vertex_byte_view = numpy.ascontiguousarray(vertex_data).view(numpy.dtype((numpy.void, vertex_data.dtype.itemsize * vertex_data.shape[1])))
|
||||||
_, idx = numpy.unique(tmp, return_index=True)
|
_, idx = numpy.unique(vertex_byte_view, return_index=True)
|
||||||
vertex_data = vertex_data[idx] # Select the unique rows by index.
|
vertex_data = vertex_data[idx] # Select the unique rows by index.
|
||||||
|
|
||||||
hull = Polygon(vertex_data)
|
hull = Polygon(vertex_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user