Initial work for 3D rendering of toolpaths

This commit is contained in:
Alessandro Ranellucci 2015-01-15 20:06:30 +01:00
parent 18e815d032
commit e0a3d2577c
12 changed files with 166 additions and 2 deletions

View file

@ -164,6 +164,14 @@ ExtrusionPath::gcode(Extruder* extruder, double e, double F,
return stream.str();
}
Polygons
ExtrusionPath::grow() const
{
Polygons pp;
offset(this->polyline, &pp, +this->width/2);
return pp;
}
ExtrusionLoop::operator Polygon() const
{
Polygon polygon;
@ -363,6 +371,17 @@ ExtrusionLoop::is_solid_infill() const
|| this->paths.front().role == erTopSolidInfill;
}
Polygons
ExtrusionLoop::grow() const
{
Polygons pp;
for (ExtrusionPaths::const_iterator path = this->paths.begin(); path != this->paths.end(); ++path) {
Polygons path_pp = path->grow();
pp.insert(pp.end(), path_pp.begin(), path_pp.end());
}
return pp;
}
#ifdef SLIC3RXS
REGISTER_CLASS(ExtrusionLoop, "ExtrusionLoop");
#endif