2013-07-16 19:04:14 +00:00
|
|
|
#include "ExtrusionEntity.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2013-08-29 09:47:59 +00:00
|
|
|
ExtrusionPath*
|
|
|
|
ExtrusionPath::clone() const
|
|
|
|
{
|
|
|
|
return new ExtrusionPath (*this);
|
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
void
|
|
|
|
ExtrusionPath::reverse()
|
|
|
|
{
|
|
|
|
this->polyline.reverse();
|
|
|
|
}
|
|
|
|
|
2013-08-29 09:47:59 +00:00
|
|
|
Point*
|
|
|
|
ExtrusionPath::first_point()
|
2013-08-26 21:42:00 +00:00
|
|
|
{
|
|
|
|
return &(this->polyline.points.front());
|
|
|
|
}
|
|
|
|
|
2013-08-29 09:47:59 +00:00
|
|
|
Point*
|
|
|
|
ExtrusionPath::last_point()
|
2013-08-28 23:36:42 +00:00
|
|
|
{
|
|
|
|
return &(this->polyline.points.back());
|
|
|
|
}
|
|
|
|
|
2013-08-29 09:47:59 +00:00
|
|
|
ExtrusionLoop*
|
|
|
|
ExtrusionLoop::clone() const
|
|
|
|
{
|
|
|
|
return new ExtrusionLoop (*this);
|
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
ExtrusionPath*
|
|
|
|
ExtrusionLoop::split_at_index(int index)
|
|
|
|
{
|
|
|
|
Polyline* poly = this->polygon.split_at_index(index);
|
|
|
|
|
|
|
|
ExtrusionPath* path = new ExtrusionPath();
|
|
|
|
path->polyline = *poly;
|
|
|
|
path->role = this->role;
|
|
|
|
path->height = this->height;
|
|
|
|
path->flow_spacing = this->flow_spacing;
|
|
|
|
|
|
|
|
delete poly;
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
ExtrusionPath*
|
|
|
|
ExtrusionLoop::split_at_first_point()
|
|
|
|
{
|
|
|
|
return this->split_at_index(0);
|
|
|
|
}
|
|
|
|
|
2013-08-28 23:40:42 +00:00
|
|
|
bool
|
|
|
|
ExtrusionLoop::make_counter_clockwise()
|
|
|
|
{
|
|
|
|
return this->polygon.make_counter_clockwise();
|
|
|
|
}
|
|
|
|
|
2013-08-29 09:47:59 +00:00
|
|
|
void
|
|
|
|
ExtrusionLoop::reverse()
|
|
|
|
{
|
|
|
|
// no-op
|
|
|
|
}
|
|
|
|
|
|
|
|
Point*
|
|
|
|
ExtrusionLoop::first_point()
|
|
|
|
{
|
|
|
|
return &(this->polygon.points.front());
|
|
|
|
}
|
|
|
|
|
|
|
|
Point*
|
|
|
|
ExtrusionLoop::last_point()
|
|
|
|
{
|
|
|
|
return &(this->polygon.points.front()); // in polygons, first == last
|
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|