Pillar config (#4410)

Implements workaround for #4407 

* Added support for pillar size configuration.
* Pillars UI fix
* Pillar configuration fix
* Fixed misspelled variable name.
* Strings are not numbers.
* Fixed pillar spacing label.
This commit is contained in:
Jacob Greenfield 2018-05-12 21:03:50 -04:00 committed by Joseph Lenox
parent 8dc6eca03f
commit 4fa6251dd5
11 changed files with 39 additions and 7 deletions

0
Build.PL Normal file → Executable file
View File

View File

@ -458,6 +458,7 @@ sub options {
support_material support_material_threshold support_material_max_layers support_material_enforce_layers support_material support_material_threshold support_material_max_layers support_material_enforce_layers
raft_layers raft_layers
support_material_pattern support_material_spacing support_material_angle support_material_pattern support_material_spacing support_material_angle
support_material_pillar_size support_material_pillar_spacing
support_material_interface_layers support_material_interface_spacing support_material_interface_layers support_material_interface_spacing
support_material_contact_distance support_material_buildplate_only dont_support_bridges support_material_contact_distance support_material_buildplate_only dont_support_bridges
notes notes
@ -612,6 +613,8 @@ sub build {
$optgroup->append_single_option_line('support_material_pattern'); $optgroup->append_single_option_line('support_material_pattern');
$optgroup->append_single_option_line('support_material_spacing'); $optgroup->append_single_option_line('support_material_spacing');
$optgroup->append_single_option_line('support_material_angle'); $optgroup->append_single_option_line('support_material_angle');
$optgroup->append_single_option_line('support_material_pillar_size');
$optgroup->append_single_option_line('support_material_pillar_spacing');
$optgroup->append_single_option_line('support_material_interface_layers'); $optgroup->append_single_option_line('support_material_interface_layers');
$optgroup->append_single_option_line('support_material_interface_spacing'); $optgroup->append_single_option_line('support_material_interface_spacing');
$optgroup->append_single_option_line('support_material_buildplate_only'); $optgroup->append_single_option_line('support_material_buildplate_only');
@ -939,6 +942,7 @@ sub _update {
my $have_support_material = $config->support_material || $config->raft_layers > 0; my $have_support_material = $config->support_material || $config->raft_layers > 0;
my $have_support_interface = $config->support_material_interface_layers > 0; my $have_support_interface = $config->support_material_interface_layers > 0;
my $have_support_pillars = $have_support_material && $config->support_material_pattern eq 'pillars';
$self->get_field($_)->toggle($have_support_material) $self->get_field($_)->toggle($have_support_material)
for qw(support_material_threshold support_material_pattern for qw(support_material_threshold support_material_pattern
support_material_spacing support_material_angle support_material_spacing support_material_angle
@ -950,6 +954,10 @@ sub _update {
$self->get_field($_)->toggle($config->support_material) $self->get_field($_)->toggle($config->support_material)
for qw(support_material_max_layers); for qw(support_material_max_layers);
# Only enable pillar configuration when using pillars
$self->get_field($_)->toggle($have_support_pillars)
for qw(support_material_pillar_size support_material_pillar_spacing);
$self->get_field($_)->toggle($have_support_material && $have_support_interface) $self->get_field($_)->toggle($have_support_material && $have_support_interface)
for qw(support_material_interface_spacing support_material_interface_extruder for qw(support_material_interface_spacing support_material_interface_extruder
support_material_interface_speed); support_material_interface_speed);

View File

@ -22,10 +22,6 @@ use constant DEBUG_CONTACT_ONLY => 0;
# increment used to reach MARGIN in steps to avoid trespassing thin objects # increment used to reach MARGIN in steps to avoid trespassing thin objects
use constant MARGIN_STEP => MARGIN/3; use constant MARGIN_STEP => MARGIN/3;
# generate a tree-like structure to save material
use constant PILLAR_SIZE => 2.5;
use constant PILLAR_SPACING => 10;
sub generate { sub generate {
# $object is Slic3r::Print::Object # $object is Slic3r::Print::Object
my ($self, $object) = @_; my ($self, $object) = @_;
@ -911,8 +907,8 @@ sub generate_pillars_shape {
# this prevents supplying an empty point set to BoundingBox constructor # this prevents supplying an empty point set to BoundingBox constructor
return if !%$contact; return if !%$contact;
my $pillar_size = scale PILLAR_SIZE; my $pillar_size = scale $self->object_config->support_material_pillar_size;
my $pillar_spacing = scale PILLAR_SPACING; my $pillar_spacing = scale $self->object_config->support_material_pillar_spacing;
my $grid; # arrayref of polygons my $grid; # arrayref of polygons
{ {

0
package/common/util.sh Normal file → Executable file
View File

0
package/linux/startup_script.sh Normal file → Executable file
View File

0
package/osx/plist.sh Normal file → Executable file
View File

0
package/osx/startup_script.sh Normal file → Executable file
View File

View File

@ -486,6 +486,10 @@ $j
Pattern to use for support material (default: $config->{support_material_pattern}) Pattern to use for support material (default: $config->{support_material_pattern})
--support-material-spacing --support-material-spacing
Spacing between pattern lines (mm, default: $config->{support_material_spacing}) Spacing between pattern lines (mm, default: $config->{support_material_spacing})
--support-material-pillar-size
Size of the pillars in the pillar support pattern (default: $config->{support_material_pillar_size})
--support-material-pillar-spacing
Spacing between the pillars in the pillar support pattern (default: $config->{support_material_pillar_spacing})
--support-material-angle --support-material-angle
Support material angle in degrees (range: 0-90, default: $config->{support_material_angle}) Support material angle in degrees (range: 0-90, default: $config->{support_material_angle})
--support-material-contact-distance --support-material-contact-distance

View File

@ -1502,6 +1502,24 @@ PrintConfigDef::PrintConfigDef()
def->enum_labels.push_back("pillars"); def->enum_labels.push_back("pillars");
def->default_value = new ConfigOptionEnum<SupportMaterialPattern>(smpPillars); def->default_value = new ConfigOptionEnum<SupportMaterialPattern>(smpPillars);
def = this->add("support_material_pillar_size", coFloat);
def->label = "Pillar size";
def->category = "Support material";
def->tooltip = "Size of the pillars in the pillar support pattern";
def->sidetext = "mm";
def->cli = "support-material-pillar-size=f";
def->min = 0;
def->default_value = new ConfigOptionFloat(2.5);
def = this->add("support_material_pillar_spacing", coFloat);
def->label = "Pillar spacing";
def->category = "Support material";
def->tooltip = "Spacing between pillars in the pillar support pattern";
def->sidetext = "mm";
def->cli = "support-material-pillar-spacing=f";
def->min = 0;
def->default_value = new ConfigOptionFloat(10);
def = this->add("support_material_spacing", coFloat); def = this->add("support_material_spacing", coFloat);
def->label = "Pattern spacing"; def->label = "Pattern spacing";
def->category = "Support material"; def->category = "Support material";

View File

@ -181,6 +181,8 @@ class PrintObjectConfig : public virtual StaticPrintConfig
ConfigOptionFloat support_material_interface_spacing; ConfigOptionFloat support_material_interface_spacing;
ConfigOptionFloatOrPercent support_material_interface_speed; ConfigOptionFloatOrPercent support_material_interface_speed;
ConfigOptionEnum<SupportMaterialPattern> support_material_pattern; ConfigOptionEnum<SupportMaterialPattern> support_material_pattern;
ConfigOptionFloat support_material_pillar_size;
ConfigOptionFloat support_material_pillar_spacing;
ConfigOptionFloat support_material_spacing; ConfigOptionFloat support_material_spacing;
ConfigOptionFloat support_material_speed; ConfigOptionFloat support_material_speed;
ConfigOptionFloatOrPercent support_material_threshold; ConfigOptionFloatOrPercent support_material_threshold;
@ -219,6 +221,8 @@ class PrintObjectConfig : public virtual StaticPrintConfig
OPT_PTR(support_material_interface_spacing); OPT_PTR(support_material_interface_spacing);
OPT_PTR(support_material_interface_speed); OPT_PTR(support_material_interface_speed);
OPT_PTR(support_material_pattern); OPT_PTR(support_material_pattern);
OPT_PTR(support_material_pillar_size);
OPT_PTR(support_material_pillar_spacing);
OPT_PTR(support_material_spacing); OPT_PTR(support_material_spacing);
OPT_PTR(support_material_speed); OPT_PTR(support_material_speed);
OPT_PTR(support_material_threshold); OPT_PTR(support_material_threshold);

View File

@ -251,6 +251,8 @@ PrintObject::invalidate_state_by_config(const PrintConfigBase &config)
|| opt_key == "support_material_pattern" || opt_key == "support_material_pattern"
|| opt_key == "support_material_spacing" || opt_key == "support_material_spacing"
|| opt_key == "support_material_threshold" || opt_key == "support_material_threshold"
|| opt_key == "support_material_pillar_size"
|| opt_key == "support_material_pillar_spacing"
|| opt_key == "dont_support_bridges") { || opt_key == "dont_support_bridges") {
steps.insert(posSupportMaterial); steps.insert(posSupportMaterial);
} else if (opt_key == "interface_shells" } else if (opt_key == "interface_shells"