mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
T466: Removed dual extrusion offsets, the second extruder shown as another color
This commit is contained in:
parent
cb1b9770fd
commit
2948e99fe8
1 changed files with 6 additions and 19 deletions
|
@ -80,7 +80,7 @@ class GCodeReader(MeshReader):
|
||||||
return AxisAlignedBox(minimum=Vector(0, 0, 0), maximum=Vector(10, 10, 10))
|
return AxisAlignedBox(minimum=Vector(0, 0, 0), maximum=Vector(10, 10, 10))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def createPolygon(layer_data, path, layer_id, extruder, extruder_offsets):
|
def createPolygon(layer_data, path, layer_id, extruder):
|
||||||
countvalid = 0
|
countvalid = 0
|
||||||
for point in path:
|
for point in path:
|
||||||
if point[3] > 0:
|
if point[3] > 0:
|
||||||
|
@ -104,8 +104,8 @@ class GCodeReader(MeshReader):
|
||||||
points = numpy.empty((count, 3), numpy.float32)
|
points = numpy.empty((count, 3), numpy.float32)
|
||||||
i = 0
|
i = 0
|
||||||
for point in path:
|
for point in path:
|
||||||
points[i, 0] = point[0] + extruder_offsets[extruder]['x']
|
points[i, 0] = point[0]
|
||||||
points[i, 1] = point[1] + extruder_offsets[extruder]['y']
|
points[i, 1] = point[1]
|
||||||
points[i, 2] = point[2]
|
points[i, 2] = point[2]
|
||||||
if i > 0:
|
if i > 0:
|
||||||
if point[3] == 1:
|
if point[3] == 1:
|
||||||
|
@ -156,7 +156,6 @@ class GCodeReader(MeshReader):
|
||||||
layer_data = LayerDataBuilder.LayerDataBuilder()
|
layer_data = LayerDataBuilder.LayerDataBuilder()
|
||||||
|
|
||||||
current_extruder = 0
|
current_extruder = 0
|
||||||
extruder_offsets = {0: {'x': 0, 'y': 0}}
|
|
||||||
current_path = []
|
current_path = []
|
||||||
current_x = 0
|
current_x = 0
|
||||||
current_y = 0
|
current_y = 0
|
||||||
|
@ -207,7 +206,7 @@ class GCodeReader(MeshReader):
|
||||||
current_path.append([current_x, current_z, -current_y, 0])
|
current_path.append([current_x, current_z, -current_y, 0])
|
||||||
if z_changed:
|
if z_changed:
|
||||||
if len(current_path) > 1 and current_z > 0:
|
if len(current_path) > 1 and current_z > 0:
|
||||||
if self.createPolygon(layer_data, current_path, current_layer, current_extruder, extruder_offsets):
|
if self.createPolygon(layer_data, current_path, current_layer, current_extruder):
|
||||||
current_layer += 1
|
current_layer += 1
|
||||||
else:
|
else:
|
||||||
current_path.clear()
|
current_path.clear()
|
||||||
|
@ -230,30 +229,18 @@ class GCodeReader(MeshReader):
|
||||||
current_y += y
|
current_y += y
|
||||||
if z is not None:
|
if z is not None:
|
||||||
current_z += z
|
current_z += z
|
||||||
elif G == 10:
|
|
||||||
x = self.getFloat(line, "X")
|
|
||||||
y = self.getFloat(line, "Y")
|
|
||||||
p = self.getInt(line, "P")
|
|
||||||
if p is not None:
|
|
||||||
if extruder_offsets.get(p, None) is None:
|
|
||||||
extruder_offsets[p] = {'x': 0, 'y': 0}
|
|
||||||
print(p, type(p))
|
|
||||||
if x is not None:
|
|
||||||
extruder_offsets[p]['x'] = x
|
|
||||||
if y is not None:
|
|
||||||
extruder_offsets[p]['y'] = y
|
|
||||||
|
|
||||||
T = self.getInt(line, "T")
|
T = self.getInt(line, "T")
|
||||||
if T is not None:
|
if T is not None:
|
||||||
current_extruder = T
|
current_extruder = T
|
||||||
if len(current_path) > 1 and current_z > 0:
|
if len(current_path) > 1 and current_z > 0:
|
||||||
if self.createPolygon(layer_data, current_path, current_layer, current_extruder, extruder_offsets):
|
if self.createPolygon(layer_data, current_path, current_layer, current_extruder):
|
||||||
current_layer += 1
|
current_layer += 1
|
||||||
else:
|
else:
|
||||||
current_path.clear()
|
current_path.clear()
|
||||||
|
|
||||||
if len(current_path) > 1:
|
if len(current_path) > 1:
|
||||||
if self.createPolygon(layer_data, current_path, current_layer, current_extruder, extruder_offsets):
|
if self.createPolygon(layer_data, current_path, current_layer, current_extruder):
|
||||||
current_layer += 1
|
current_layer += 1
|
||||||
|
|
||||||
layer_mesh = layer_data.build()
|
layer_mesh = layer_data.build()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue