diff options
author | Jack Ha <j.ha@ultimaker.com> | 2016-12-29 18:49:00 +0300 |
---|---|---|
committer | Jack Ha <j.ha@ultimaker.com> | 2016-12-29 18:49:00 +0300 |
commit | 1217281727d9496a7c31b1f36872eec88e91bbdd (patch) | |
tree | f8ab7a75ea998a1b1c935604f11058d30d20f0d9 /cura/LayerPolygon.py | |
parent | 0f2fb86cd9872843eb73d86cbb5e001c75ad93dd (diff) |
Busy with layer_view options
Diffstat (limited to 'cura/LayerPolygon.py')
-rw-r--r-- | cura/LayerPolygon.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py index 439146e6e2..bb37d641bb 100644 --- a/cura/LayerPolygon.py +++ b/cura/LayerPolygon.py @@ -38,7 +38,7 @@ class LayerPolygon: # Buffering the colors shouldn't be necessary as it is not # re-used and can save alot of memory usage. - self._color_map = self.__color_map * [1, 1, 1, self._extruder] # The alpha component is used to store the extruder nr + self._color_map = self.__color_map # * [1, 1, 1, self._extruder] # The alpha component is used to store the extruder nr self._colors = self._color_map[self._types] # When type is used as index returns true if type == LayerPolygon.InfillType or type == LayerPolygon.SkinType or type == LayerPolygon.SupportInfillType @@ -67,7 +67,7 @@ class LayerPolygon: ## build # line_thicknesses: array with type as index and thickness as value - def build(self, vertex_offset, index_offset, vertices, colors, line_dimensions, indices): + def build(self, vertex_offset, index_offset, vertices, colors, line_dimensions, extruders, indices): if (self._build_cache_line_mesh_mask is None) or (self._build_cache_needed_points is None ): self.buildCache() @@ -94,6 +94,8 @@ class LayerPolygon: line_dimensions[self._vertex_begin:self._vertex_end, 0] = numpy.tile(self._line_widths, (1, 2)).reshape((-1, 1))[needed_points_list.ravel()][:, 0] line_dimensions[self._vertex_begin:self._vertex_end, 1] = numpy.tile(self._line_thicknesses, (1, 2)).reshape((-1, 1))[needed_points_list.ravel()][:, 0] + extruders[self._vertex_begin:self._vertex_end] = float(self._extruder) + # The relative values of begin and end indices have already been set in buildCache, so we only need to offset them to the parents offset. self._index_begin += index_offset self._index_end += index_offset |