From 46933693a7f2637bb436327395265a1ebd696fd7 Mon Sep 17 00:00:00 2001 From: bas <38720940+BasF0@users.noreply.github.com> Date: Wed, 20 Jan 2021 20:55:25 +0100 Subject: [PATCH] removed hardcoded 0: now using LayerPolygon.MoveCombingType --- plugins/SimulationView/SimulationPass.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py index 015b31175e..cbe75cc548 100644 --- a/plugins/SimulationView/SimulationPass.py +++ b/plugins/SimulationView/SimulationPass.py @@ -15,7 +15,7 @@ from UM.View.RenderBatch import RenderBatch from UM.View.GL.OpenGL import OpenGL from cura.Settings.ExtruderManager import ExtruderManager - +from cura.LayerPolygon import LayerPolygon import os.path import numpy @@ -167,8 +167,9 @@ class SimulationPass(RenderPass): self._current_shader = self._layer_shader self._switching_layers = True - # The first line does not have a previous line: add a zero in front - prev_line_types = numpy.concatenate([numpy.asarray([0], dtype=numpy.float32), layer_data._attributes["line_types"]["value"]]) + # The first line does not have a previous line: add a MoveCombingType in front for start detection + # this way the first start of the layer can also be drawn + prev_line_types = numpy.concatenate([numpy.asarray([LayerPolygon.MoveCombingType], dtype = numpy.float32), layer_data._attributes["line_types"]["value"]]) # Remove the last element prev_line_types = prev_line_types[0:layer_data._attributes["line_types"]["value"].size] layer_data._attributes["prev_line_types"] = {'opengl_type': 'float', 'value': prev_line_types, 'opengl_name': 'a_prev_line_type'}