Do not round convex hull points to nearest int

This might have made sense when convex hulls were not recalculated on
transformation changes but as it is now, we want to be able to specify
0.5 as a valid point for a convex hull.

Contributes to CURA-435
This commit is contained in:
Arjen Hiemstra 2016-04-11 15:30:27 +02:00
parent cdb235740d
commit 51c4e277ae

View file

@ -40,7 +40,7 @@ class ConvexHullJob(Job):
vertex_data = mesh.getTransformed(self._node.getWorldTransformation()).getVertices() vertex_data = mesh.getTransformed(self._node.getWorldTransformation()).getVertices()
# Don't use data below 0. TODO; We need a better check for this as this gives poor results for meshes with long edges. # Don't use data below 0. TODO; We need a better check for this as this gives poor results for meshes with long edges.
vertex_data = vertex_data[vertex_data[:,1] >= 0] vertex_data = vertex_data[vertex_data[:,1] >= 0]
hull = Polygon(numpy.rint(vertex_data[:, [0, 2]]).astype(int)) hull = Polygon(vertex_data[:, [0, 2]])
# First, calculate the normal convex hull around the points # First, calculate the normal convex hull around the points
hull = hull.getConvexHull() hull = hull.getConvexHull()