mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Translate the received polygons from the engine to use 0,0 as center
This commit is contained in:
parent
52868ec01e
commit
b9f99a3c56
1 changed files with 6 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue