mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
New extrusion class: ExtrusionMultiPath
This is similar to an ExtrusionLoop, but it is open. It may contain multiple chained paths with differing parameters. This allows one to have a hierarchy of paths, where the ExtrusionEntityCollection will be chained by the G-code generator, but ExtrusionMultiPath will not.
This commit is contained in:
parent
e6b441eea4
commit
e016c4e423
13 changed files with 151 additions and 2 deletions
|
@ -766,11 +766,33 @@ GCode::extrude(ExtrusionLoop loop, std::string description, double speed)
|
|||
return gcode;
|
||||
}
|
||||
|
||||
std::string
|
||||
GCode::extrude(ExtrusionMultiPath multipath, std::string description, double speed)
|
||||
{
|
||||
// extrude along the path
|
||||
std::string gcode;
|
||||
for (ExtrusionPaths::const_iterator path = multipath.paths.begin(); path != multipath.paths.end(); ++path)
|
||||
// description += ExtrusionLoopRole2String(loop.role);
|
||||
// description += ExtrusionRole2String(path->role);
|
||||
gcode += this->_extrude(*path, description, speed);
|
||||
|
||||
// reset acceleration
|
||||
gcode += this->writer.set_acceleration(this->config.default_acceleration.value);
|
||||
|
||||
//FIXME perform wipe on multi paths?
|
||||
// if (this->wipe.enable)
|
||||
// this->wipe.path = paths.front().polyline; // TODO: don't limit wipe to last path
|
||||
|
||||
return gcode;
|
||||
}
|
||||
|
||||
std::string
|
||||
GCode::extrude(const ExtrusionEntity &entity, std::string description, double speed)
|
||||
{
|
||||
if (const ExtrusionPath* path = dynamic_cast<const ExtrusionPath*>(&entity)) {
|
||||
return this->extrude(*path, description, speed);
|
||||
} else if (const ExtrusionMultiPath* multipath = dynamic_cast<const ExtrusionMultiPath*>(&entity)) {
|
||||
return this->extrude(*multipath, description, speed);
|
||||
} else if (const ExtrusionLoop* loop = dynamic_cast<const ExtrusionLoop*>(&entity)) {
|
||||
return this->extrude(*loop, description, speed);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue