CURA-4778 Add up to 8 different colors when loading a GCode, since we

support up to 8 extruders in CFP
This commit is contained in:
Diego Prado Gesto 2018-01-09 10:42:03 +01:00
parent 0722465fb9
commit e3e6f301f9
3 changed files with 8 additions and 3 deletions

View file

@ -418,9 +418,15 @@ class FlavorParser:
self._layer_number += 1 self._layer_number += 1
current_path.clear() current_path.clear()
material_color_map = numpy.zeros((10, 4), dtype = numpy.float32) material_color_map = numpy.zeros((8, 4), dtype = numpy.float32)
material_color_map[0, :] = [0.0, 0.7, 0.9, 1.0] material_color_map[0, :] = [0.0, 0.7, 0.9, 1.0]
material_color_map[1, :] = [0.7, 0.9, 0.0, 1.0] material_color_map[1, :] = [0.7, 0.9, 0.0, 1.0]
material_color_map[2, :] = [0.9, 0.0, 0.7, 1.0]
material_color_map[3, :] = [0.7, 0.0, 0.0, 1.0]
material_color_map[4, :] = [0.0, 0.7, 0.0, 1.0]
material_color_map[5, :] = [0.0, 0.0, 0.7, 1.0]
material_color_map[6, :] = [0.3, 0.3, 0.3, 1.0]
material_color_map[7, :] = [0.7, 0.7, 0.7, 1.0]
layer_mesh = self._layer_data_builder.build(material_color_map) layer_mesh = self._layer_data_builder.build(material_color_map)
decorator = LayerDataDecorator() decorator = LayerDataDecorator()
decorator.setLayerData(layer_mesh) decorator.setLayerData(layer_mesh)

View file

@ -104,7 +104,7 @@ class SimulationView(View):
title = catalog.i18nc("@info:title", "Simulation View")) title = catalog.i18nc("@info:title", "Simulation View"))
def _resetSettings(self): def _resetSettings(self):
self._layer_view_type = 0 # 0 is material color, 1 is color by linetype, 2 is speed self._layer_view_type = 0 # 0 is material color, 1 is color by linetype, 2 is speed, 3 is layer thickness
self._extruder_count = 0 self._extruder_count = 0
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0] self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
self._show_travel_moves = 0 self._show_travel_moves = 0

View file

@ -176,7 +176,6 @@ Item
viewSettings.show_feedrate_gradient = viewSettings.show_gradient && (type_id == 2); viewSettings.show_feedrate_gradient = viewSettings.show_gradient && (type_id == 2);
viewSettings.show_thickness_gradient = viewSettings.show_gradient && (type_id == 3); viewSettings.show_thickness_gradient = viewSettings.show_gradient && (type_id == 3);
} }
} }
Label Label