From 7082ff7d68893c3d3df9b4bd27db7ea4d9f9d042 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 29 Nov 2016 13:11:27 +0100 Subject: [PATCH 1/2] Don't hide the dual extrusion category for single extrusion The category gets hidden automatically if all of its child settings are disabled. --- resources/definitions/fdmprinter.def.json | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 2d77d62670..28b5b6c854 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3616,7 +3616,6 @@ "type": "category", "icon": "category_dual", "description": "Settings used for printing with multiple extruders.", - "enabled": "machine_extruder_count > 1", "children": { "prime_tower_enable": From b9dd2ef6f91f3a1cc5940dadbce25484df4baed3 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Tue, 29 Nov 2016 15:13:10 +0100 Subject: [PATCH 2/2] Numpy magic to speed up the expansion of indices-to-vectors to just vectors. CURA-2548 Sending models to engine that have indices is slow --- plugins/CuraEngineBackend/StartSliceJob.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 0319186518..dc9c4c2e06 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -163,22 +163,17 @@ class StartSliceJob(Job): obj.id = id(object) verts = mesh_data.getVertices() indices = mesh_data.getIndices() + if indices is not None: - #TODO: This is a very slow way of doing it! It also locks up the GUI. - flat_vert_list = [] - for face in indices: - for vert_index in face: - flat_vert_list.append(verts[vert_index]) - Job.yieldThread() - verts = numpy.array(flat_vert_list) + flat_verts = numpy.take(verts, indices.flatten(), axis=0) else: - verts = numpy.array(verts) + flat_verts = numpy.array(verts) # Convert from Y up axes to Z up axes. Equals a 90 degree rotation. - verts[:, [1, 2]] = verts[:, [2, 1]] - verts[:, 1] *= -1 + flat_verts[:, [1, 2]] = flat_verts[:, [2, 1]] + flat_verts[:, 1] *= -1 - obj.vertices = verts + obj.vertices = flat_verts self._handlePerObjectSettings(object, obj)