Merge branch '2.3'

Conflicts:
	resources/qml/Preferences/ProfilesPage.qml
This commit is contained in:
Simon Edwards 2016-09-05 11:26:29 +02:00
commit 825283d7c6
18 changed files with 65 additions and 51 deletions

View File

@ -280,7 +280,7 @@ class BuildVolume(SceneNode):
self._height = self._global_container_stack.getProperty("machine_height", "value")
rebuild_me = True
if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings:
if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings or setting_key == "print_sequence":
self._updateDisallowedAreas()
rebuild_me = True
@ -383,6 +383,10 @@ class BuildVolume(SceneNode):
def _getBedAdhesionSize(self, container_stack):
skirt_size = 0.0
# If we are printing one at a time, we need to add the bed adhesion size to the disallowed areas of the objects
if container_stack.getProperty("print_sequence", "value") == "one_at_a_time":
return 0.1 # Return a very small value, so we do draw disallowed area's near the edges.
adhesion_type = container_stack.getProperty("adhesion_type", "value")
if adhesion_type == "skirt":
skirt_distance = container_stack.getProperty("skirt_gap", "value")

View File

@ -56,6 +56,7 @@ class ConvexHullDecorator(SceneNodeDecorator):
if self._global_stack and self._node:
if self._global_stack.getProperty("print_sequence", "value") == "one_at_a_time" and not self._node.getParent().callDecoration("isGroup"):
hull = hull.getMinkowskiHull(Polygon(numpy.array(self._global_stack.getProperty("machine_head_polygon", "value"), numpy.float32)))
hull = self._add2DAdhesionMargin(hull)
return hull
## Get the convex hull of the node with the full head size
@ -229,17 +230,16 @@ class ConvexHullDecorator(SceneNodeDecorator):
machine_head_coords = numpy.array(
self._global_stack.getProperty("machine_head_with_fans_polygon", "value"),
numpy.float32)
head_y_size = abs(machine_head_coords).min() # safe margin to take off in all directions
if adhesion_type == "raft":
extra_margin = max(0, self._global_stack.getProperty("raft_margin", "value") - head_y_size)
extra_margin = max(0, self._global_stack.getProperty("raft_margin", "value"))
elif adhesion_type == "brim":
extra_margin = max(0, self._global_stack.getProperty("brim_width", "value") - head_y_size)
extra_margin = max(0, self._global_stack.getProperty("brim_line_count", "value") * self._global_stack.getProperty("skirt_brim_line_width", "value"))
elif adhesion_type == "skirt":
extra_margin = max(
0, self._global_stack.getProperty("skirt_gap", "value") +
self._global_stack.getProperty("skirt_line_count", "value") * self._global_stack.getProperty("skirt_brim_line_width", "value") -
head_y_size)
self._global_stack.getProperty("skirt_line_count", "value") * self._global_stack.getProperty("skirt_brim_line_width", "value"))
# adjust head_and_fans with extra margin
if extra_margin > 0:
# In Cura 2.2+, there is a function to create this circle-like polygon.
@ -288,4 +288,4 @@ class ConvexHullDecorator(SceneNodeDecorator):
_affected_settings = [
"adhesion_type", "raft_base_thickness", "raft_interface_thickness", "raft_surface_layers",
"raft_surface_thickness", "raft_airgap", "raft_margin", "print_sequence",
"skirt_gap", "skirt_line_count", "skirt_brim_line_width", "skirt_distance"]
"skirt_gap", "skirt_line_count", "skirt_brim_line_width", "skirt_distance", "brim_line_count"]

View File

@ -23,6 +23,7 @@ from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.RemoveSceneNodeOperation import RemoveSceneNodeOperation
from UM.Operations.GroupedOperation import GroupedOperation
from UM.Operations.SetTransformOperation import SetTransformOperation
from UM.Operations.TranslateOperation import TranslateOperation
from cura.SetParentOperation import SetParentOperation
from UM.Settings.SettingDefinition import SettingDefinition, DefinitionPropertyType
@ -36,7 +37,6 @@ from . import BuildVolume
from . import CameraAnimation
from . import PrintInformation
from . import CuraActions
from . import MultiMaterialDecorator
from . import ZOffsetDecorator
from . import CuraSplashScreen
from . import CameraImageProvider
@ -700,8 +700,7 @@ class CuraApplication(QtApplication):
op = GroupedOperation()
for node in nodes:
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
op.addOperation(SetTransformOperation(node, Vector(0,0,0)))
op.addOperation(SetTransformOperation(node, Vector(0, node.getWorldPosition().y - node.getBoundingBox().bottom, 0)))
op.push()
## Reset all transformations on nodes with mesh data.
@ -724,7 +723,8 @@ class CuraApplication(QtApplication):
for node in nodes:
# Ensure that the object is above the build platform
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
op.addOperation(SetTransformOperation(node, Vector(0,0,0), Quaternion(), Vector(1, 1, 1)))
op.addOperation(SetTransformOperation(node, Vector(0, node.getMeshData().getCenterPosition().y, 0), Quaternion(), Vector(1, 1, 1)))
op.push()
@ -792,8 +792,6 @@ class CuraApplication(QtApplication):
except Exception as e:
Logger.log("d", "mergeSelected: Exception:", e)
return
multi_material_decorator = MultiMaterialDecorator.MultiMaterialDecorator()
group_node.addDecorator(multi_material_decorator)
# Compute the center of the objects when their origins are aligned.
object_centers = [node.getMeshData().getCenterPosition().scale(node.getScale()) for node in group_node.getChildren()]

View File

@ -1,11 +0,0 @@
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
class MultiMaterialDecorator(SceneNodeDecorator):
def __init__(self):
super().__init__()
def isMultiMaterial(self):
return True
def __deepcopy__(self, memo):
return MultiMaterialDecorator()

View File

@ -102,11 +102,11 @@ class PlatformPhysics:
# Get the overlap distance for both convex hulls. If this returns None, there is no intersection.
head_hull = node.callDecoration("getConvexHullHead")
if head_hull:
overlap = head_hull.intersectsPolygon(other_node.callDecoration("getConvexHullHead"))
overlap = head_hull.intersectsPolygon(other_node.callDecoration("getConvexHull"))
if not overlap:
other_head_hull = other_node.callDecoration("getConvexHullHead")
if other_head_hull:
overlap = node.callDecoration("getConvexHullHead").intersectsPolygon(other_head_hull)
overlap = node.callDecoration("getConvexHull").intersectsPolygon(other_head_hull)
else:
own_convex_hull = node.callDecoration("getConvexHull")
other_convex_hull = other_node.callDecoration("getConvexHull")

View File

@ -435,8 +435,7 @@ class ContainerManager(QObject):
return False
self._machine_manager.blurSettings.emit()
if base_name is None:
if base_name is None or base_name == "":
base_name = active_quality_name
unique_name = self._container_registry.uniqueName(base_name)

View File

@ -614,9 +614,16 @@ class MachineManager(QObject):
stack_quality_changes = self._empty_quality_changes_container
old_quality = stack.findContainer(type = "quality")
old_quality.nameChanged.disconnect(self._onQualityNameChanged)
if old_quality:
old_quality.nameChanged.disconnect(self._onQualityNameChanged)
else:
Logger.log("w", "Could not find old quality while changing active quality.")
old_changes = stack.findContainer(type = "quality_changes")
old_changes.nameChanged.disconnect(self._onQualityNameChanged)
if old_changes:
old_changes.nameChanged.disconnect(self._onQualityNameChanged)
else:
Logger.log("w", "Could not find old quality_changes while changing active quality.")
stack.replaceContainer(stack.getContainerIndex(old_quality), stack_quality)
stack.replaceContainer(stack.getContainerIndex(old_changes), stack_quality_changes)

View File

@ -1,7 +1,7 @@
[2.3.0]
*Speed improvements
The first thing you will notice is the speed. STL loading is now 10 to 20 times faster, layer time is significantly faster and slicing speed is slightly improved.
The first thing you will notice is the speed. STL loading is now 10 to 20 times faster, layerview is significantly faster and slicing speed is slightly improved.
*Multi Extrusion Support
Machines with multiple extruders are now supported. If youve got the Ultimaker Original with the dual extrusion upgrade kit, weve got you covered.
@ -59,9 +59,6 @@ Set the travel speed of the initial layer(s) to reduce risk of extruder pulling
*Support Bottoms
This new feature duplicates the Support Roofs feature in the places where the support rests on the model.
*Auto Temperature
Automatically change the temperature of a layer based on the average flow of material in the layer.
*Bug fixes & minor changes
Deleting grouped objects works as intended again.
Duplicating groups works as intended again.

View File

@ -206,7 +206,14 @@ class StartSliceJob(Job):
# Use resolvement value if available, or take the value
resolved_value = stack.getProperty(key, "resolve")
if resolved_value is not None:
settings[key] = resolved_value
# There is a resolvement value. Check if we need to use it.
user_container = stack.findContainer({"type": "user"})
quality_changes_container = stack.findContainer({"type": "quality_changes"})
if user_container.hasProperty(key,"value") or quality_changes_container.hasProperty(key,"value"):
# Normal case
settings[key] = stack.getProperty(key, "value")
else:
settings[key] = resolved_value
else:
# Normal case
settings[key] = stack.getProperty(key, "value")

View File

@ -26,7 +26,11 @@ class CuraProfileReader(ProfileReader):
# not be read or didn't contain a valid profile, \code None \endcode is
# returned.
def read(self, file_name):
archive = zipfile.ZipFile(file_name, "r")
try:
archive = zipfile.ZipFile(file_name, "r")
except Exception:
# zipfile doesn't give proper exceptions, so we can only catch broad ones
return []
results = []
for profile_id in archive.namelist():
# Create an empty profile.

View File

@ -89,17 +89,17 @@ class GCodeWriter(MeshWriter):
prefix = ";SETTING_" + str(GCodeWriter.version) + " " # The prefix to put before each line.
prefix_length = len(prefix)
container_with_profile = stack.findContainer({"type": "quality"})
container_with_profile = stack.findContainer({"type": "quality_changes"})
if not container_with_profile:
Logger.log("e", "No valid quality profile found, not writing settings to GCode!")
return ""
flat_global_container = self._createFlattenedContainerInstance(stack.getTop(),container_with_profile)
flat_global_container = self._createFlattenedContainerInstance(stack.getTop(), container_with_profile)
serialized = flat_global_container.serialize()
data = {"global_quality": serialized}
for extruder in ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
extruder_quality = extruder.findContainer({"type": "quality"})
extruder_quality = extruder.findContainer({"type": "quality_changes"})
if not extruder_quality:
Logger.log("w", "No extruder quality profile found, not writing quality for extruder %s to file!", extruder.getId())
continue

View File

@ -47,7 +47,9 @@ class SolidView(View):
if global_container_stack:
if Preferences.getInstance().getValue("view/show_overhang"):
angle = global_container_stack.getProperty("support_angle", "value")
if angle is not None and global_container_stack.getProperty("support_angle", "validationState") == ValidatorState.Valid:
# Make sure the overhang angle is valid before passing it to the shader
# Note: if the overhang angle is set to its default value, it does not need to get validated (validationState = None)
if angle is not None and global_container_stack.getProperty("support_angle", "validationState") in [None, ValidatorState.Valid]:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle)))
else:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) #Overhang angle of 0 causes no area at all to be marked as overhang.

View File

