mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Ported contains_line() to XS
This commit is contained in:
parent
bd62de7653
commit
a225a8b2ef
10 changed files with 97 additions and 67 deletions
|
@ -1,8 +1,19 @@
|
|||
#include "ExPolygon.hpp"
|
||||
#include "Polygon.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
ExPolygon::operator Polygons() const
|
||||
{
|
||||
Polygons polygons(this->holes.size() + 1);
|
||||
polygons.push_back(this->contour);
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it) {
|
||||
polygons.push_back(*it);
|
||||
}
|
||||
return polygons;
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygon::scale(double factor)
|
||||
{
|
||||
|
@ -50,6 +61,17 @@ ExPolygon::is_valid() const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygon::contains_line(Line* line) const
|
||||
{
|
||||
Polylines pl(1);
|
||||
pl.push_back(*line);
|
||||
|
||||
Polylines pl_out;
|
||||
diff(pl, *this, pl_out);
|
||||
return pl_out.empty();
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV*
|
||||
ExPolygon::to_AV() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue