mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 08:32:42 +00:00
Ported Flow to XS
This commit is contained in:
@@ -4,7 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 88;
|
||||
use Test::More tests => 89;
|
||||
|
||||
foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
|
||||
$config->set('layer_height', 0.3);
|
||||
@@ -110,6 +110,9 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
|
||||
my $config2 = Slic3r::Config->new;
|
||||
$config2->apply_static($config);
|
||||
is $config2->get('perimeters'), Slic3r::Config::print_config_def()->{perimeters}{default}, 'apply_static and print_config_def';
|
||||
|
||||
$config->set('top_solid_infill_speed', 70);
|
||||
is $config->get_abs_value('top_solid_infill_speed'), 70, 'get_abs_value() works when ratio_over references a floatOrPercent option';
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
29
xs/t/16_flow.t
Normal file
29
xs/t/16_flow.t
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 2;
|
||||
|
||||
{
|
||||
my $flow = Slic3r::Flow->new_from_width(
|
||||
role => Slic3r::Flow::FLOW_ROLE_PERIMETER,
|
||||
width => '1',
|
||||
nozzle_diameter => 0.5,
|
||||
layer_height => 0.3,
|
||||
bridge_flow_ratio => 1,
|
||||
);
|
||||
isa_ok $flow, 'Slic3r::Flow', 'new_from_width';
|
||||
}
|
||||
|
||||
{
|
||||
my $flow = Slic3r::Flow->new(
|
||||
width => 1,
|
||||
spacing => 0.95,
|
||||
nozzle_diameter => 0.5,
|
||||
);
|
||||
isa_ok $flow, 'Slic3r::Flow', 'new';
|
||||
}
|
||||
|
||||
__END__
|
||||
Reference in New Issue
Block a user