add new laser options
This commit is contained in:
parent
c1b24f90ea
commit
220cf4777c
3 changed files with 22 additions and 12 deletions
|
|
@ -33,7 +33,7 @@ var gs_kiri_laser = exports;
|
||||||
return ondone("invalid slice height");
|
return ondone("invalid slice height");
|
||||||
}
|
}
|
||||||
|
|
||||||
SLICER.sliceWidget(widget, {height: proc.laserSliceHeight}, function(slices) {
|
SLICER.sliceWidget(widget, {height: proc.laserSliceHeight, single: proc.laserSliceSingle}, function(slices) {
|
||||||
widget.slices = slices;
|
widget.slices = slices;
|
||||||
slices.forEach(function(slice, index) {
|
slices.forEach(function(slice, index) {
|
||||||
slice.doShells(1, -proc.laserOffset);
|
slice.doShells(1, -proc.laserOffset);
|
||||||
|
|
@ -59,7 +59,7 @@ var gs_kiri_laser = exports;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var breakout = true;
|
var breakout = !print.settings.process.outputLaserGroup;
|
||||||
var object = [];
|
var object = [];
|
||||||
|
|
||||||
slice.tops.forEach(function(top) {
|
slice.tops.forEach(function(top) {
|
||||||
|
|
@ -67,7 +67,7 @@ var gs_kiri_laser = exports;
|
||||||
laserOut(top.innerTraces(), object);
|
laserOut(top.innerTraces(), object);
|
||||||
if (breakout) {
|
if (breakout) {
|
||||||
objects.push(object);
|
objects.push(object);
|
||||||
objects = [];
|
object = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -184,8 +184,11 @@ var gs_kiri_slicer = exports;
|
||||||
zOrdered.sort(function(a,b) { return a - b});
|
zOrdered.sort(function(a,b) { return a - b});
|
||||||
}
|
}
|
||||||
|
|
||||||
// use Z indices in auto slice mode for laser
|
if (options.single) {
|
||||||
if (zInc === 0) {
|
// usually for laser single slice
|
||||||
|
zIndexes.push(zMin + zInc);
|
||||||
|
} else if (zInc === 0) {
|
||||||
|
// use Z indices in auto slice mode for laser
|
||||||
// find unique z-index offsets for slicing
|
// find unique z-index offsets for slicing
|
||||||
var zl = zOrdered
|
var zl = zOrdered
|
||||||
for (i = 0; i < zl.length - 1; i++) {
|
for (i = 0; i < zl.length - 1; i++) {
|
||||||
|
|
|
||||||
21
js/kiri.js
21
js/kiri.js
|
|
@ -188,10 +188,12 @@ self.kiri.license = exports.LICENSE;
|
||||||
processName: 1,
|
processName: 1,
|
||||||
laserOffset: 1,
|
laserOffset: 1,
|
||||||
laserSliceHeight: 1,
|
laserSliceHeight: 1,
|
||||||
|
laserSliceSingle: 1,
|
||||||
outputTileSpacing: 1,
|
outputTileSpacing: 1,
|
||||||
outputTileScaling: 1,
|
outputTileScaling: 1,
|
||||||
outputLaserPower: 1,
|
outputLaserPower: 1,
|
||||||
outputLaserSpeed: 1,
|
outputLaserSpeed: 1,
|
||||||
|
outputLaserGroup: 1,
|
||||||
outputOriginCenter: 1,
|
outputOriginCenter: 1,
|
||||||
outputInvertX: 1,
|
outputInvertX: 1,
|
||||||
outputInvertY: 1
|
outputInvertY: 1
|
||||||
|
|
@ -334,11 +336,13 @@ self.kiri.license = exports.LICENSE;
|
||||||
|
|
||||||
laserOffset: 0.25,
|
laserOffset: 0.25,
|
||||||
laserSliceHeight: 1,
|
laserSliceHeight: 1,
|
||||||
|
laserSliceSingle: false,
|
||||||
|
|
||||||
outputTileSpacing: 1, // LASER
|
outputTileSpacing: 1,
|
||||||
outputTileScaling: 1, // LASER
|
outputTileScaling: 1,
|
||||||
outputLaserPower: 100, // LASER
|
outputLaserPower: 100,
|
||||||
outputLaserSpeed: 1000, // LASER
|
outputLaserSpeed: 1000,
|
||||||
|
outputLaserGroup: true,
|
||||||
|
|
||||||
// --- CAM ---
|
// --- CAM ---
|
||||||
|
|
||||||
|
|
@ -1016,9 +1020,11 @@ self.kiri.license = exports.LICENSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ajax("/kiri/output-laser.html", function(html) {
|
ajax("/kiri/output-laser.html", function(html) {
|
||||||
|
let segments = 0;
|
||||||
|
currentPrint.output.forEach(layer => { segments += layer.length });
|
||||||
UI.print.innerHTML = html;
|
UI.print.innerHTML = html;
|
||||||
$('print-filename').value = filename;
|
$('print-filename').value = filename;
|
||||||
$('print-lines').value = currentPrint.lines;
|
$('print-lines').value = segments;
|
||||||
$('print-close').onclick = hideModal;
|
$('print-close').onclick = hideModal;
|
||||||
$('print-svg').onclick = download_svg;
|
$('print-svg').onclick = download_svg;
|
||||||
$('print-dxf').onclick = download_dxf;
|
$('print-dxf').onclick = download_dxf;
|
||||||
|
|
@ -2063,8 +2069,9 @@ self.kiri.license = exports.LICENSE;
|
||||||
// associate named process with the current device
|
// associate named process with the current device
|
||||||
settings.devproc[currentDeviceName()] = name;
|
settings.devproc[currentDeviceName()] = name;
|
||||||
|
|
||||||
// update selection display
|
// update selection display (off for laser)
|
||||||
$('selected-process').innerHTML = name;
|
$('selected-process').innerHTML = name;
|
||||||
|
$('selected').style.display = (mode !== 'LASER') ? 'block' : 'none';
|
||||||
|
|
||||||
updateFields();
|
updateFields();
|
||||||
if (!named) {
|
if (!named) {
|
||||||
|
|
@ -2570,7 +2577,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
outputTileScaling: UC.newInput("scaling", {title:"multiplier (0.1 to 100)", convert:UC.toInt, bound:UC.bound(0.1,100), modes:LASER}),
|
outputTileScaling: UC.newInput("scaling", {title:"multiplier (0.1 to 100)", convert:UC.toInt, bound:UC.bound(0.1,100), modes:LASER}),
|
||||||
outputLaserPower: UC.newInput("power", {title:"0 - 100 %", convert:UC.toInt, bound:UC.bound(1,100), modes:LASER}),
|
outputLaserPower: UC.newInput("power", {title:"0 - 100 %", convert:UC.toInt, bound:UC.bound(1,100), modes:LASER}),
|
||||||
outputLaserSpeed: UC.newInput("speed", {title:"millimeters / minute", convert:UC.toInt, modes:LASER}),
|
outputLaserSpeed: UC.newInput("speed", {title:"millimeters / minute", convert:UC.toInt, modes:LASER}),
|
||||||
outputLaserGroup: UC.newBoolean("group", onBooleanClick, {title:"retain layer as\nsingle grouped object", modes:LASER}),
|
outputLaserGroup: UC.newBoolean("layer group", onBooleanClick, {title:"retain layer as\nsingle grouped object", modes:LASER}),
|
||||||
|
|
||||||
outputTemp: UC.newInput("nozzle temp", {title:"degrees celsius", convert:UC.toInt, modes:FDM}),
|
outputTemp: UC.newInput("nozzle temp", {title:"degrees celsius", convert:UC.toInt, modes:FDM}),
|
||||||
outputBedTemp: UC.newInput("bed temp", {title:"degrees celsius", convert:UC.toInt, modes:FDM}),
|
outputBedTemp: UC.newInput("bed temp", {title:"degrees celsius", convert:UC.toInt, modes:FDM}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue