Added a couple unit tests
This commit is contained in:
parent
68f001a7de
commit
660eedfa5b
1
MANIFEST
1
MANIFEST
@ -45,6 +45,7 @@ t/arcs.t
|
|||||||
t/clean_polylines.t
|
t/clean_polylines.t
|
||||||
t/clipper.t
|
t/clipper.t
|
||||||
t/collinear.t
|
t/collinear.t
|
||||||
|
t/fill.t
|
||||||
t/geometry.t
|
t/geometry.t
|
||||||
t/polyclip.t
|
t/polyclip.t
|
||||||
t/stl.t
|
t/stl.t
|
||||||
|
@ -449,6 +449,7 @@ sub validate {
|
|||||||
|
|
||||||
Slic3r::debugf "Flow width = $Slic3r::flow_width\n";
|
Slic3r::debugf "Flow width = $Slic3r::flow_width\n";
|
||||||
Slic3r::debugf "Flow spacing = $Slic3r::flow_spacing\n";
|
Slic3r::debugf "Flow spacing = $Slic3r::flow_spacing\n";
|
||||||
|
Slic3r::debugf "Min flow spacing = $Slic3r::min_flow_spacing\n";
|
||||||
|
|
||||||
# --perimeters
|
# --perimeters
|
||||||
die "Invalid value for --perimeters\n"
|
die "Invalid value for --perimeters\n"
|
||||||
|
30
t/fill.t
Normal file
30
t/fill.t
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
use Test::More;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
plan tests => 2;
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
use FindBin;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
}
|
||||||
|
|
||||||
|
use Slic3r;
|
||||||
|
|
||||||
|
my $print = Slic3r::Print->new(
|
||||||
|
x_length => 50,
|
||||||
|
y_length => 50,
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
my $filler = Slic3r::Fill::Rectilinear->new(print => $print);
|
||||||
|
my $surface_width = 250;
|
||||||
|
my $distance = $filler->adjust_solid_spacing(
|
||||||
|
width => $surface_width,
|
||||||
|
distance => 100,
|
||||||
|
);
|
||||||
|
is $distance, 125, 'adjusted solid distance';
|
||||||
|
is $surface_width % $distance, 0, 'adjusted solid distance';
|
||||||
|
}
|
||||||
|
|
||||||
|
__END__
|
Loading…
Reference in New Issue
Block a user