Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Ha <j.ha@ultimaker.com>2016-12-28 15:15:42 +0300
committerJack Ha <j.ha@ultimaker.com>2016-12-28 15:15:42 +0300
commit8d2b3654a4ff8d107b97fb2297cc27bd05315ed5 (patch)
tree1e3ad3702342146f5512777e7544cd9583380125 /cura/LayerPolygon.py
parent9904dad07b17aacdc7175d82f98a1ac161609ba4 (diff)
Layer thickness now as array
Diffstat (limited to 'cura/LayerPolygon.py')
-rw-r--r--cura/LayerPolygon.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py
index 628fd78350..858fa11c77 100644
--- a/cura/LayerPolygon.py
+++ b/cura/LayerPolygon.py
@@ -18,13 +18,14 @@ class LayerPolygon:
__jump_map = numpy.logical_or(numpy.logical_or(numpy.arange(11) == NoneType, numpy.arange(11) == MoveCombingType), numpy.arange(11) == MoveRetractionType)
- def __init__(self, mesh, extruder, line_types, data, line_widths):
+ def __init__(self, mesh, extruder, line_types, data, line_widths, line_thicknesses):
self._mesh = mesh
self._extruder = extruder
self._types = line_types
self._data = data
self._line_widths = line_widths
-
+ self._line_thicknesses = line_thicknesses
+
self._vertex_begin = 0
self._vertex_end = 0
self._index_begin = 0
@@ -89,8 +90,8 @@ class LayerPolygon:
colors[self._vertex_begin:self._vertex_end, :] *= numpy.array([[0.5, 0.5, 0.5, 1.0]], numpy.float32)
# Create an array with line widths for each vertex.
- line_dimensions[self._vertex_begin:self._vertex_end, :] = numpy.tile(self._line_widths, (1, 2)).reshape((-1, 1))[needed_points_list.ravel()]
- line_dimensions[self._vertex_begin:self._vertex_end, 1] = thickness
+ 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]
# 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