Ported (and used) ExtrusionPath->first_point
This commit is contained in:
parent
fe42427a54
commit
9fb14f2119
6 changed files with 16 additions and 9 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@ class ExtrusionPath : public ExtrusionEntity
|
|||
public:
|
||||
Polyline polyline;
|
||||
void reverse();
|
||||
const Point* first_point() const;
|
||||
};
|
||||
|
||||
class ExtrusionLoop : public ExtrusionEntity
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue