mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 04:31:17 -07:00
New support material pattern: pillars!
This commit is contained in:
parent
499b34dea1
commit
3e93a14912
3 changed files with 122 additions and 7 deletions
|
|
@ -14,6 +14,10 @@ enum InfillPattern {
|
|||
ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral,
|
||||
};
|
||||
|
||||
enum SupportMaterialPattern {
|
||||
smpRectilinear, smpRectilinearGrid, smpHoneycomb, smpPillars,
|
||||
};
|
||||
|
||||
template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
|
||||
t_config_enum_values keys_map;
|
||||
keys_map["reprap"] = gcfRepRap;
|
||||
|
|
@ -37,6 +41,15 @@ template<> inline t_config_enum_values ConfigOptionEnum<InfillPattern>::get_enum
|
|||
return keys_map;
|
||||
}
|
||||
|
||||
template<> inline t_config_enum_values ConfigOptionEnum<SupportMaterialPattern>::get_enum_values() {
|
||||
t_config_enum_values keys_map;
|
||||
keys_map["rectilinear"] = smpRectilinear;
|
||||
keys_map["rectilinear-grid"] = smpRectilinearGrid;
|
||||
keys_map["honeycomb"] = smpHoneycomb;
|
||||
keys_map["pillars"] = smpPillars;
|
||||
return keys_map;
|
||||
}
|
||||
|
||||
class PrintConfigDef
|
||||
{
|
||||
public:
|
||||
|
|
@ -758,12 +771,15 @@ class PrintConfigDef
|
|||
Options["support_material_pattern"].tooltip = "Pattern used to generate support material.";
|
||||
Options["support_material_pattern"].cli = "support-material-pattern=s";
|
||||
Options["support_material_pattern"].scope = "object";
|
||||
Options["support_material_pattern"].enum_keys_map = ConfigOptionEnum<SupportMaterialPattern>::get_enum_values();
|
||||
Options["support_material_pattern"].enum_values.push_back("rectilinear");
|
||||
Options["support_material_pattern"].enum_values.push_back("rectilinear-grid");
|
||||
Options["support_material_pattern"].enum_values.push_back("honeycomb");
|
||||
Options["support_material_pattern"].enum_values.push_back("pillars");
|
||||
Options["support_material_pattern"].enum_labels.push_back("rectilinear");
|
||||
Options["support_material_pattern"].enum_labels.push_back("rectilinear grid");
|
||||
Options["support_material_pattern"].enum_labels.push_back("honeycomb");
|
||||
Options["support_material_pattern"].enum_labels.push_back("pillars");
|
||||
|
||||
Options["support_material_spacing"].type = coFloat;
|
||||
Options["support_material_spacing"].label = "Pattern spacing";
|
||||
|
|
@ -894,7 +910,7 @@ class PrintObjectConfig : public virtual StaticConfig
|
|||
ConfigOptionInt support_material_interface_extruder;
|
||||
ConfigOptionInt support_material_interface_layers;
|
||||
ConfigOptionFloat support_material_interface_spacing;
|
||||
ConfigOptionEnum<InfillPattern> support_material_pattern;
|
||||
ConfigOptionEnum<SupportMaterialPattern> support_material_pattern;
|
||||
ConfigOptionFloat support_material_spacing;
|
||||
ConfigOptionFloat support_material_speed;
|
||||
ConfigOptionInt support_material_threshold;
|
||||
|
|
@ -918,7 +934,7 @@ class PrintObjectConfig : public virtual StaticConfig
|
|||
this->support_material_interface_extruder.value = 1;
|
||||
this->support_material_interface_layers.value = 3;
|
||||
this->support_material_interface_spacing.value = 0;
|
||||
this->support_material_pattern.value = ipHoneycomb;
|
||||
this->support_material_pattern.value = smpHoneycomb;
|
||||
this->support_material_spacing.value = 2.5;
|
||||
this->support_material_speed.value = 60;
|
||||
this->support_material_threshold.value = 0;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 89;
|
||||
use Test::More tests => 91;
|
||||
|
||||
foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
|
||||
$config->set('layer_height', 0.3);
|
||||
|
|
@ -47,10 +47,13 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
|
|||
is $config->get('gcode_flavor'), 'teacup', 'set/get enum';
|
||||
is $config->serialize('gcode_flavor'), 'teacup', 'serialize enum';
|
||||
$config->set_deserialize('gcode_flavor', 'mach3');
|
||||
is $config->get('gcode_flavor'), 'mach3', 'deserialize enum';
|
||||
is $config->get('gcode_flavor'), 'mach3', 'deserialize enum (gcode_flavor)';
|
||||
|
||||
$config->set_deserialize('fill_pattern', 'line');
|
||||
is $config->get('fill_pattern'), 'line', 'deserialize enum';
|
||||
is $config->get('fill_pattern'), 'line', 'deserialize enum (fill_pattern)';
|
||||
|
||||
$config->set_deserialize('support_material_pattern', 'pillars');
|
||||
is $config->get('support_material_pattern'), 'pillars', 'deserialize enum (support_material_pattern)';
|
||||
|
||||
$config->set('extruder_offset', [[10,20],[30,45]]);
|
||||
is_deeply $config->get('extruder_offset'), [[10,20],[30,45]], 'set/get points';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue