mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Style: Use "" for strings not ''
This commit is contained in:
parent
7cc493ad91
commit
0a6562a8f1
24 changed files with 242 additions and 240 deletions
|
@ -11,7 +11,7 @@ import struct
|
|||
|
||||
class ProcessSlicedObjectListJob(Job):
|
||||
def __init__(self, message):
|
||||
super().__init__(description = 'Processing sliced object')
|
||||
super().__init__()
|
||||
self._message = message
|
||||
self._scene = Application.getInstance().getController().getScene()
|
||||
|
||||
|
@ -27,7 +27,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
objectIdMap[id(node)] = node
|
||||
|
||||
settings = Application.getInstance().getActiveMachine()
|
||||
layerHeight = settings.getSettingValueByKey('layer_height')
|
||||
layerHeight = settings.getSettingValueByKey("layer_height")
|
||||
|
||||
for object in self._message.objects:
|
||||
try:
|
||||
|
@ -40,7 +40,7 @@ class ProcessSlicedObjectListJob(Job):
|
|||
layerData = LayerData.LayerData()
|
||||
for layer in object.layers:
|
||||
for polygon in layer.polygons:
|
||||
points = numpy.fromstring(polygon.points, dtype='i8') # Convert bytearray to numpy array
|
||||
points = numpy.fromstring(polygon.points, dtype="i8") # Convert bytearray to numpy array
|
||||
points = points.reshape((-1,2)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly.
|
||||
points = numpy.asarray(points, dtype=numpy.float32)
|
||||
points /= 1000
|
||||
|
@ -48,11 +48,11 @@ 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]
|
||||
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()
|
||||
#points = points.dot(inverse)
|
||||
#points = points[:,0:3]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue