mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 00:01:09 -06:00
More work on the clipping method for medial axis. Includes Polyline->is_valid()
This commit is contained in:
parent
7e8c535f6a
commit
b5aaeb9b12
6 changed files with 38 additions and 3 deletions
|
@ -49,6 +49,12 @@ MultiPoint::length() const
|
|||
return len;
|
||||
}
|
||||
|
||||
bool
|
||||
MultiPoint::is_valid() const
|
||||
{
|
||||
return this->points.size() >= 2;
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
void
|
||||
MultiPoint::from_SV(SV* poly_sv)
|
||||
|
|
|
@ -20,6 +20,7 @@ class MultiPoint
|
|||
virtual Point* last_point() const = 0;
|
||||
virtual Lines lines() const = 0;
|
||||
double length() const;
|
||||
bool is_valid() const;
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
void from_SV(SV* poly_sv);
|
||||
|
|
|
@ -40,6 +40,15 @@ Polyline::clip_end(double distance)
|
|||
}
|
||||
}
|
||||
|
||||
// removes the given distance from the start of the polyline
|
||||
void
|
||||
Polyline::clip_start(double distance)
|
||||
{
|
||||
this->reverse();
|
||||
this->clip_end(distance);
|
||||
if (this->points.size() >= 2) this->reverse();
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV*
|
||||
Polyline::to_SV_ref()
|
||||
|
|
|
@ -11,6 +11,7 @@ class Polyline : public MultiPoint {
|
|||
Point* last_point() const;
|
||||
Lines lines() const;
|
||||
void clip_end(double distance);
|
||||
void clip_start(double distance);
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV* to_SV_ref();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue