Merge branch '2.1'

Conflicts:
	resources/machines/fdmprinter.json
	resources/machines/innovo-inventor.json
	resources/profiles/general/High+Quality.cfg
	resources/profiles/general/Low+Quality.cfg
	resources/profiles/general/Normal+Quality.cfg
	resources/profiles/general/Ulti+Quality.cfg
	resources/profiles/ultimaker2+/pla_0.4_high.curaprofile
This commit is contained in:
Ghostkeeper 2016-04-04 18:49:09 +02:00
commit 0684cee681
86 changed files with 2336 additions and 3490 deletions

View file

@ -62,6 +62,11 @@ class ThreeMFReader(MeshReader):
mesh.addFace(vertex_list[v1][0],vertex_list[v1][1],vertex_list[v1][2],vertex_list[v2][0],vertex_list[v2][1],vertex_list[v2][2],vertex_list[v3][0],vertex_list[v3][1],vertex_list[v3][2])
Job.yieldThread()
# Rotate the model; We use a different coordinate frame.
rotation = Matrix()
rotation.setByRotationAxis(-0.5 * math.pi, Vector(1,0,0))
mesh = mesh.getTransformed(rotation)
#TODO: We currently do not check for normals and simply recalculate them.
mesh.calculateNormals()
node.setMeshData(mesh)
@ -70,48 +75,36 @@ class ThreeMFReader(MeshReader):
transformation = root.findall("./3mf:build/3mf:item[@objectid='{0}']".format(entry.get("id")), self._namespaces)
if transformation:
transformation = transformation[0]
try:
if transformation.get("transform"):
splitted_transformation = transformation.get("transform").split()
## Transformation is saved as:
## M00 M01 M02 0.0
## M10 M11 M12 0.0
## M20 M21 M22 0.0
## M30 M31 M32 1.0
## We switch the row & cols as that is how everyone else uses matrices!
temp_mat = Matrix()
# Rotation & Scale
temp_mat._data[0,0] = splitted_transformation[0]
temp_mat._data[1,0] = splitted_transformation[1]
temp_mat._data[2,0] = splitted_transformation[2]
temp_mat._data[0,1] = splitted_transformation[3]
temp_mat._data[1,1] = splitted_transformation[4]
temp_mat._data[2,1] = splitted_transformation[5]
temp_mat._data[0,2] = splitted_transformation[6]
temp_mat._data[1,2] = splitted_transformation[7]
temp_mat._data[2,2] = splitted_transformation[8]
if transformation.get("transform"):
splitted_transformation = transformation.get("transform").split()
## Transformation is saved as:
## M00 M01 M02 0.0
## M10 M11 M12 0.0
## M20 M21 M22 0.0
## M30 M31 M32 1.0
## We switch the row & cols as that is how everyone else uses matrices!
temp_mat = Matrix()
# Rotation & Scale
temp_mat._data[0,0] = splitted_transformation[0]
temp_mat._data[1,0] = splitted_transformation[1]
temp_mat._data[2,0] = splitted_transformation[2]
temp_mat._data[0,1] = splitted_transformation[3]
temp_mat._data[1,1] = splitted_transformation[4]
temp_mat._data[2,1] = splitted_transformation[5]
temp_mat._data[0,2] = splitted_transformation[6]
temp_mat._data[1,2] = splitted_transformation[7]
temp_mat._data[2,2] = splitted_transformation[8]
# Translation
temp_mat._data[0,3] = splitted_transformation[9]
temp_mat._data[1,3] = splitted_transformation[10]
temp_mat._data[2,3] = splitted_transformation[11]
# Translation
temp_mat._data[0,3] = splitted_transformation[9]
temp_mat._data[1,3] = splitted_transformation[10]
temp_mat._data[2,3] = splitted_transformation[11]
node.setTransformation(temp_mat)
except AttributeError:
pass # Empty list was found. Getting transformation is not possible
node.setPosition(Vector(temp_mat.at(0,3), temp_mat.at(1,3), temp_mat.at(2,3)))
temp_quaternion = Quaternion()
temp_quaternion.setByMatrix(temp_mat)
node.setOrientation(temp_quaternion)
# Magical scale extraction
scale = temp_mat.getTransposed().multiply(temp_mat)
scale_x = math.sqrt(scale.at(0,0))
scale_y = math.sqrt(scale.at(1,1))
scale_z = math.sqrt(scale.at(2,2))
node.setScale(Vector(scale_x,scale_y,scale_z))
# We use a different coordinate frame, so rotate.
#rotation = Quaternion.fromAngleAxis(-0.5 * math.pi, Vector(1,0,0))
#node.rotate(rotation)
result.addChild(node)
Job.yieldThread()

View file

@ -12,8 +12,8 @@ UM.Dialog
{
id: base
minimumWidth: 400
minimumHeight: 300;
title: "Changelog"
minimumHeight: 300
title: catalog.i18nc("@label", "Changelog")
ScrollView
{
@ -28,8 +28,13 @@ UM.Dialog
}
Button
{
UM.I18nCatalog
{
id: catalog
name: "cura"
}
anchors.bottom:parent.bottom
text: "close"
text: catalog.i18nc("@action:button", "Close")
onClicked: base.hide()
anchors.horizontalCenter: parent.horizontalCenter
}

View file

@ -12,7 +12,7 @@ def getMetaData():
"name": catalog.i18nc("@label", "Changelog"),
"author": "Ultimaker",
"version": "1.0",
"description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version"),
"description": catalog.i18nc("@info:whatsthis", "Shows changes since latest checked version."),
"api": 2
}
}

View file

@ -47,7 +47,9 @@ class CuraEngineBackend(Backend):
self._onActiveViewChanged()
self._stored_layer_data = None
Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onChanged)
# When there are current settings and machine instance is changed, there is no profile changed event. We should
# pretend there is though.
Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveProfileChanged)
self._profile = None
Application.getInstance().getMachineManager().activeProfileChanged.connect(self._onActiveProfileChanged)
@ -104,6 +106,7 @@ class CuraEngineBackend(Backend):
## Perform a slice of the scene.
def slice(self):
if not self._enabled:
return
@ -114,7 +117,6 @@ class CuraEngineBackend(Backend):
self._message.hide()
self._message = None
self.slicingCancelled.emit()
return
if self._process_layers_job:
@ -150,14 +152,18 @@ class CuraEngineBackend(Backend):
self._slicing = False
self._restart = True
self.slicingCancelled.emit()
self.processingProgress.emit(0)
Logger.log("d", "Attempting to kill the engine process")
if self._process is not None:
Logger.log("d", "Killing engine process")
try:
self._process.terminate()
Logger.log("d", "Engine process is killed. Recieved return code %s", self._process.wait())
self._process = None
except: # terminating a process that is already terminating causes an exception, silently ignore this.
pass
Logger.log("d", "Engine process is killed")
#self._createSocket() # Re create the socket
except Exception as e: # terminating a process that is already terminating causes an exception, silently ignore this.
Logger.log("d", "Exception occured while trying to kill the engine %s", str(e))
def _onStartSliceCompleted(self, job):
if job.getError() or job.getResult() != True:
@ -184,8 +190,7 @@ class CuraEngineBackend(Backend):
def _onSocketError(self, error):
super()._onSocketError(error)
self._slicing = False
self.processingProgress.emit(0)
self._terminate()
if error.getErrorCode() not in [Arcus.ErrorCode.BindFailedError, Arcus.ErrorCode.ConnectionResetError, Arcus.ErrorCode.Debug]:
Logger.log("e", "A socket error caused the connection to be reset")
@ -277,9 +282,9 @@ class CuraEngineBackend(Backend):
def _onInstanceChanged(self):
self._terminate()
self.slicingCancelled.emit()
def _onBackendQuit(self):
if not self._restart and self._process:
Logger.log("d", "Backend quit with return code %s. Resetting process and socket.", self._process.wait())
self._process = None
self._createSocket()

View file

@ -12,7 +12,7 @@ def getMetaData():
"plugin": {
"name": catalog.i18nc("@label", "CuraEngine Backend"),
"author": "Ultimaker",
"description": catalog.i18nc("@info:whatsthis", "Provides the link to the CuraEngine slicing backend"),
"description": catalog.i18nc("@info:whatsthis", "Provides the link to the CuraEngine slicing backend."),
"api": 2
}
}

View file

@ -12,7 +12,7 @@ def getMetaData():
"name": catalog.i18nc("@label", "GCode Writer"),
"author": "Ultimaker",
"version": "1.0",
"description": catalog.i18nc("@info:whatsthis", "Writes GCode to a file"),
"description": catalog.i18nc("@info:whatsthis", "Writes GCode to a file."),
"api": 2
},

View file

@ -11,7 +11,7 @@ def getMetaData():
"plugin": {
"name": catalog.i18nc("@label", "Removable Drive Output Device Plugin"),
"author": "Ultimaker B.V.",
"description": catalog.i18nc("@info:whatsthis", "Provides removable drive hotplugging and writing support"),
"description": catalog.i18nc("@info:whatsthis", "Provides removable drive hotplugging and writing support."),
"version": "1.0",
"api": 2
}

View file

@ -12,7 +12,7 @@ def getMetaData():
"name": i18n_catalog.i18nc("@label", "Solid View"),
"author": "Ultimaker",
"version": "1.0",
"decription": i18n_catalog.i18nc("@info:whatsthis", "Provides a normal solid mesh view."),
"description": i18n_catalog.i18nc("@info:whatsthis", "Provides a normal solid mesh view."),
"api": 2
},
"view": {