mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 18:59:10 +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:
|
||||
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:
|
||||
try:
|
||||
@ -47,6 +48,10 @@ class ProcessSlicedObjectListJob(Job):
|
||||
|
||||
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))
|
||||
#inverse = node.getWorldTransformation().getInverse().getData()
|
||||
#points = points.dot(inverse)
|
||||
|
Loading…
x
Reference in New Issue
Block a user