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 /plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
parent9904dad07b17aacdc7175d82f98a1ac161609ba4 (diff)
Layer thickness now as array
Diffstat (limited to 'plugins/CuraEngineBackend/ProcessSlicedLayersJob.py')
-rw-r--r--plugins/CuraEngineBackend/ProcessSlicedLayersJob.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
index f8b80e9da0..7b814d99b4 100644
--- a/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
+++ b/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
@@ -92,7 +92,6 @@ class ProcessSlicedLayersJob(Job):
layer_data.addLayer(abs_layer_number)
this_layer = layer_data.getLayer(abs_layer_number)
layer_data.setLayerHeight(abs_layer_number, layer.height)
- layer_data.setLayerThickness(abs_layer_number, layer.thickness)
for p in range(layer.repeatedMessageCount("path_segment")):
polygon = layer.getRepeatedMessage("path_segment", p)
@@ -110,7 +109,12 @@ class ProcessSlicedLayersJob(Job):
line_widths = numpy.fromstring(polygon.line_width, dtype="f4") # Convert bytearray to numpy array
line_widths = line_widths.reshape((-1,1)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly.
-
+
+ # In the future, line_thicknesses should be given by CuraEngine as well.
+ # Currently the infill layer thickness also translates to line width
+ line_thicknesses = numpy.zeros(line_widths.shape, dtype="f4")
+ line_thicknesses[:] = layer.thickness / 1000 # from micrometer to millimeter
+
# Create a new 3D-array, copy the 2D points over and insert the right height.
# This uses manual array creation + copy rather than numpy.insert since this is
# faster.
@@ -124,7 +128,7 @@ class ProcessSlicedLayersJob(Job):
new_points[:, 1] = points[:, 2]
new_points[:, 2] = -points[:, 1]
- this_poly = LayerPolygon.LayerPolygon(layer_data, extruder, line_types, new_points, line_widths)
+ this_poly = LayerPolygon.LayerPolygon(layer_data, extruder, line_types, new_points, line_widths, line_thicknesses)
this_poly.buildCache()
this_layer.polygons.append(this_poly)