Ejemplo n.º 1
0
bool MergeInfillLines::mergeInfillLines(double speed, unsigned int& path_idx)
{ //Check for lots of small moves and combine them into one large line
    Point prev_middle;
    Point last_middle;
    int64_t line_width;

    if (isConvertible(path_idx, prev_middle, last_middle, line_width, false))
    {
        //   path_idx + 3 is the index of the second extrusion move to be converted in combination with the first
        {
            GCodePath& move_path = paths[path_idx];
            for(unsigned int point_idx = 0; point_idx < move_path.points.size() - 1; point_idx++)
            {
                gcode.writeMove(move_path.points[point_idx], speed, move_path.getExtrusionMM3perMM());
            }
            gcode.writeMove(prev_middle, travelConfig.getSpeed(), 0);
            GCodePath& last_path = paths[path_idx + 3];
            
            writeCompensatedMove(last_middle, speed, last_path, line_width);
        }
        
        path_idx += 2;
        extruder_plan.handleInserts(path_idx, gcode);
        for (; isConvertible(path_idx, prev_middle, last_middle, line_width, true); path_idx += 2)
        {
            extruder_plan.handleInserts(path_idx, gcode);
            GCodePath& last_path = paths[path_idx + 3];
            writeCompensatedMove(last_middle, speed, last_path, line_width);
        }
        path_idx = path_idx + 1; // means that the next path considered is the travel path after the converted extrusion path corresponding to the updated path_idx
        extruder_plan.handleInserts(path_idx, gcode);
        return true;
    }
    return false;
};
Ejemplo n.º 2
0
bool MergeInfillLines::mergeInfillLines(double speed, unsigned int& path_idx)
{ //Check for lots of small moves and combine them into one large line
    Point prev_middle;
    Point last_middle;
    int64_t line_width;
    
    MergeInfillLines merger(gcode, paths, travelConfig, nozzle_size);
    
    if (merger.isConvertible(path_idx, prev_middle, last_middle, line_width, false))
    {
        //   path_idx + 3 is the index of the second extrusion move to be converted in combination with the first
        {
            GCodePath& last_path = paths[path_idx + 3];
            gcode.writeMove(prev_middle, travelConfig.getSpeed(), 0);
            
            writeCompensatedMove(last_middle, speed, last_path, line_width);
        }
        
        path_idx += 2;
        for (; merger.isConvertible(path_idx, prev_middle, last_middle, line_width, true); path_idx += 2)
        {
            GCodePath& last_path = paths[path_idx + 3];
            writeCompensatedMove(last_middle, speed, last_path, line_width);
        }
        path_idx = path_idx + 1; // means that the next path considered is the travel path after the converted extrusion path corresponding to the updated path_idx
        return true;
    }
    return false;
};