mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:59:00 +08:00
Translate the received polygons from the engine to use 0,0 as center
This commit is contained in:
parent
52868ec01e
commit
b9f99a3c56
@ -26,7 +26,8 @@ class ProcessSlicedObjectListJob(Job):
|
|||||||
else:
|
else:
|
||||||
objectIdMap[id(node)] = node
|
objectIdMap[id(node)] = node
|
||||||
|
|
||||||
layerHeight = Application.getInstance().getActiveMachine().getSettingValueByKey('layer_height')
|
settings = Application.getInstance().getActiveMachine()
|
||||||
|
layerHeight = settings.getSettingValueByKey('layer_height')
|
||||||
|
|
||||||
for object in self._message.objects:
|
for object in self._message.objects:
|
||||||
try:
|
try:
|
||||||
@ -47,6 +48,10 @@ class ProcessSlicedObjectListJob(Job):
|
|||||||
|
|
||||||
points[:,2] *= -1
|
points[:,2] *= -1
|
||||||
|
|
||||||
|
if not settings.getSettingValueByKey('machine_center_is_zero'):
|
||||||
|
center = [settings.getSettingValueByKey('machine_width') / 2, 0.0, -settings.getSettingValueByKey('machine_depth') / 2]
|
||||||
|
points -= numpy.array(center)
|
||||||
|
|
||||||
#points = numpy.pad(points, ((0,0), (0,1)), 'constant', constant_values=(0.0, 1.0))
|
#points = numpy.pad(points, ((0,0), (0,1)), 'constant', constant_values=(0.0, 1.0))
|
||||||
#inverse = node.getWorldTransformation().getInverse().getData()
|
#inverse = node.getWorldTransformation().getInverse().getData()
|
||||||
#points = points.dot(inverse)
|
#points = points.dot(inverse)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user