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-21 16:37:02 +0300
committerJack Ha <j.ha@ultimaker.com>2016-12-21 16:37:02 +0300
commit0adb1a4c1c16ca6550a8450b1c516e79f5f7b53c (patch)
treea75800c307a151cbfe4a364470953e82366fdb66 /cura/Layer.py
parent9e6c070ac64cd55981c998d48a9f75106e76580f (diff)
Finally got normals in
Diffstat (limited to 'cura/Layer.py')
-rw-r--r--cura/Layer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cura/Layer.py b/cura/Layer.py
index 4e38a6eba9..bc9f66e881 100644
--- a/cura/Layer.py
+++ b/cura/Layer.py
@@ -49,12 +49,14 @@ class Layer:
return result
- def build(self, vertex_offset, index_offset, vertices, colors, indices):
+ def build(self, vertex_offset, index_offset, vertices, colors, indices, normals):
result_vertex_offset = vertex_offset
result_index_offset = index_offset
self._element_count = 0
for polygon in self._polygons:
polygon.build(result_vertex_offset, result_index_offset, vertices, colors, indices)
+ polygon_normals = polygon.getNormals() # [numpy.where(numpy.logical_not(polygon.jumpMask))]
+ normals[result_vertex_offset:result_vertex_offset+polygon.lineMeshVertexCount()] = polygon_normals[:polygon.lineMeshVertexCount()]
result_vertex_offset += polygon.lineMeshVertexCount()
result_index_offset += polygon.lineMeshElementCount()
self._element_count += polygon.elementCount