From 7100c84136496d6d0284db15a22fcd6464b3ce31 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 21 Oct 2016 14:14:06 +0200 Subject: [PATCH 1/4] JSON feat: cubic subdivision settings (CURA-2602) --- resources/definitions/fdmprinter.def.json | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 1962476424..b742847894 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1001,6 +1001,7 @@ "lines": "Lines", "triangles": "Triangles", "cubic": "Cubic", + "cubicsubdiv": "Cubic Subdivision", "tetrahedral": "Tetrahedral", "concentric": "Concentric", "concentric_3d": "Concentric 3D", @@ -1011,6 +1012,31 @@ "value": "'lines' if infill_sparse_density > 25 else 'grid'", "settable_per_mesh": true }, + "sub_div_rad_mult": + { + "label": "Cubic Subdivision Radius", + "description": "A multiplier on the radius from the center of each cube to check for the boundary of the model, as to decide whether this cube should be subdivided. Larger values lead to more subdivisions, i.e. more small cubes.", + "unit": "%", + "type": "float", + "default_value": 100, + "minimum_value": "0", + "maximum_value_warning": "200", + "enabled": "infill_sparse_density > 0 and infill_pattern == 'cubicsubdiv'", + "settable_per_mesh": true + }, + "sub_div_rad_add": + { + "label": "Cubic Subdivision Shell", + "description": "An addition to the radius from the center of each cube to check for the boundary of the model, as to decide whether this cube should be subdivided. Larger values lead to a thicker shell of small cubes near the boundary of the model.", + "unit": "mm", + "type": "float", + "default_value": 0.4, + "value": "wall_line_width_x", + "minimum_value_warning": "-1 * infill_line_distance", + "maximum_value_warning": "5 * infill_line_distance", + "enabled": "infill_sparse_density > 0 and infill_pattern == 'cubicsubdiv'", + "settable_per_mesh": true + }, "infill_overlap": { "label": "Infill Overlap Percentage", From b441b1afb02e2a55916747e433ee8c0c41ba4ce5 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 21 Nov 2016 17:18:22 +0100 Subject: [PATCH 2/4] JSON fix: add a min value warning for cubicsubdiv radius < 100% (CURA-2602) --- resources/definitions/fdmprinter.def.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b742847894..1b2164cdbc 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1020,6 +1020,7 @@ "type": "float", "default_value": 100, "minimum_value": "0", + "minimum_value_warning": "100", "maximum_value_warning": "200", "enabled": "infill_sparse_density > 0 and infill_pattern == 'cubicsubdiv'", "settable_per_mesh": true From 389bdd3c1bcd9f7b8b32ae4b5a53c84c5fd353d7 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 28 Nov 2016 15:05:22 +0100 Subject: [PATCH 3/4] JSOn fix: use cubicsubdiv when determining the infill line distance (CURA-2602) --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 1b2164cdbc..dc72766112 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -985,7 +985,7 @@ "default_value": 2, "minimum_value": "0", "minimum_value_warning": "infill_line_width", - "value": "0 if infill_sparse_density == 0 else (infill_line_width * 100) / infill_sparse_density * (2 if infill_pattern == 'grid' else (3 if infill_pattern == 'triangles' or infill_pattern == 'cubic' else (4 if infill_pattern == 'tetrahedral' else 1)))", + "value": "0 if infill_sparse_density == 0 else (infill_line_width * 100) / infill_sparse_density * (2 if infill_pattern == 'grid' else (3 if infill_pattern == 'triangles' or infill_pattern == 'cubic' or infill_pattern == 'cubicsubdiv' else (4 if infill_pattern == 'tetrahedral' else 1)))", "settable_per_mesh": true } } From 5db582437783517722963fa342e32307d8289bb8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 28 Nov 2016 17:34:16 +0100 Subject: [PATCH 4/4] Hide gradual infill when cubic subdivision infill pattern is selected The setting has no effect then, so it doesn't matter what the value is while it's hidden either. Contributes to issue CURA-2602. --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index dc72766112..104ab5ecd2 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1132,7 +1132,7 @@ "minimum_value": "0", "maximum_value_warning": "4", "maximum_value": "20 - math.log(infill_line_distance) / math.log(2)", - "enabled": "infill_sparse_density > 0", + "enabled": "infill_sparse_density > 0 and infill_pattern != 'cubicsubdiv'", "settable_per_mesh": true }, "gradual_infill_step_height": @@ -1145,7 +1145,7 @@ "minimum_value": "0.0001", "minimum_value_warning": "3 * resolveOrValue('layer_height')", "maximum_value_warning": "100", - "enabled": "infill_sparse_density > 0 and gradual_infill_steps > 0", + "enabled": "infill_sparse_density > 0 and gradual_infill_steps > 0 and infill_pattern != 'cubicsubdiv'", "settable_per_mesh": true }, "infill_before_walls":