void GCodePlanner::moveInsideCombBoundary() { if (!comb || comb->checkInside(lastPosition)) return; Point p = lastPosition; if (comb->moveInside(p)) { addTravel(p); //Make sure the that any retraction happens after this move, not before it by starting a new move path. forceNewPathStart(); } }
void GCodePlanner::moveInsideCombBoundary(int distance) { if (!comb || comb->checkInside(lastPosition)) return; Point p = lastPosition; if (comb->moveInside(&p, distance)) { //Move inside again, so we move out of tight 90deg corners comb->moveInside(&p, distance); addTravel(p); //Make sure the that any retraction happens after this move, not before it by starting a new move path. forceNewPathStart(); } }
bool GCodePlanner::setExtruder(int extruder) { if (extruder == currentExtruder) { return false; } SettingsBase* train = storage.meshgroup->getExtruderTrain(currentExtruder); bool end_pos_absolute = train->getSettingBoolean("machine_extruder_end_pos_abs"); Point end_pos(train->getSettingInMicrons("machine_extruder_end_pos_x"), train->getSettingInMicrons("machine_extruder_end_pos_y")); addTravel((end_pos_absolute)? end_pos : lastPosition + end_pos); currentExtruder = extruder; // the extruder switch forceNewPathStart(); train = storage.meshgroup->getExtruderTrain(currentExtruder); bool start_pos_absolute = train->getSettingBoolean("machine_extruder_start_pos_abs"); Point start_pos(train->getSettingInMicrons("machine_extruder_start_pos_x"), train->getSettingInMicrons("machine_extruder_start_pos_y")); lastPosition = (start_pos_absolute)? start_pos : lastPosition + start_pos; return true; }