@ -87,7 +87,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
super().setName(new_name)
basefile = self.getMetaDataEntry("base_file", self._id) # if basefile is none, this is a basefile.
basefile = self.getMetaDataEntry("base_file", self._id) # if basefile is self.id, this is a basefile.
# Update the basefile as well, this is actually what we're trying to do
# Update all containers that share GUID and basefile
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile)
@ -275,7 +275,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
# The XML material profile can have specific settings for machines.
# Some machines share profiles, so they are only created once.
# This function duplicates those elements so that each machine tag only has one identifier.
def _flattenMachinesXML(self, element):
def _expandMachinesXML(self, element):
settings_element = element.find("./um:settings", self.__namespaces)
machines = settings_element.iterfind("./um:machine", self.__namespaces)
machines_to_add = []
@ -309,7 +309,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
def _mergeXML(self, first, second):
result = copy.deepcopy(first)
self._combineElement(self._flattenMachinesXML(result), self._flattenMachinesXML(second))
self._combineElement(self._expandMachinesXML(result), self._expandMachinesXML(second))
return result
def _createKey(self, element):
@ -339,7 +339,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
key = self._createKey(element)
if len(element): # Check if element has children.
try:
if "setting " in key:
if "setting" in element.tag and not "settings" in element.tag:
# Setting can have points in it. In that case, delete all values and override them.
for child in list(mapping[key]):
mapping[key].remove(child)

View File

@ -3310,6 +3310,8 @@
"default_value": 200,
"minimum_value_warning": "-1000",
"maximum_value_warning": "1000",
"maximum_value": "machine_width - 0.5 * prime_tower_size",
"minimum_value": "0.5 * prime_tower_size",
"settable_per_mesh": false,
"settable_per_extruder": false
},
@ -3323,6 +3325,8 @@
"default_value": 200,
"minimum_value_warning": "-1000",
"maximum_value_warning": "1000",
"maximum_value": "machine_depth - 0.5 * prime_tower_size",
"minimum_value": "0.5 * prime_tower_size",
"settable_per_mesh": false,
"settable_per_extruder": false
},

View File

@ -28,7 +28,9 @@ Generic CPE+ profile. Serves as an example file, data in this file is not correc
<machine_identifier manufacturer="Ultimaker" product="Ultimaker 2 Extended+"/>
<setting key="hardware compatible">yes</setting>
<hotend id="0.25 mm" />
<hotend id="0.25 mm">
<setting key="hardware compatible">no</setting>
</hotend>
<hotend id="0.4 mm" />
<hotend id="0.6 mm" />
<hotend id="0.8 mm" />

View File

@ -31,7 +31,9 @@ Generic TPU 95A profile. Serves as an example file, data in this file is not cor
<hotend id="0.25 mm" />
<hotend id="0.4 mm" />
<hotend id="0.6 mm" />
<hotend id="0.8 mm" />
<hotend id="0.8 mm">
<setting key="hardware compatible">no</setting>
</hotend>
</machine>
</settings>
</fdmmaterial>

View File

@ -3,7 +3,6 @@
Automatically generated PLA profile. Data in this file may not be not correct.
-->
<fdmmaterial xmlns="http://www.ultimaker.com/material">
<inherits>generic_pla</inherits>
<metadata>
<name>
<brand>Ultimaker</brand>
@ -38,14 +37,14 @@ Automatically generated PLA profile. Data in this file may not be not correct.
<machine_identifier manufacturer="Ultimaker" product="Ultimaker 2 Go"/>
<machine_identifier manufacturer="Ultimaker" product="Ultimaker 2 Extended"/>
<setting key="processing temperature graph">
<point flow="2" temperature="20"/>
<point flow="10" temperature="20"/>
<point flow="2" temperature="180"/>
<point flow="10" temperature="230"/>
</setting>
</machine>
<machine>
<machine_identifier manufacturer="Ultimaker" product="Ultimaker Original"/>
<setting key="standby temperature">180</setting>
<setting key="standby temperature">150</setting>
</machine>
</settings>
</fdmmaterial>

View File

@ -160,7 +160,7 @@ UM.ManagementPage
Label {
id: profileName
text: base.currentItem ? base.currentItem.name r: ""
text: base.currentItem ? base.currentItem.name: ""
font: UM.Theme.getFont("large")
width: parent.width
elide: Text.ElideRight