mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 16:42:43 +00:00
Initial work for custom bed shape
This commit is contained in:
@@ -11,11 +11,8 @@ PrintConfigDef::build_def() {
|
||||
Options["avoid_crossing_perimeters"].tooltip = "Optimize travel moves in order to minimize the crossing of perimeters. This is mostly useful with Bowden extruders which suffer from oozing. This feature slows down both the print and the G-code generation.";
|
||||
Options["avoid_crossing_perimeters"].cli = "avoid-crossing-perimeters!";
|
||||
|
||||
Options["bed_size"].type = coPoint;
|
||||
Options["bed_size"].label = "Bed size";
|
||||
Options["bed_size"].tooltip = "Size of your bed. This is used to adjust the preview in the plater and for auto-arranging parts in it.";
|
||||
Options["bed_size"].sidetext = "mm";
|
||||
Options["bed_size"].cli = "bed-size=s";
|
||||
Options["bed_shape"].type = coPoints;
|
||||
Options["bed_shape"].label = "Bed shape";
|
||||
|
||||
Options["bed_temperature"].type = coInt;
|
||||
Options["bed_temperature"].label = "Other layers";
|
||||
|
||||
@@ -307,7 +307,7 @@ class PrintConfig : public virtual StaticPrintConfig
|
||||
{
|
||||
public:
|
||||
ConfigOptionBool avoid_crossing_perimeters;
|
||||
ConfigOptionPoint bed_size;
|
||||
ConfigOptionPoints bed_shape;
|
||||
ConfigOptionInt bed_temperature;
|
||||
ConfigOptionFloat bridge_acceleration;
|
||||
ConfigOptionInt bridge_fan_speed;
|
||||
@@ -378,7 +378,10 @@ class PrintConfig : public virtual StaticPrintConfig
|
||||
|
||||
PrintConfig() : StaticPrintConfig() {
|
||||
this->avoid_crossing_perimeters.value = false;
|
||||
this->bed_size.point = Pointf(200,200);
|
||||
this->bed_shape.values.push_back(Pointf(0,0));
|
||||
this->bed_shape.values.push_back(Pointf(200,0));
|
||||
this->bed_shape.values.push_back(Pointf(200,200));
|
||||
this->bed_shape.values.push_back(Pointf(0,200));
|
||||
this->bed_temperature.value = 0;
|
||||
this->bridge_acceleration.value = 0;
|
||||
this->bridge_fan_speed.value = 100;
|
||||
@@ -466,7 +469,7 @@ class PrintConfig : public virtual StaticPrintConfig
|
||||
|
||||
ConfigOption* option(const t_config_option_key opt_key, bool create = false) {
|
||||
if (opt_key == "avoid_crossing_perimeters") return &this->avoid_crossing_perimeters;
|
||||
if (opt_key == "bed_size") return &this->bed_size;
|
||||
if (opt_key == "bed_shape") return &this->bed_shape;
|
||||
if (opt_key == "bed_temperature") return &this->bed_temperature;
|
||||
if (opt_key == "bridge_acceleration") return &this->bridge_acceleration;
|
||||
if (opt_key == "bridge_fan_speed") return &this->bridge_fan_speed;
|
||||
|
||||
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 34;
|
||||
use Test::More tests => 39;
|
||||
|
||||
use constant PI => 4 * atan2(1, 1);
|
||||
use constant EPSILON => 1E-4;
|
||||
@@ -40,10 +40,17 @@ isa_ok $line->[0], 'Slic3r::Point::Ref', 'line point is blessed';
|
||||
], 'translate';
|
||||
}
|
||||
|
||||
{
|
||||
ok +Slic3r::Line->new([0,0],[200,0])->parallel_to_line(Slic3r::Line->new([200,200],[0,200])), 'parallel_to';
|
||||
}
|
||||
|
||||
foreach my $base_angle (0, PI/4, PI/2, PI) {
|
||||
my $line = Slic3r::Line->new([0,0], [100,0]);
|
||||
$line->rotate($base_angle, [0,0]);
|
||||
ok $line->parallel_to_line($line->clone), 'line is parallel to self';
|
||||
my $clone = $line->clone;
|
||||
ok $line->parallel_to_line($clone), 'line is parallel to self';
|
||||
$clone->reverse;
|
||||
ok $line->parallel_to_line($clone), 'line is parallel to self + PI';
|
||||
ok $line->parallel_to($line->direction), 'line is parallel to its direction';
|
||||
ok $line->parallel_to($line->direction + PI), 'line is parallel to its direction + PI';
|
||||
ok $line->parallel_to($line->direction - PI), 'line is parallel to its direction - PI';
|
||||
|
||||
Reference in New Issue
Block a user