mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 06:55:55 +08:00
commit
68f536dc5f
@ -258,12 +258,16 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||||||
# influences the collision area.
|
# influences the collision area.
|
||||||
def _offsetHull(self, convex_hull):
|
def _offsetHull(self, convex_hull):
|
||||||
horizontal_expansion = self._getSettingProperty("xy_offset", "value")
|
horizontal_expansion = self._getSettingProperty("xy_offset", "value")
|
||||||
if horizontal_expansion != 0:
|
mold_width = 0
|
||||||
|
if self._getSettingProperty("mold_enabled", "value"):
|
||||||
|
mold_width = self._getSettingProperty("mold_width", "value")
|
||||||
|
hull_offset = horizontal_expansion + mold_width
|
||||||
|
if hull_offset != 0:
|
||||||
expansion_polygon = Polygon(numpy.array([
|
expansion_polygon = Polygon(numpy.array([
|
||||||
[-horizontal_expansion, -horizontal_expansion],
|
[-hull_offset, -hull_offset],
|
||||||
[-horizontal_expansion, horizontal_expansion],
|
[-hull_offset, hull_offset],
|
||||||
[horizontal_expansion, horizontal_expansion],
|
[hull_offset, hull_offset],
|
||||||
[horizontal_expansion, -horizontal_expansion]
|
[hull_offset, -hull_offset]
|
||||||
], numpy.float32))
|
], numpy.float32))
|
||||||
return convex_hull.getMinkowskiHull(expansion_polygon)
|
return convex_hull.getMinkowskiHull(expansion_polygon)
|
||||||
else:
|
else:
|
||||||
@ -331,4 +335,4 @@ class ConvexHullDecorator(SceneNodeDecorator):
|
|||||||
## Settings that change the convex hull.
|
## Settings that change the convex hull.
|
||||||
#
|
#
|
||||||
# If these settings change, the convex hull should be recalculated.
|
# If these settings change, the convex hull should be recalculated.
|
||||||
_influencing_settings = {"xy_offset"}
|
_influencing_settings = {"xy_offset", "mold_enabled", "mold_width"}
|
@ -4122,6 +4122,40 @@
|
|||||||
"settable_per_meshgroup": false,
|
"settable_per_meshgroup": false,
|
||||||
"settable_globally": false
|
"settable_globally": false
|
||||||
},
|
},
|
||||||
|
"mold_enabled":
|
||||||
|
{
|
||||||
|
"label": "Mold",
|
||||||
|
"description": "Print models as a mold, which can be cast in order to get a model which resembles the models on the build plate.",
|
||||||
|
"type": "bool",
|
||||||
|
"default_value": false,
|
||||||
|
"settable_per_mesh": true
|
||||||
|
},
|
||||||
|
"mold_width":
|
||||||
|
{
|
||||||
|
"label": "Minimal Mold Width",
|
||||||
|
"description": "The minimal distance between the ouside of the mold and the outside of the model.",
|
||||||
|
"unit": "mm",
|
||||||
|
"type": "float",
|
||||||
|
"minimum_value_warning": "wall_line_width_0 * 2",
|
||||||
|
"maximum_value_warning": "100",
|
||||||
|
"default_value": 5,
|
||||||
|
"settable_per_mesh": true,
|
||||||
|
"enabled": "mold_enabled"
|
||||||
|
},
|
||||||
|
"mold_angle":
|
||||||
|
{
|
||||||
|
"label": "Mold Angle",
|
||||||
|
"description": "The angle of overhang of the outer walls created for the mold. 0° will make the outer shell of the mold vertical, while 90° will make the outside of the model follow the contour of the model.",
|
||||||
|
"unit": "°",
|
||||||
|
"type": "float",
|
||||||
|
"minimum_value": "-89",
|
||||||
|
"minimum_value_warning": "0",
|
||||||
|
"maximum_value_warning": "support_angle",
|
||||||
|
"maximum_value": "90",
|
||||||
|
"default_value": 40,
|
||||||
|
"settable_per_mesh": true,
|
||||||
|
"enabled": "mold_enabled"
|
||||||
|
},
|
||||||
"infill_mesh_order":
|
"infill_mesh_order":
|
||||||
{
|
{
|
||||||
"label": "Infill Mesh Order",
|
"label": "Infill Mesh Order",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user