Merge pull request #1978 from Ultimaker/feature_sanding_horizontal

Horizontal Ironing
This commit is contained in:
Lipu Fei 2017-06-16 11:55:45 +02:00 committed by GitHub
commit 5647800aec
2 changed files with 120 additions and 6 deletions

View File

@ -1,4 +1,6 @@
from UM.Math.Color import Color # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Application import Application from UM.Application import Application
from typing import Any from typing import Any
import numpy import numpy
@ -16,8 +18,9 @@ class LayerPolygon:
MoveCombingType = 8 MoveCombingType = 8
MoveRetractionType = 9 MoveRetractionType = 9
SupportInterfaceType = 10 SupportInterfaceType = 10
__number_of_types = 11
__jump_map = numpy.logical_or(numpy.logical_or(numpy.arange(11) == NoneType, numpy.arange(11) == MoveCombingType), numpy.arange(11) == MoveRetractionType) __jump_map = numpy.logical_or(numpy.logical_or(numpy.arange(__number_of_types) == NoneType, numpy.arange(__number_of_types) == MoveCombingType), numpy.arange(__number_of_types) == MoveRetractionType)
## LayerPolygon, used in ProcessSlicedLayersJob ## LayerPolygon, used in ProcessSlicedLayersJob
# \param extruder # \param extruder
@ -28,6 +31,9 @@ class LayerPolygon:
def __init__(self, extruder, line_types, data, line_widths, line_thicknesses): def __init__(self, extruder, line_types, data, line_widths, line_thicknesses):
self._extruder = extruder self._extruder = extruder
self._types = line_types self._types = line_types
for i in range(len(self._types)):
if self._types[i] >= self.__number_of_types: #Got faulty line data from the engine.
self._types[i] = self.NoneType
self._data = data self._data = data
self._line_widths = line_widths self._line_widths = line_widths
self._line_thicknesses = line_thicknesses self._line_thicknesses = line_thicknesses
@ -39,8 +45,8 @@ class LayerPolygon:
self._jump_mask = self.__jump_map[self._types] self._jump_mask = self.__jump_map[self._types]
self._jump_count = numpy.sum(self._jump_mask) self._jump_count = numpy.sum(self._jump_mask)
self._mesh_line_count = len(self._types)-self._jump_count self._mesh_line_count = len(self._types) - self._jump_count
self._vertex_count = self._mesh_line_count + numpy.sum( self._types[1:] == self._types[:-1]) self._vertex_count = self._mesh_line_count + numpy.sum(self._types[1:] == self._types[:-1])
# Buffering the colors shouldn't be necessary as it is not # Buffering the colors shouldn't be necessary as it is not
# re-used and can save alot of memory usage. # re-used and can save alot of memory usage.

View File

@ -1970,6 +1970,21 @@
"limit_to_extruder": "top_bottom_extruder_nr", "limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true "settable_per_mesh": true
}, },
"speed_ironing":
{
"label": "Ironing Speed",
"description": "The speed at which to pass over the top surface.",
"type": "float",
"unit": "mm/s",
"default_value": 20.0,
"value": "speed_topbottom * 20 / 30",
"minimum_value": "0.001",
"maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)",
"maximum_value_warning": "100",
"enabled": "ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"speed_support": "speed_support":
{ {
"label": "Support Speed", "label": "Support Speed",
@ -2296,6 +2311,21 @@
"limit_to_extruder": "top_bottom_extruder_nr", "limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true "settable_per_mesh": true
}, },
"acceleration_ironing":
{
"label": "Ironing Acceleration",
"description": "The acceleration with which ironing is performed.",
"unit": "mm/s²",
"type": "float",
"minimum_value": "0.1",
"minimum_value_warning": "100",
"maximum_value_warning": "10000",
"default_value": 3000,
"value": "acceleration_topbottom",
"enabled": "resolveOrValue('acceleration_enabled') and ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"acceleration_support": "acceleration_support":
{ {
"label": "Support Acceleration", "label": "Support Acceleration",
@ -2569,6 +2599,20 @@
"limit_to_extruder": "top_bottom_extruder_nr", "limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true "settable_per_mesh": true
}, },
"jerk_ironing":
{
"label": "Ironing Jerk",
"description": "The maximum instantaneous velocity change while performing ironing.",
"unit": "mm/s",
"type": "float",
"minimum_value": "0.1",
"maximum_value_warning": "50",
"default_value": 20,
"value": "jerk_topbottom",
"enabled": "resolveOrValue('jerk_enabled') and ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"jerk_support": "jerk_support":
{ {
"label": "Support Jerk", "label": "Support Jerk",
@ -5340,6 +5384,70 @@
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": false,
"settable_per_meshgroup": false "settable_per_meshgroup": false
},
"ironing_enabled":
{
"label": "Enable Ironing",
"description": "Go over the top surface one additional time, but without extruding material. This is meant to melt the plastic on top further, creating a smoother surface.",
"type": "bool",
"default_value": false,
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"ironing_pattern":
{
"label": "Ironing Pattern",
"description": "The pattern to use for ironing top surfaces.",
"type": "enum",
"options":
{
"concentric": "Concentric",
"zigzag": "Zig Zag"
},
"default_value": "zigzag",
"enabled": "ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"ironing_line_spacing":
{
"label": "Ironing Line Spacing",
"description": "The distance between the lines of ironing.",
"type": "float",
"unit": "mm",
"default_value": 0.1,
"minimum_value": "0.001",
"maximum_value_warning": "machine_nozzle_tip_outer_diameter",
"enabled": "ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"ironing_flow":
{
"label": "Ironing Flow",
"description": "The amount of material, relative to a normal skin line, to extrude during ironing. Keeping the nozzle filled helps filling some of the crevices of the top surface, but too much results in overextrusion and blips on the side of the surface.",
"type": "float",
"unit": "%",
"default_value": 10.0,
"minimum_value": "0",
"maximum_value_warning": "50",
"enabled": "ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
},
"ironing_inset":
{
"label": "Ironing Inset",
"description": "A distance to keep from the edges of the model. Ironing all the way to the edge of the mesh may result in a jagged edge on your print.",
"type": "float",
"unit": "mm",
"default_value": 0.35,
"value": "wall_line_width_0 / 2",
"minimum_value_warning": "0",
"maximum_value_warning": "wall_line_width_0",
"enabled": "ironing_enabled",
"limit_to_extruder": "top_bottom_extruder_nr",
"settable_per_mesh": true
} }
} }
}, },