use of com.willwinder.ugs.nbp.designer.io.gcode.toolpaths.OutlineToolPath in project Universal-G-Code-Sender by winder.
the class SimpleGcodeRouter method getGcodePathFromCuttables.
private GcodePath getGcodePathFromCuttables(List<Cuttable> cuttables) {
GcodePath gcodePath = new GcodePath();
int index = 0;
for (Cuttable cuttable : cuttables) {
index++;
gcodePath.addSegment(new Segment(" " + cuttable.getName() + " - " + cuttable.getCutType().getName() + " (" + index + "/" + cuttables.size() + ")"));
switch(cuttable.getCutType()) {
case POCKET:
PocketToolPath simplePocket = new PocketToolPath(cuttable);
simplePocket.setStartDepth(cuttable.getStartDepth());
simplePocket.setTargetDepth(cuttable.getTargetDepth());
simplePocket.setToolDiameter(toolDiameter);
simplePocket.setDepthPerPass(depthPerPass);
simplePocket.setSafeHeight(safeHeight);
simplePocket.setStepOver(toolStepOver);
gcodePath.appendGcodePath(simplePocket.toGcodePath());
break;
case OUTSIDE_PATH:
OutlineToolPath simpleOutsidePath = new OutlineToolPath(cuttable);
simpleOutsidePath.setOffset(toolDiameter / 2d);
simpleOutsidePath.setStartDepth(cuttable.getStartDepth());
simpleOutsidePath.setTargetDepth(cuttable.getTargetDepth());
simpleOutsidePath.setToolDiameter(toolDiameter);
simpleOutsidePath.setDepthPerPass(depthPerPass);
simpleOutsidePath.setSafeHeight(safeHeight);
gcodePath.appendGcodePath(simpleOutsidePath.toGcodePath());
break;
case INSIDE_PATH:
OutlineToolPath simpleInsidePath = new OutlineToolPath(cuttable);
simpleInsidePath.setOffset(-toolDiameter / 2d);
simpleInsidePath.setStartDepth(cuttable.getStartDepth());
simpleInsidePath.setTargetDepth(cuttable.getTargetDepth());
simpleInsidePath.setToolDiameter(toolDiameter);
simpleInsidePath.setDepthPerPass(depthPerPass);
simpleInsidePath.setSafeHeight(safeHeight);
gcodePath.appendGcodePath(simpleInsidePath.toGcodePath());
break;
case ON_PATH:
OutlineToolPath simpleOnPath = new OutlineToolPath(cuttable);
simpleOnPath.setStartDepth(cuttable.getStartDepth());
simpleOnPath.setTargetDepth(cuttable.getTargetDepth());
simpleOnPath.setToolDiameter(toolDiameter);
simpleOnPath.setDepthPerPass(depthPerPass);
simpleOnPath.setSafeHeight(safeHeight);
gcodePath.appendGcodePath(simpleOnPath.toGcodePath());
break;
case CENTER_DRILL:
DrillCenterToolPath drillToolPath = new DrillCenterToolPath(cuttable);
drillToolPath.setStartDepth(cuttable.getStartDepth());
drillToolPath.setTargetDepth(cuttable.getTargetDepth());
drillToolPath.setToolDiameter(toolDiameter);
drillToolPath.setDepthPerPass(depthPerPass);
drillToolPath.setSafeHeight(safeHeight);
gcodePath.appendGcodePath(drillToolPath.toGcodePath());
break;
default:
}
}
return gcodePath;
}
Aggregations