1
0
mirror of https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git synced 2026-07-31 11:15:52 +00:00

Ported (and used) ExtrusionPath->first_point

This commit is contained in:
Alessandro Ranellucci
2013-08-26 23:42:00 +02:00
parent fe42427a54
commit 9fb14f2119
6 changed files with 16 additions and 9 deletions
+6
View File
@@ -8,6 +8,12 @@ ExtrusionPath::reverse()
this->polyline.reverse();
}
const Point*
ExtrusionPath::first_point() const
{
return &(this->polyline.points.front());
}
ExtrusionPath*
ExtrusionLoop::split_at_index(int index)
{
+1
View File
@@ -38,6 +38,7 @@ class ExtrusionPath : public ExtrusionEntity
public:
Polyline polyline;
void reverse();
const Point* first_point() const;
};
class ExtrusionLoop : public ExtrusionEntity
+3 -1
View File
@@ -4,7 +4,7 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 7;
use Test::More tests => 8;
my $points = [
[100, 100],
@@ -28,6 +28,8 @@ is scalar(@$path), 4, 'append to path';
$path->pop_back;
is scalar(@$path), 3, 'pop_back from path';
ok $path->first_point->coincides_with($path->polyline->[0]), 'first_point';
$path = $path->clone;
is $path->role, Slic3r::ExtrusionPath::EXTR_ROLE_EXTERNAL_PERIMETER, 'role';
+2
View File
@@ -16,6 +16,8 @@
void reverse();
Lines lines()
%code{% RETVAL = THIS->polyline.lines(); %};
Point* first_point()
%code{% const char* CLASS = "Slic3r::Point"; RETVAL = new Point(*(THIS->first_point())); %};
%{
ExtrusionPath*