mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-28 09:22:01 +08:00
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:
parent
8dc6eca03f
commit
4fa6251dd5
@ -457,7 +457,8 @@ sub options {
|
||||
brim_connections_width brim_width interior_brim_width
|
||||
support_material support_material_threshold support_material_max_layers support_material_enforce_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_contact_distance support_material_buildplate_only dont_support_bridges
|
||||
notes
|
||||
@ -612,6 +613,8 @@ sub build {
|
||||
$optgroup->append_single_option_line('support_material_pattern');
|
||||
$optgroup->append_single_option_line('support_material_spacing');
|
||||
$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_spacing');
|
||||
$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_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)
|
||||
for qw(support_material_threshold support_material_pattern
|
||||
support_material_spacing support_material_angle
|
||||
@ -949,6 +953,10 @@ sub _update {
|
||||
# Disable features that need support to be enabled.
|
||||
$self->get_field($_)->toggle($config->support_material)
|
||||
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)
|
||||
for qw(support_material_interface_spacing support_material_interface_extruder
|
||||
|
@ -22,10 +22,6 @@ use constant DEBUG_CONTACT_ONLY => 0;
|
||||
# increment used to reach MARGIN in steps to avoid trespassing thin objects
|
||||
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 {
|
||||
# $object is Slic3r::Print::Object
|
||||
my ($self, $object) = @_;
|
||||
@ -911,8 +907,8 @@ sub generate_pillars_shape {
|
||||
# this prevents supplying an empty point set to BoundingBox constructor
|
||||
return if !%$contact;
|
||||
|
||||
my $pillar_size = scale PILLAR_SIZE;
|
||||
my $pillar_spacing = scale PILLAR_SPACING;
|
||||
my $pillar_size = scale $self->object_config->support_material_pillar_size;
|
||||
my $pillar_spacing = scale $self->object_config->support_material_pillar_spacing;
|
||||
|
||||
my $grid; # arrayref of polygons
|
||||
{
|
||||
|
0
package/common/util.sh
Normal file → Executable file
0
package/common/util.sh
Normal file → Executable file
0
package/linux/startup_script.sh
Normal file → Executable file
0
package/linux/startup_script.sh
Normal file → Executable file
0
package/osx/plist.sh
Normal file → Executable file
0
package/osx/plist.sh
Normal file → Executable file
0
package/osx/startup_script.sh
Normal file → Executable file
0
package/osx/startup_script.sh
Normal file → Executable file
@ -486,6 +486,10 @@ $j
|
||||
Pattern to use for support material (default: $config->{support_material_pattern})
|
||||
--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 in degrees (range: 0-90, default: $config->{support_material_angle})
|
||||
--support-material-contact-distance
|
||||
|
@ -1502,6 +1502,24 @@ PrintConfigDef::PrintConfigDef()
|
||||
def->enum_labels.push_back("pillars");
|
||||
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->label = "Pattern spacing";
|
||||
def->category = "Support material";
|
||||
|
@ -181,6 +181,8 @@ class PrintObjectConfig : public virtual StaticPrintConfig
|
||||
ConfigOptionFloat support_material_interface_spacing;
|
||||
ConfigOptionFloatOrPercent support_material_interface_speed;
|
||||
ConfigOptionEnum<SupportMaterialPattern> support_material_pattern;
|
||||
ConfigOptionFloat support_material_pillar_size;
|
||||
ConfigOptionFloat support_material_pillar_spacing;
|
||||
ConfigOptionFloat support_material_spacing;
|
||||
ConfigOptionFloat support_material_speed;
|
||||
ConfigOptionFloatOrPercent support_material_threshold;
|
||||
@ -219,6 +221,8 @@ class PrintObjectConfig : public virtual StaticPrintConfig
|
||||
OPT_PTR(support_material_interface_spacing);
|
||||
OPT_PTR(support_material_interface_speed);
|
||||
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_speed);
|
||||
OPT_PTR(support_material_threshold);
|
||||
|
@ -251,6 +251,8 @@ PrintObject::invalidate_state_by_config(const PrintConfigBase &config)
|
||||
|| opt_key == "support_material_pattern"
|
||||
|| opt_key == "support_material_spacing"
|
||||
|| opt_key == "support_material_threshold"
|
||||
|| opt_key == "support_material_pillar_size"
|
||||
|| opt_key == "support_material_pillar_spacing"
|
||||
|| opt_key == "dont_support_bridges") {
|
||||
steps.insert(posSupportMaterial);
|
||||
} else if (opt_key == "interface_shells"
|
||||
|
Loading…
x
Reference in New Issue
Block a user