diff options
author | remi durand <remi-j.durand@thalesgroup.com> | 2022-01-12 10:49:19 +0300 |
---|---|---|
committer | remi durand <remi-j.durand@thalesgroup.com> | 2022-01-12 10:49:19 +0300 |
commit | 6e0017ff8fc82ce66e65bcddd2285d48c1b6fb1c (patch) | |
tree | 07fa4bca6aa5dfb8fb3dcdeb8c5d691e443247dc /xs | |
parent | 42db5ca0d12e9a54b8c378dbf8ec12671566a9ec (diff) | |
parent | 215e845c31889f92f78e8be1d9ee52f6209a8082 (diff) |
Merge remote-tracking branch 'remotes/prusa/master' 2.4 into dev 2.3.58
still need much tests (& bugfixes) and finish some merging things.
Diffstat (limited to 'xs')
-rw-r--r-- | xs/lib/Slic3r/XS.pm | 3 | ||||
-rw-r--r-- | xs/t/01_trianglemesh.t | 110 | ||||
-rw-r--r-- | xs/t/04_expolygon.t | 30 | ||||
-rw-r--r-- | xs/t/06_polygon.t | 78 | ||||
-rw-r--r-- | xs/t/09_polyline.t | 70 | ||||
-rw-r--r-- | xs/t/15_config.t | 11 | ||||
-rw-r--r-- | xs/xsp/Clipper.xsp | 39 | ||||
-rw-r--r-- | xs/xsp/Config.xsp | 15 | ||||
-rw-r--r-- | xs/xsp/ExPolygon.xsp | 4 | ||||
-rw-r--r-- | xs/xsp/Flow.xsp | 21 | ||||
-rw-r--r-- | xs/xsp/GCode.xsp | 5 | ||||
-rw-r--r-- | xs/xsp/Geometry.xsp | 1 | ||||
-rw-r--r-- | xs/xsp/Layer.xsp | 7 | ||||
-rw-r--r-- | xs/xsp/Model.xsp | 11 | ||||
-rw-r--r-- | xs/xsp/Polyline.xsp | 6 | ||||
-rw-r--r-- | xs/xsp/Print.xsp | 23 | ||||
-rw-r--r-- | xs/xsp/Surface.xsp | 2 | ||||
-rw-r--r-- | xs/xsp/TriangleMesh.xsp | 157 | ||||
-rw-r--r-- | xs/xsp/XS.xsp | 6 | ||||
-rw-r--r-- | xs/xsp/my.map | 5 | ||||
-rw-r--r-- | xs/xsp/typemap.xspt | 1 |
21 files changed, 132 insertions, 473 deletions
diff --git a/xs/lib/Slic3r/XS.pm b/xs/lib/Slic3r/XS.pm index fa4dde43a..6d3bf35cf 100644 --- a/xs/lib/Slic3r/XS.pm +++ b/xs/lib/Slic3r/XS.pm @@ -158,7 +158,6 @@ sub new { my $self = $class->_new( @args{qw(width height nozzle_diameter)}, ); - $self->set_bridge($args{bridge} // 0); return $self; } @@ -166,7 +165,7 @@ sub new_from_width { my ($class, %args) = @_; return $class->_new_from_width( - @args{qw(role width nozzle_diameter layer_height bridge_flow_ratio)}, + @args{qw(role width nozzle_diameter layer_height)}, ); } diff --git a/xs/t/01_trianglemesh.t b/xs/t/01_trianglemesh.t index 4013a1f83..453cc9218 100644 --- a/xs/t/01_trianglemesh.t +++ b/xs/t/01_trianglemesh.t @@ -4,10 +4,7 @@ use strict; use warnings; use Slic3r::XS; -use Test::More tests => 49; - -is Slic3r::TriangleMesh::hello_world(), 'Hello world!', - 'hello world'; +use Test::More tests => 5; my $cube = { vertices => [ [20,20,0], [20,0,0], [0,0,0], [0,20,0], [20,20,20], [0,20,20], [0,0,20], [20,0,20] ], @@ -17,12 +14,10 @@ my $cube = { { my $m = Slic3r::TriangleMesh->new; $m->ReadFromPerl($cube->{vertices}, $cube->{facets}); - $m->repair; my ($vertices, $facets) = ($m->vertices, $m->facets); is_deeply $vertices, $cube->{vertices}, 'vertices arrayref roundtrip'; is_deeply $facets, $cube->{facets}, 'facets arrayref roundtrip'; - is scalar(@{$m->normals}), scalar(@$facets), 'normals returns the right number of items'; { my $m2 = $m->clone; @@ -34,109 +29,6 @@ my $cube = { { my $stats = $m->stats; is $stats->{number_of_facets}, scalar(@{ $cube->{facets} }), 'stats.number_of_facets'; - ok abs($stats->{volume} - 20*20*20) < 1E-2, 'stats.volume'; - } - - $m->scale(2); - ok abs($m->stats->{volume} - 40*40*40) < 1E-2, 'scale'; - - $m->scale_xyz(Slic3r::Pointf3->new(2,1,1)); - ok abs($m->stats->{volume} - 2*40*40*40) < 1E-2, 'scale_xyz'; - - $m->translate(5,10,0); - is_deeply $m->vertices->[0], [85,50,0], 'translate'; - - $m->align_to_origin; - is_deeply $m->vertices->[2], [0,0,0], 'align_to_origin'; - - is_deeply $m->size, [80,40,40], 'size'; - - $m->scale_xyz(Slic3r::Pointf3->new(0.5,1,1)); - $m->rotate(45, Slic3r::Point->new(20,20)); - ok abs($m->size->[0] - sqrt(2)*40) < 1E-4, 'rotate'; - - { - my $meshes = $m->split; - is scalar(@$meshes), 1, 'split'; - isa_ok $meshes->[0], 'Slic3r::TriangleMesh', 'split'; - is_deeply $m->bb3, $meshes->[0]->bb3, 'split populates stats'; - } - - my $m2 = Slic3r::TriangleMesh->new; - $m2->ReadFromPerl($cube->{vertices}, $cube->{facets}); - $m2->repair; - $m->merge($m2); - $m->repair; - is $m->stats->{number_of_facets}, 2 * $m2->stats->{number_of_facets}, 'merge'; - - { - my $meshes = $m->split; - is scalar(@$meshes), 2, 'split'; - } -} - -{ - my $m = Slic3r::TriangleMesh->new; - $m->ReadFromPerl($cube->{vertices}, $cube->{facets}); - $m->repair; - # The slice at zero height does not belong to the mesh, the slicing considers the vertical structures to be - # open intervals at the bottom end, closed at the top end. - my @z = (0.0001,2,4,8,6,8,10,12,14,16,18,20); - my $result = $m->slice(\@z); - my $SCALING_FACTOR = 0.000001; - for my $i (0..$#z) { - is scalar(@{$result->[$i]}), 1, "number of returned polygons per layer (z = " . $z[$i] . ")"; - is $result->[$i][0]->area, 20*20/($SCALING_FACTOR**2), 'size of returned polygon'; - } -} - -{ - my $m = Slic3r::TriangleMesh->new; - $m->ReadFromPerl( - [ [0,0,0],[0,0,20],[0,5,0],[0,5,20],[50,0,0],[50,0,20],[15,5,0],[35,5,0],[15,20,0],[50,5,0],[35,20,0],[15,5,10],[50,5,20],[35,5,10],[35,20,10],[15,20,10] ], - [ [0,1,2],[2,1,3],[1,0,4],[5,1,4],[0,2,4],[4,2,6],[7,6,8],[4,6,7],[9,4,7],[7,8,10],[2,3,6],[11,3,12],[7,12,9],[13,12,7],[6,3,11],[11,12,13],[3,1,5],[12,3,5],[5,4,9],[12,5,9],[13,7,10],[14,13,10],[8,15,10],[10,15,14],[6,11,8],[8,11,15],[15,11,13],[14,15,13] ], - ); - $m->repair; - { - # at Z = 10 we have a top horizontal surface - my $slices = $m->slice([ 5, 10 ]); - is $slices->[0][0]->area, $slices->[1][0]->area, 'slicing a top tangent plane includes its area'; - } - $m->mirror_z; - { - # this second test also checks that performing a second slice on a mesh after - # a transformation works properly (shared_vertices is correctly invalidated); - # at Z = -10 we have a bottom horizontal surface - # (The slice at zero height does not belong to the mesh, the slicing considers the vertical structures to be - # open intervals at the bottom end, closed at the top end, so the Z = -10 is shifted a bit up to get a valid slice). - my $slices = $m->slice([ -5, -10+0.00001 ]); - is $slices->[0][0]->area, $slices->[1][0]->area, 'slicing a bottom tangent plane includes its area'; - } -} - -{ - my $m = Slic3r::TriangleMesh->new; - $m->ReadFromPerl($cube->{vertices}, $cube->{facets}); - $m->repair; - { - my $upper = Slic3r::TriangleMesh->new; - my $lower = Slic3r::TriangleMesh->new; - $m->cut(0, $upper, $lower); - $upper->repair; $lower->repair; - is $upper->facets_count, 12, 'upper mesh has all facets except those belonging to the slicing plane'; - is $lower->facets_count, 0, 'lower mesh has no facets'; - } - { - my $upper = Slic3r::TriangleMesh->new; - my $lower = Slic3r::TriangleMesh->new; - $m->cut(10, $upper, $lower); - #$upper->repair; $lower->repair; - # we expect: - # 2 facets on external horizontal surfaces - # 3 facets on each side = 12 facets - # 6 facets on the triangulated side (8 vertices) - is $upper->facets_count, 2+12+6, 'upper mesh has the expected number of facets'; - is $lower->facets_count, 2+12+6, 'lower mesh has the expected number of facets'; } } diff --git a/xs/t/04_expolygon.t b/xs/t/04_expolygon.t index 39da22f0a..65e274ab9 100644 --- a/xs/t/04_expolygon.t +++ b/xs/t/04_expolygon.t @@ -5,7 +5,7 @@ use warnings; use List::Util qw(first sum); use Slic3r::XS; -use Test::More tests => 31; +use Test::More tests => 21; use constant PI => 4 * atan2(1, 1); @@ -105,32 +105,4 @@ is $expolygon->area, 100*100-20*20, 'area'; is_deeply $collection->[0]->clone->pp, $collection->[0]->pp, 'clone collection item'; } -{ - my $expolygon = Slic3r::ExPolygon->new($square); - my $polygons = $expolygon->get_trapezoids2(PI/2); - is scalar(@$polygons), 1, 'correct number of trapezoids returned'; - is scalar(@{$polygons->[0]}), 4, 'trapezoid has 4 points'; - is $polygons->[0]->area, $expolygon->area, 'trapezoid has correct area'; -} - -{ - my $polygons = $expolygon->get_trapezoids2(PI/2); - is scalar(@$polygons), 4, 'correct number of trapezoids returned'; - - # trapezoid polygons might have more than 4 points in case of collinear segments - $polygons = [ map @{$_->simplify(1)}, @$polygons ]; - ok !defined(first { @$_ != 4 } @$polygons), 'all trapezoids have 4 points'; - - is scalar(grep { $_->area == 40*100 } @$polygons), 2, 'trapezoids have expected area'; - is scalar(grep { $_->area == 20*40 } @$polygons), 2, 'trapezoids have expected area'; -} - -{ - my $expolygon = Slic3r::ExPolygon->new([ [0,100],[100,0],[200,0],[300,100],[200,200],[100,200] ]); - my $polygons = $expolygon->get_trapezoids2(PI/2); - is scalar(@$polygons), 3, 'correct number of trapezoids returned'; - is scalar(grep { $_->area == 100*200/2 } @$polygons), 2, 'trapezoids have expected area'; - is scalar(grep { $_->area == 100*200 } @$polygons), 1, 'trapezoids have expected area'; -} - __END__ diff --git a/xs/t/06_polygon.t b/xs/t/06_polygon.t index 779c7deec..7bbcd5356 100644 --- a/xs/t/06_polygon.t +++ b/xs/t/06_polygon.t @@ -3,11 +3,8 @@ use strict; use warnings; -use List::Util qw(first); use Slic3r::XS; -use Test::More tests => 21; - -use constant PI => 4 * atan2(1, 1); +use Test::More tests => 3; my $square = [ # ccw [100, 100], @@ -17,81 +14,8 @@ my $square = [ # ccw ]; my $polygon = Slic3r::Polygon->new(@$square); -my $cw_polygon = $polygon->clone; -$cw_polygon->reverse; - -ok $polygon->is_valid, 'is_valid'; -is_deeply $polygon->pp, $square, 'polygon roundtrip'; - is ref($polygon->arrayref), 'ARRAY', 'polygon arrayref is unblessed'; isa_ok $polygon->[0], 'Slic3r::Point::Ref', 'polygon point is blessed'; - -my $lines = $polygon->lines; -is_deeply [ map $_->pp, @$lines ], [ - [ [100, 100], [200, 100] ], - [ [200, 100], [200, 200] ], - [ [200, 200], [100, 200] ], - [ [100, 200], [100, 100] ], -], 'polygon lines'; - -is_deeply $polygon->split_at_first_point->pp, [ @$square[0,1,2,3,0] ], 'split_at_first_point'; -is_deeply $polygon->split_at_index(2)->pp, [ @$square[2,3,0,1,2] ], 'split_at_index'; -is_deeply $polygon->split_at_vertex(Slic3r::Point->new(@{$square->[2]}))->pp, [ @$square[2,3,0,1,2] ], 'split_at'; -is $polygon->area, 100*100, 'area'; - -ok $polygon->is_counter_clockwise, 'is_counter_clockwise'; -ok !$cw_polygon->is_counter_clockwise, 'is_counter_clockwise'; -{ - my $clone = $polygon->clone; - $clone->reverse; - ok !$clone->is_counter_clockwise, 'is_counter_clockwise'; - $clone->make_counter_clockwise; - ok $clone->is_counter_clockwise, 'make_counter_clockwise'; - $clone->make_counter_clockwise; - ok $clone->is_counter_clockwise, 'make_counter_clockwise'; -} - ok ref($polygon->first_point) eq 'Slic3r::Point', 'first_point'; -ok $polygon->contains_point(Slic3r::Point->new(150,150)), 'ccw contains_point'; -ok $cw_polygon->contains_point(Slic3r::Point->new(150,150)), 'cw contains_point'; - -{ - my @points = (Slic3r::Point->new(100,0)); - foreach my $i (1..5) { - my $point = $points[0]->clone; - $point->rotate(PI/3*$i, [0,0]); - push @points, $point; - } - my $hexagon = Slic3r::Polygon->new(@points); - my $triangles = $hexagon->triangulate_convex; - is scalar(@$triangles), 4, 'right number of triangles'; - ok !(defined first { $_->is_clockwise } @$triangles), 'all triangles are ccw'; -} - -{ - is_deeply $polygon->centroid->pp, [150,150], 'centroid'; -} - -{ - my $polygon = Slic3r::Polygon->new( - [50000000, 100000000], - [300000000, 102000000], - [50000000, 104000000], - ); - my $line = Slic3r::Line->new([175992032,102000000], [47983964,102000000]); - my $intersection = $polygon->intersection($line); - is_deeply $intersection->pp, [50000000, 102000000], 'polygon-line intersection'; -} - -# this is not a test: this just demonstrates bad usage, where $polygon->clone gets -# DESTROY'ed before the derived object ($point), causing bad memory access -if (0) { - my $point; - { - $point = $polygon->clone->[0]; - } - $point->scale(2); -} - __END__ diff --git a/xs/t/09_polyline.t b/xs/t/09_polyline.t index 0a7b8dcb0..5203ec5ef 100644 --- a/xs/t/09_polyline.t +++ b/xs/t/09_polyline.t @@ -89,40 +89,40 @@ is_deeply $polyline->pp, [ @$points, @$points ], 'append_polyline'; } # disabled because we now use a more efficient but incomplete algorithm -if (0) { - my $polyline = Slic3r::Polyline->new( - map [$_,10], (0,10,20,30,40,50,60) - ); - { - my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new( - [25,0], [55,0], [55,30], [25,30], - )); - my $p = $polyline->clone; - $p->simplify_by_visibility($expolygon); - is_deeply $p->pp, [ - map [$_,10], (0,10,20,30,50,60) - ], 'simplify_by_visibility()'; - } - { - my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new( - [-15,0], [75,0], [75,30], [-15,30], - )); - my $p = $polyline->clone; - $p->simplify_by_visibility($expolygon); - is_deeply $p->pp, [ - map [$_,10], (0,60) - ], 'simplify_by_visibility()'; - } - { - my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new( - [-15,0], [25,0], [25,30], [-15,30], - )); - my $p = $polyline->clone; - $p->simplify_by_visibility($expolygon); - is_deeply $p->pp, [ - map [$_,10], (0,20,30,40,50,60) - ], 'simplify_by_visibility()'; - } -} +#if (0) { +# my $polyline = Slic3r::Polyline->new( +# map [$_,10], (0,10,20,30,40,50,60) +# ); +# { +# my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new( +# [25,0], [55,0], [55,30], [25,30], +# )); +# my $p = $polyline->clone; +# $p->simplify_by_visibility($expolygon); +# is_deeply $p->pp, [ +# map [$_,10], (0,10,20,30,50,60) +# ], 'simplify_by_visibility()'; +# } +# { +# my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new( +# [-15,0], [75,0], [75,30], [-15,30], +# )); +# my $p = $polyline->clone; +# $p->simplify_by_visibility($expolygon); +# is_deeply $p->pp, [ +# map [$_,10], (0,60) +# ], 'simplify_by_visibility()'; +# } +# { +# my $expolygon = Slic3r::ExPolygon->new(Slic3r::Polygon->new( +# [-15,0], [25,0], [25,30], [-15,30], +# )); +# my $p = $polyline->clone; +# $p->simplify_by_visibility($expolygon); +# is_deeply $p->pp, [ +# map [$_,10], (0,20,30,40,50,60) +# ], 'simplify_by_visibility()'; +# } +#} __END__ diff --git a/xs/t/15_config.t b/xs/t/15_config.t index 55b679101..4d032019c 100644 --- a/xs/t/15_config.t +++ b/xs/t/15_config.t @@ -4,7 +4,7 @@ use strict; use warnings; use Slic3r::XS; -use Test::More tests => 147; +use Test::More tests => 143; foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintConfig) { $config->set('layer_height', 0.3); @@ -70,10 +70,11 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintCo ok abs($config->get('first_layer_height') - 0.3) < 1e-4, 'set/get absolute floatOrPercent'; is $config->opt_serialize('first_layer_height'), '0.3', 'serialize absolute floatOrPercent'; - $config->set('first_layer_height', '50%'); - $config->get_abs_value('first_layer_height'); - ok abs($config->get_abs_value('first_layer_height') - 0.15) < 1e-4, 'set/get relative floatOrPercent'; - is $config->opt_serialize('first_layer_height'), '50%', 'serialize relative floatOrPercent'; +# This is no more supported after first_layer_height was moved from PrintObjectConfig to PrintConfig. +# $config->set('first_layer_height', $config->get('layer_height')); +# $config->get_abs_value('first_layer_height'); +# ok abs($config->get_abs_value('first_layer_height') - 0.15) < 1e-4, 'set/get relative floatOrPercent'; +# is $config->opt_serialize('first_layer_height'), '50%', 'serialize relative floatOrPercent'; # Uh-oh, we have no point option to test at the moment #ok $config->set('print_center', [50,80]), 'valid point coordinates'; diff --git a/xs/xsp/Clipper.xsp b/xs/xsp/Clipper.xsp index 277b59825..eae3afeff 100644 --- a/xs/xsp/Clipper.xsp +++ b/xs/xsp/Clipper.xsp @@ -2,7 +2,6 @@ %{ #include <xsinit.h> -#include "clipper.hpp" #include "libslic3r/ClipperUtils.hpp" %} @@ -21,10 +20,10 @@ _constant() OUTPUT: RETVAL Polygons -offset(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3) +offset(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3) Polygons polygons const float delta - ClipperLib::JoinType joinType + Slic3r::ClipperLib::JoinType joinType double miterLimit CODE: RETVAL = offset(polygons, delta, joinType, miterLimit); @@ -32,37 +31,25 @@ offset(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3) RETVAL ExPolygons -offset_ex(polygons, delta, joinType = ClipperLib::jtMiter, miterLimit = 3) +offset_ex(polygons, delta, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3) Polygons polygons const float delta - ClipperLib::JoinType joinType + Slic3r::ClipperLib::JoinType joinType double miterLimit CODE: RETVAL = offset_ex(polygons, delta, joinType, miterLimit); OUTPUT: RETVAL -Polygons -offset2(polygons, delta1, delta2, joinType = ClipperLib::jtMiter, miterLimit = 3) - Polygons polygons - const float delta1 - const float delta2 - ClipperLib::JoinType joinType - double miterLimit - CODE: - RETVAL = offset2(polygons, delta1, delta2, joinType, miterLimit); - OUTPUT: - RETVAL - ExPolygons -offset2_ex(polygons, delta1, delta2, joinType = ClipperLib::jtMiter, miterLimit = 3) +offset2_ex(polygons, delta1, delta2, joinType = Slic3r::ClipperLib::jtMiter, miterLimit = 3) Polygons polygons const float delta1 const float delta2 - ClipperLib::JoinType joinType + Slic3r::ClipperLib::JoinType joinType double miterLimit CODE: - RETVAL = offset2_ex(polygons, delta1, delta2, joinType, miterLimit); + RETVAL = offset2_ex(union_ex(polygons), delta1, delta2, joinType, miterLimit); OUTPUT: RETVAL @@ -72,7 +59,7 @@ diff(subject, clip, safety_offset = false) Polygons clip bool safety_offset CODE: - RETVAL = diff(subject, clip, safety_offset); + RETVAL = diff(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No); OUTPUT: RETVAL @@ -82,7 +69,7 @@ diff_ex(subject, clip, safety_offset = false) Polygons clip bool safety_offset CODE: - RETVAL = diff_ex(subject, clip, safety_offset); + RETVAL = diff_ex(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No); OUTPUT: RETVAL @@ -101,7 +88,7 @@ intersection(subject, clip, safety_offset = false) Polygons clip bool safety_offset CODE: - RETVAL = intersection(subject, clip, safety_offset); + RETVAL = intersection(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No); OUTPUT: RETVAL @@ -111,7 +98,7 @@ intersection_ex(subject, clip, safety_offset = false) Polygons clip bool safety_offset CODE: - RETVAL = intersection_ex(subject, clip, safety_offset); + RETVAL = intersection_ex(subject, clip, safety_offset ? ApplySafetyOffset::Yes : ApplySafetyOffset::No); OUTPUT: RETVAL @@ -129,7 +116,7 @@ union(subject, safety_offset = false) Polygons subject bool safety_offset CODE: - RETVAL = union_(subject, safety_offset); + RETVAL = safety_offset ? union_safety_offset(subject) : union_(subject); OUTPUT: RETVAL @@ -138,7 +125,7 @@ union_ex(subject, safety_offset = false) Polygons subject bool safety_offset CODE: - RETVAL = union_ex(subject, safety_offset); + RETVAL = safety_offset ? union_safety_offset_ex(subject) : union_ex(subject); OUTPUT: RETVAL diff --git a/xs/xsp/Config.xsp b/xs/xsp/Config.xsp index d1c9bfa0c..703427035 100644 --- a/xs/xsp/Config.xsp +++ b/xs/xsp/Config.xsp @@ -108,7 +108,7 @@ std::string get_extrusion_axis() %code{% if (GCodeConfig* config = dynamic_cast<GCodeConfig*>(THIS)) { - RETVAL = config->get_extrusion_axis(); + RETVAL = get_extrusion_axis(*config); } else { CONFESS("This StaticConfig object does not provide get_extrusion_axis()"); } @@ -170,19 +170,6 @@ print_config_def() throw "Unknown option type"; } (void)hv_stores( hv, "type", newSVpv(opt_type, 0) ); - (void)hv_stores( hv, "gui_type", newSVpvn(optdef->gui_type.c_str(), optdef->gui_type.length()) ); - (void)hv_stores( hv, "gui_flags", newSVpvn(optdef->gui_flags.c_str(), optdef->gui_flags.length()) ); - (void)hv_stores( hv, "label", newSVpvn_utf8(optdef->label.c_str(), optdef->label.length(), true) ); - if (!optdef->full_label.empty()) - (void)hv_stores( hv, "full_label", newSVpvn_utf8(optdef->full_label.c_str(), optdef->full_label.length(), true) ); - (void)hv_stores( hv, "category", newSVpvn_utf8(optdef->category.c_str(), optdef->category.length(), true) ); - (void)hv_stores( hv, "tooltip", newSVpvn_utf8(optdef->tooltip.c_str(), optdef->tooltip.length(), true) ); - (void)hv_stores( hv, "sidetext", newSVpvn_utf8(optdef->sidetext.c_str(), optdef->sidetext.length(), true) ); - (void)hv_stores( hv, "cli", newSVpvn(optdef->cli.c_str(), optdef->cli.length()) ); - (void)hv_stores( hv, "ratio_over", newSVpvn(optdef->ratio_over.c_str(), optdef->ratio_over.length()) ); - (void)hv_stores( hv, "multiline", newSViv(optdef->multiline ? 1 : 0) ); - (void)hv_stores( hv, "full_width", newSViv(optdef->full_width ? 1 : 0) ); - (void)hv_stores( hv, "readonly", newSViv(optdef->readonly ? 1 : 0) ); (void)hv_stores( hv, "height", newSViv(optdef->height) ); (void)hv_stores( hv, "width", newSViv(optdef->width) ); (void)hv_stores( hv, "min", newSViv(optdef->min) ); diff --git a/xs/xsp/ExPolygon.xsp b/xs/xsp/ExPolygon.xsp index bb138732f..a57bcfbcb 100644 --- a/xs/xsp/ExPolygon.xsp +++ b/xs/xsp/ExPolygon.xsp @@ -31,10 +31,6 @@ Polygons simplify_p(double tolerance); Polylines medial_axis(double max_width, double min_width) %code{% THIS->medial_axis(max_width, min_width, &RETVAL); %}; - Polygons get_trapezoids2(double angle) - %code{% THIS->get_trapezoids2(&RETVAL, angle); %}; - Polygons triangulate() - %code{% THIS->triangulate(&RETVAL); %}; %{ ExPolygon* diff --git a/xs/xsp/Flow.xsp b/xs/xsp/Flow.xsp index 2f8a8f2f8..c9f70ea9a 100644 --- a/xs/xsp/Flow.xsp +++ b/xs/xsp/Flow.xsp @@ -8,37 +8,26 @@ %name{Slic3r::Flow} class Flow { ~Flow(); %name{_new} Flow(float width, float height, float nozzle_diameter); - void set_height(float height) - %code{% THIS->height = height; %}; - void set_bridge(bool bridge) - %code{% THIS->bridge = bridge; %}; Clone<Flow> clone() %code{% RETVAL = THIS; %}; - float width() - %code{% RETVAL = THIS->width; %}; - float height() - %code{% RETVAL = THIS->height; %}; - float nozzle_diameter() - %code{% RETVAL = THIS->nozzle_diameter; %}; - bool bridge() - %code{% RETVAL = THIS->bridge; %}; + float width(); + float height(); + float nozzle_diameter(); + bool bridge(); float spacing(); - float spacing_to(Flow* other) - %code{% RETVAL = THIS->spacing(*other); %}; int scaled_width(); int scaled_spacing(); double mm3_per_mm(); %{ Flow* -_new_from_width(CLASS, role, width, nozzle_diameter, height, bridge_flow_ratio) +_new_from_width(CLASS, role, width, nozzle_diameter, height) char* CLASS; FlowRole role; std::string width; float nozzle_diameter; float height; - float bridge_flow_ratio; CODE: ConfigOptionFloatOrPercent optwidth; optwidth.deserialize(width, ForwardCompatibilitySubstitutionRule::Disable); diff --git a/xs/xsp/GCode.xsp b/xs/xsp/GCode.xsp index 4545984bb..4c2583894 100644 --- a/xs/xsp/GCode.xsp +++ b/xs/xsp/GCode.xsp @@ -10,8 +10,9 @@ CoolingBuffer(GCode* gcode) %code{% RETVAL = new CoolingBuffer(*gcode); %}; ~CoolingBuffer(); - Ref<GCode> gcodegen(); - std::string process_layer(std::string gcode, size_t layer_id); + std::string process_layer(std::string gcode, size_t layer_id) + %code{% RETVAL = THIS->process_layer(std::move(gcode), layer_id, true); %}; + }; %name{Slic3r::GCode} class GCode { diff --git a/xs/xsp/Geometry.xsp b/xs/xsp/Geometry.xsp index e44d16949..e59e8793b 100644 --- a/xs/xsp/Geometry.xsp +++ b/xs/xsp/Geometry.xsp @@ -3,6 +3,7 @@ %{ #include <xsinit.h> #include "libslic3r/Geometry.hpp" +#include "libslic3r/Geometry/ConvexHull.hpp" #include "libslic3r/ShortestPath.hpp" %} diff --git a/xs/xsp/Layer.xsp b/xs/xsp/Layer.xsp index 5d006e676..b97e340bd 100644 --- a/xs/xsp/Layer.xsp +++ b/xs/xsp/Layer.xsp @@ -10,7 +10,8 @@ // owned by Layer, no constructor/destructor Ref<Layer> layer(); - Ref<PrintRegion> region(); + Ref<PrintRegion> region() + %code%{ RETVAL = &THIS->region(); %}; Ref<SurfaceCollection> slices() %code%{ RETVAL = &THIS->slices; %}; @@ -23,8 +24,8 @@ Ref<ExtrusionEntityCollection> fills() %code%{ RETVAL = &THIS->fills; %}; - Clone<Flow> flow(FlowRole role, bool bridge = false, double width = -1) - %code%{ RETVAL = THIS->flow(role, bridge, width); %}; + Clone<Flow> flow(FlowRole role) + %code%{ RETVAL = THIS->flow(role); %}; void prepare_fill_surfaces(); void make_perimeters(SurfaceCollection* slices, SurfaceCollection* fill_surfaces) %code%{ THIS->make_perimeters(*slices, fill_surfaces); %}; diff --git a/xs/xsp/Model.xsp b/xs/xsp/Model.xsp index e7a171efd..34795681e 100644 --- a/xs/xsp/Model.xsp +++ b/xs/xsp/Model.xsp @@ -10,7 +10,6 @@ #include "libslic3r/Format/AMF.hpp" #include "libslic3r/Format/3mf.hpp" #include "libslic3r/Format/OBJ.hpp" -#include "libslic3r/Format/PRUS.hpp" #include "libslic3r/Format/STL.hpp" #include "libslic3r/PresetBundle.hpp" %} @@ -89,8 +88,6 @@ bool looks_like_multipart_object() const; void convert_multipart_object(unsigned int max_extruders); - void print_info() const; - bool store_stl(char *path, bool binary) %code%{ TriangleMesh mesh = THIS->mesh(); RETVAL = Slic3r::store_stl(path, &mesh, binary); %}; @@ -213,7 +210,6 @@ ModelMaterial::attributes() %code%{ THIS->origin_translation = *point; %}; void ensure_on_bed(); - bool needed_repair() const; int materials_count() const; int facets_count(); void center_around_origin(); @@ -224,13 +220,6 @@ ModelMaterial::attributes() %code{% THIS->rotate(angle, *axis); %}; void mirror(Axis axis); - ModelObjectPtrs* split_object() - %code%{ - RETVAL = new ModelObjectPtrs(); // leak? - THIS->split(RETVAL); - %}; - - void print_info() const; }; diff --git a/xs/xsp/Polyline.xsp b/xs/xsp/Polyline.xsp index 0dbd0e572..7846ea5f4 100644 --- a/xs/xsp/Polyline.xsp +++ b/xs/xsp/Polyline.xsp @@ -31,8 +31,6 @@ void extend_end(double distance); void extend_start(double distance); void simplify(double tolerance); - void simplify_by_visibility(ExPolygon* expolygon) - %code{% THIS->simplify_by_visibility(*expolygon); %}; void split_at(Point* point, Polyline* p1, Polyline* p2) %code{% THIS->split_at(*point, p1, p2); %}; bool is_straight(); @@ -79,9 +77,9 @@ Polyline::rotate(angle, center_sv) THIS->rotate(angle, center); Polygons -Polyline::grow(delta, joinType = ClipperLib::jtSquare, miterLimit = 3) +Polyline::grow(delta, joinType = Slic3r::ClipperLib::jtSquare, miterLimit = 3) const float delta - ClipperLib::JoinType joinType + Slic3r::ClipperLib::JoinType joinType double miterLimit CODE: RETVAL = offset(*THIS, delta, joinType, miterLimit); diff --git a/xs/xsp/Print.xsp b/xs/xsp/Print.xsp index d9872aa7e..bffdd933f 100644 --- a/xs/xsp/Print.xsp +++ b/xs/xsp/Print.xsp @@ -17,8 +17,7 @@ _constant() STEP_PREPARE_INFILL = posPrepareInfill STEP_INFILL = posInfill STEP_SUPPORTMATERIAL = posSupportMaterial - STEP_SKIRT = psSkirt - STEP_BRIM = psBrim + STEP_SKIRTBRIM = psSkirtBrim STEP_WIPE_TOWER = psWipeTower PROTOTYPE: CODE: @@ -32,18 +31,11 @@ _constant() Ref<StaticPrintConfig> config() %code%{ RETVAL = &THIS->config(); %}; - Ref<Print> print(); - - Clone<Flow> flow(FlowRole role, double layer_height, bool bridge, bool first_layer, double width, PrintObject* object) - %code%{ RETVAL = THIS->flow(role, layer_height, bridge, first_layer, width, *object); %}; }; %name{Slic3r::Print::Object} class PrintObject { // owned by Print, no constructor/destructor - int region_count() - %code%{ RETVAL = THIS->print()->regions().size(); %}; - Ref<Print> print(); Ref<ModelObject> model_object(); Ref<StaticPrintConfig> config() @@ -95,18 +87,14 @@ _constant() int wipe_tower_number_of_toolchanges() %code%{ RETVAL = THIS->wipe_tower_data().number_of_toolchanges; %}; PrintObjectPtrs* objects() - %code%{ RETVAL = const_cast<PrintObjectPtrs*>(&THIS->objects()); %}; + %code%{ RETVAL = const_cast<PrintObjectPtrs*>(&THIS->objects_mutable()); %}; Ref<PrintObject> get_object(int idx) - %code%{ RETVAL = THIS->objects()[idx]; %}; + %code%{ RETVAL = THIS->objects_mutable()[idx]; %}; size_t object_count() %code%{ RETVAL = THIS->objects().size(); %}; PrintRegionPtrs* regions() - %code%{ RETVAL = const_cast<PrintRegionPtrs*>(&THIS->regions()); %}; - Ref<PrintRegion> get_region(int idx) - %code%{ RETVAL = THIS->regions()[idx]; %}; - size_t region_count() - %code%{ RETVAL = THIS->regions().size(); %}; + %code%{ RETVAL = const_cast<PrintRegionPtrs*>(&THIS->print_regions_mutable()); %}; bool step_done(PrintStep step) %code%{ RETVAL = THIS->is_step_done(step); %}; @@ -116,7 +104,7 @@ _constant() SV* filament_stats() %code%{ HV* hv = newHV(); - for (std::map<size_t,float>::const_iterator it = THIS->print_statistics().filament_stats.begin(); it != THIS->print_statistics().filament_stats.end(); ++it) { + for (std::map<size_t,double>::const_iterator it = THIS->print_statistics().filament_stats.begin(); it != THIS->print_statistics().filament_stats.end(); ++it) { // stringify extruder_id std::ostringstream ss; ss << it->first; @@ -126,7 +114,6 @@ _constant() RETVAL = newRV_noinc((SV*)hv); } %}; - double max_allowed_layer_height() const; bool has_support_material() const; void auto_assign_extruders(ModelObject* model_object); std::string output_filepath(std::string path = "") diff --git a/xs/xsp/Surface.xsp b/xs/xsp/Surface.xsp index 379774f0a..49d988333 100644 --- a/xs/xsp/Surface.xsp +++ b/xs/xsp/Surface.xsp @@ -85,7 +85,7 @@ Surface::polygons() Surfaces Surface::offset(delta, joinType = ClipperLib::jtMiter, miterLimit = 3) const float delta - ClipperLib::JoinType joinType + Slic3r::ClipperLib::JoinType joinType double miterLimit CODE: surfaces_append(RETVAL, offset_ex(THIS->expolygon, delta, joinType, miterLimit), *THIS); diff --git a/xs/xsp/TriangleMesh.xsp b/xs/xsp/TriangleMesh.xsp index 230f8b2a5..a9dbe654d 100644 --- a/xs/xsp/TriangleMesh.xsp +++ b/xs/xsp/TriangleMesh.xsp @@ -3,6 +3,7 @@ %{ #include <xsinit.h> #include "libslic3r/TriangleMesh.hpp" +#include "libslic3r/TriangleMeshSlicer.hpp" %} %name{Slic3r::TriangleMesh} class TriangleMesh { @@ -10,14 +11,11 @@ ~TriangleMesh(); Clone<TriangleMesh> clone() %code{% RETVAL = THIS; %}; - void ReadSTLFile(char* input_file); void write_ascii(char* output_file); void write_binary(char* output_file); - void repair(); - void WriteOBJFile(char* output_file); void scale(float factor); void scale_xyz(Vec3d* versor) - %code{% THIS->scale(*versor); %}; + %code{% THIS->scale(versor->cast<float>()); %}; void translate(float x, float y, float z); void rotate_x(float angle); void rotate_y(float angle); @@ -27,16 +25,13 @@ void mirror_z(); void align_to_origin(); void rotate(double angle, Point* center); - TriangleMeshPtrs split(); void merge(TriangleMesh* mesh) %code{% THIS->merge(*mesh); %}; - ExPolygons horizontal_projection(); Clone<Polygon> convex_hull(); Clone<BoundingBoxf3> bounding_box(); Clone<Vec3d> center() %code{% RETVAL = THIS->bounding_box().center(); %}; int facets_count(); - void reset_repair_stats(); %{ @@ -45,51 +40,40 @@ TriangleMesh::ReadFromPerl(vertices, facets) SV* vertices SV* facets CODE: - stl_file &stl = THIS->stl; - stl.stats.type = inmemory; - - // count facets and allocate memory - AV* facets_av = (AV*)SvRV(facets); - stl.stats.number_of_facets = av_len(facets_av)+1; - stl.stats.original_num_facets = stl.stats.number_of_facets; - stl_allocate(&stl); - - // read geometry - AV* vertices_av = (AV*)SvRV(vertices); - for (int i = 0; i < stl.stats.number_of_facets; i++) { - AV* facet_av = (AV*)SvRV(*av_fetch(facets_av, i, 0)); - stl_facet facet; - facet.normal(0) = 0; - facet.normal(1) = 0; - facet.normal(2) = 0; - for (unsigned int v = 0; v <= 2; v++) { - AV* vertex_av = (AV*)SvRV(*av_fetch(vertices_av, SvIV(*av_fetch(facet_av, v, 0)), 0)); - facet.vertex[v](0) = SvNV(*av_fetch(vertex_av, 0, 0)); - facet.vertex[v](1) = SvNV(*av_fetch(vertex_av, 1, 0)); - facet.vertex[v](2) = SvNV(*av_fetch(vertex_av, 2, 0)); + std::vector<Slic3r::Vec3f> out_vertices; + { + AV* vertices_av = (AV*)SvRV(vertices); + int number_of_vertices = av_len(vertices_av) + 1; + out_vertices.reserve(number_of_vertices); + for (int i = 0; i < number_of_vertices; ++ i) { + AV* vertex_av = (AV*)SvRV(*av_fetch(vertices_av, i, 0)); + out_vertices.push_back(Slic3r::Vec3f(SvNV(*av_fetch(vertex_av, 0, 0)), SvNV(*av_fetch(vertex_av, 1, 0)), SvNV(*av_fetch(vertex_av, 2, 0)))); + } + } + std::vector<Slic3r::Vec3i> out_indices; + { + AV* facets_av = (AV*)SvRV(facets); + int number_of_facets = av_len(facets_av) + 1; + out_indices.reserve(number_of_facets); + for (int i = 0; i < number_of_facets; ++ i) { + AV* facet_av = (AV*)SvRV(*av_fetch(facets_av, i, 0)); + out_indices.push_back(Slic3r::Vec3i(SvIV(*av_fetch(facet_av, 0, 0)), SvIV(*av_fetch(facet_av, 1, 0)), SvIV(*av_fetch(facet_av, 2, 0)))); } - facet.extra[0] = 0; - facet.extra[1] = 0; - - stl.facet_start[i] = facet; } - - stl_get_size(&stl); + *THIS = TriangleMesh(std::move(out_vertices), std::move(out_indices)); SV* TriangleMesh::stats() CODE: HV* hv = newHV(); - (void)hv_stores( hv, "number_of_facets", newSViv(THIS->stl.stats.number_of_facets) ); - (void)hv_stores( hv, "number_of_parts", newSViv(THIS->stl.stats.number_of_parts) ); - (void)hv_stores( hv, "volume", newSVnv(THIS->stl.stats.volume) ); - (void)hv_stores( hv, "degenerate_facets", newSViv(THIS->stl.stats.degenerate_facets) ); - (void)hv_stores( hv, "edges_fixed", newSViv(THIS->stl.stats.edges_fixed) ); - (void)hv_stores( hv, "facets_removed", newSViv(THIS->stl.stats.facets_removed) ); - (void)hv_stores( hv, "facets_added", newSViv(THIS->stl.stats.facets_added) ); - (void)hv_stores( hv, "facets_reversed", newSViv(THIS->stl.stats.facets_reversed) ); - (void)hv_stores( hv, "backwards_edges", newSViv(THIS->stl.stats.backwards_edges) ); - (void)hv_stores( hv, "normals_fixed", newSViv(THIS->stl.stats.normals_fixed) ); + (void)hv_stores( hv, "number_of_facets", newSViv(THIS->facets_count()) ); + (void)hv_stores( hv, "number_of_parts", newSViv(THIS->stats().number_of_parts) ); + (void)hv_stores( hv, "volume", newSVnv(THIS->stats().volume) ); + (void)hv_stores( hv, "degenerate_facets", newSViv(THIS->stats().repaired_errors.degenerate_facets) ); + (void)hv_stores( hv, "edges_fixed", newSViv(THIS->stats().repaired_errors.edges_fixed) ); + (void)hv_stores( hv, "facets_removed", newSViv(THIS->stats().repaired_errors.facets_removed) ); + (void)hv_stores( hv, "facets_reversed", newSViv(THIS->stats().repaired_errors.facets_reversed) ); + (void)hv_stores( hv, "backwards_edges", newSViv(THIS->stats().repaired_errors.backwards_edges) ); RETVAL = (SV*)newRV_noinc((SV*)hv); OUTPUT: RETVAL @@ -97,9 +81,6 @@ TriangleMesh::stats() SV* TriangleMesh::vertices() CODE: - if (!THIS->repaired) CONFESS("vertices() requires repair()"); - THIS->require_shared_vertices(); - // vertices AV* vertices = newAV(); av_extend(vertices, THIS->its.vertices.size()); @@ -119,13 +100,10 @@ TriangleMesh::vertices() SV* TriangleMesh::facets() CODE: - if (!THIS->repaired) CONFESS("facets() requires repair()"); - THIS->require_shared_vertices(); - // facets AV* facets = newAV(); - av_extend(facets, THIS->stl.stats.number_of_facets); - for (int i = 0; i < THIS->stl.stats.number_of_facets; i++) { + av_extend(facets, THIS->facets_count()); + for (int i = 0; i < THIS->facets_count(); i++) { AV* facet = newAV(); av_store(facets, i, newRV_noinc((SV*)facet)); av_extend(facet, 2); @@ -139,34 +117,13 @@ TriangleMesh::facets() RETVAL SV* -TriangleMesh::normals() - CODE: - if (!THIS->repaired) CONFESS("normals() requires repair()"); - - // normals - AV* normals = newAV(); - av_extend(normals, THIS->stl.stats.number_of_facets); - for (int i = 0; i < THIS->stl.stats.number_of_facets; i++) { - AV* facet = newAV(); - av_store(normals, i, newRV_noinc((SV*)facet)); - av_extend(facet, 2); - av_store(facet, 0, newSVnv(THIS->stl.facet_start[i].normal(0))); - av_store(facet, 1, newSVnv(THIS->stl.facet_start[i].normal(1))); - av_store(facet, 2, newSVnv(THIS->stl.facet_start[i].normal(2))); - } - - RETVAL = newRV_noinc((SV*)normals); - OUTPUT: - RETVAL - -SV* TriangleMesh::size() CODE: AV* size = newAV(); av_extend(size, 2); - av_store(size, 0, newSVnv(THIS->stl.stats.size(0))); - av_store(size, 1, newSVnv(THIS->stl.stats.size(1))); - av_store(size, 2, newSVnv(THIS->stl.stats.size(2))); + av_store(size, 0, newSVnv(THIS->stats().size(0))); + av_store(size, 1, newSVnv(THIS->stats().size(1))); + av_store(size, 2, newSVnv(THIS->stats().size(2))); RETVAL = newRV_noinc((SV*)size); OUTPUT: RETVAL @@ -175,14 +132,10 @@ SV* TriangleMesh::slice(z) std::vector<double> z CODE: - THIS->require_shared_vertices(); // TriangleMeshSlicer needs this - // convert doubles to floats std::vector<float> z_f = cast<float>(z); - std::vector<ExPolygons> layers; - TriangleMeshSlicer mslicer(THIS); - mslicer.slice(z_f, SlicingMode::Regular, 0.049f, &layers, [](){}); + std::vector<ExPolygons> layers = slice_mesh_ex(THIS->its, z_f, 0.049f); AV* layers_av = newAV(); size_t len = layers.size(); @@ -202,24 +155,27 @@ TriangleMesh::slice(z) RETVAL void -TriangleMesh::cut(z, upper, lower) +TriangleMesh::cut(z, upper_mesh, lower_mesh) float z; - TriangleMesh* upper; - TriangleMesh* lower; + TriangleMesh* upper_mesh; + TriangleMesh* lower_mesh; CODE: - THIS->require_shared_vertices(); // TriangleMeshSlicer needs this - TriangleMeshSlicer mslicer(THIS); - mslicer.cut(z, upper, lower); + indexed_triangle_set upper, lower; + cut_mesh(THIS->its, z, upper_mesh ? &upper : nullptr, lower_mesh ? &lower : nullptr); + if (upper_mesh) + *upper_mesh = TriangleMesh(upper); + if (lower_mesh) + *lower_mesh = TriangleMesh(lower); std::vector<double> TriangleMesh::bb3() CODE: - RETVAL.push_back(THIS->stl.stats.min(0)); - RETVAL.push_back(THIS->stl.stats.min(1)); - RETVAL.push_back(THIS->stl.stats.max(0)); - RETVAL.push_back(THIS->stl.stats.max(1)); - RETVAL.push_back(THIS->stl.stats.min(2)); - RETVAL.push_back(THIS->stl.stats.max(2)); + RETVAL.push_back(THIS->stats().min(0)); + RETVAL.push_back(THIS->stats().min(1)); + RETVAL.push_back(THIS->stats().max(0)); + RETVAL.push_back(THIS->stats().max(1)); + RETVAL.push_back(THIS->stats().min(2)); + RETVAL.push_back(THIS->stats().max(2)); OUTPUT: RETVAL @@ -247,16 +203,3 @@ sphere(double rho) %} }; - -%package{Slic3r::TriangleMesh}; - -%{ -PROTOTYPES: DISABLE - -std::string -hello_world() - CODE: - RETVAL = "Hello world!"; - OUTPUT: - RETVAL -%} diff --git a/xs/xsp/XS.xsp b/xs/xsp/XS.xsp index 083d21d38..68ea282bc 100644 --- a/xs/xsp/XS.xsp +++ b/xs/xsp/XS.xsp @@ -24,12 +24,6 @@ BUILD() OUTPUT: RETVAL SV* -DEBUG_OUT_PATH_PREFIX() - CODE: - RETVAL = newSVpv(SLIC3R_DEBUG_OUT_PATH_PREFIX, 0); - OUTPUT: RETVAL - -SV* FORK_NAME() CODE: RETVAL = newSVpv(SLIC3R_APP_NAME, 0); diff --git a/xs/xsp/my.map b/xs/xsp/my.map index 2ecff6e3f..ca26750dc 100644 --- a/xs/xsp/my.map +++ b/xs/xsp/my.map @@ -211,8 +211,8 @@ FlowRole T_UV PrintStep T_UV PrintObjectStep T_UV SurfaceType T_UV -ClipperLib::JoinType T_UV -ClipperLib::PolyFillType T_UV +Slic3r::ClipperLib::JoinType T_UV +Slic3r::ClipperLib::PolyFillType T_UV # we return these types whenever we want the items to be cloned Points T_ARRAYREF @@ -239,7 +239,6 @@ SupportLayerPtrs* T_PTR_ARRAYREF_PTR # we return these types whenever we want the items to be returned # by reference and not marked ::Ref because they're newly allocated # and not referenced by any Perl object -TriangleMeshPtrs T_PTR_ARRAYREF INPUT diff --git a/xs/xsp/typemap.xspt b/xs/xsp/typemap.xspt index 2d364628e..f9e61c6a0 100644 --- a/xs/xsp/typemap.xspt +++ b/xs/xsp/typemap.xspt @@ -163,7 +163,6 @@ %typemap{Surfaces}; %typemap{Polygons*}; %typemap{TriangleMesh*}; -%typemap{TriangleMeshPtrs}; %typemap{Model*}; %typemap{Ref<Model>}{simple}; %typemap{Clone<Model>}{simple}; |