complete line type support
This commit is contained in:
parent
f30e3a0288
commit
ed0a831332
8 changed files with 39 additions and 32 deletions
|
|
@ -584,29 +584,13 @@
|
||||||
favorites:{},
|
favorites:{},
|
||||||
// map of device to last process setting (name)
|
// map of device to last process setting (name)
|
||||||
devproc: {},
|
devproc: {},
|
||||||
layers:{
|
|
||||||
layerOutline: true,
|
|
||||||
layerTrace: true,
|
|
||||||
layerFacing: true,
|
|
||||||
layerRough: true,
|
|
||||||
layerFinish: true,
|
|
||||||
layerFinishX: true,
|
|
||||||
layerFinishY: true,
|
|
||||||
layerDelta: false,
|
|
||||||
layerSolid: false,
|
|
||||||
layerSparse: true,
|
|
||||||
layerFill: true,
|
|
||||||
layerSupport: true,
|
|
||||||
layerPrint: false,
|
|
||||||
layerMoves: false
|
|
||||||
},
|
|
||||||
controller:{
|
controller:{
|
||||||
view: null,
|
view: null,
|
||||||
dark: false,
|
dark: false,
|
||||||
expert: true,
|
expert: true,
|
||||||
hoverPop: false,
|
hoverPop: false,
|
||||||
zoomSpeed: 1.0,
|
zoomSpeed: 1.0,
|
||||||
thinRender: false,
|
lineType: "path",
|
||||||
reverseZoom: true,
|
reverseZoom: true,
|
||||||
showOrigin: false,
|
showOrigin: false,
|
||||||
showRulers: false,
|
showRulers: false,
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,14 @@
|
||||||
platform.update_size();
|
platform.update_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lineTypeSave() {
|
||||||
|
const sel = UI.lineType.options[UI.lineType.selectedIndex];
|
||||||
|
if (sel) {
|
||||||
|
settings().controller.lineType = sel.value;
|
||||||
|
API.conf.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function detailSave() {
|
function detailSave() {
|
||||||
let level = UI.detail.options[UI.detail.selectedIndex];
|
let level = UI.detail.options[UI.detail.selectedIndex];
|
||||||
if (level) {
|
if (level) {
|
||||||
|
|
@ -120,7 +128,6 @@
|
||||||
control.freeLayout = UI.freeLayout.checked;
|
control.freeLayout = UI.freeLayout.checked;
|
||||||
control.alignTop = UI.alignTop.checked;
|
control.alignTop = UI.alignTop.checked;
|
||||||
control.reverseZoom = UI.reverseZoom.checked;
|
control.reverseZoom = UI.reverseZoom.checked;
|
||||||
control.thinRender = UI.thinRender.checked;
|
|
||||||
control.dark = UI.dark.checked;
|
control.dark = UI.dark.checked;
|
||||||
control.exportOcto = UI.exportOcto.checked;
|
control.exportOcto = UI.exportOcto.checked;
|
||||||
control.exportGhost = UI.exportGhost.checked;
|
control.exportGhost = UI.exportGhost.checked;
|
||||||
|
|
@ -1369,10 +1376,10 @@
|
||||||
reverseZoom: UC.newBoolean(LANG.op_invr_s, booleanSave, {title:LANG.op_invr_l}),
|
reverseZoom: UC.newBoolean(LANG.op_invr_s, booleanSave, {title:LANG.op_invr_l}),
|
||||||
|
|
||||||
lprefs: UC.newGroup(LANG.op_menu, $('prefs-gen2'), {inline: true}),
|
lprefs: UC.newGroup(LANG.op_menu, $('prefs-gen2'), {inline: true}),
|
||||||
thinRender: UC.newBoolean(LANG.op_thin_s, booleanSave, {title:LANG.op_thin_l, modes:FDM}),
|
|
||||||
showOrigin: UC.newBoolean(LANG.op_shor_s, booleanSave, {title:LANG.op_shor_l}),
|
showOrigin: UC.newBoolean(LANG.op_shor_s, booleanSave, {title:LANG.op_shor_l}),
|
||||||
showRulers: UC.newBoolean(LANG.op_shru_s, booleanSave, {title:LANG.op_shru_l}),
|
showRulers: UC.newBoolean(LANG.op_shru_s, booleanSave, {title:LANG.op_shru_l}),
|
||||||
showSpeeds: UC.newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}),
|
showSpeeds: UC.newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}),
|
||||||
|
lineType: UC.newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"),
|
||||||
|
|
||||||
layout: UC.newGroup(LANG.lo_menu, $('prefs-lay'), {inline: true}),
|
layout: UC.newGroup(LANG.lo_menu, $('prefs-lay'), {inline: true}),
|
||||||
alignTop: UC.newBoolean(LANG.op_alig_s, booleanSave, {title:LANG.op_alig_l}),
|
alignTop: UC.newBoolean(LANG.op_alig_s, booleanSave, {title:LANG.op_alig_l}),
|
||||||
|
|
@ -1920,6 +1927,7 @@
|
||||||
UI.alignTop.checked = control.alignTop;
|
UI.alignTop.checked = control.alignTop;
|
||||||
UI.reverseZoom.checked = control.reverseZoom;
|
UI.reverseZoom.checked = control.reverseZoom;
|
||||||
UI.decimate.checked = control.decimate;
|
UI.decimate.checked = control.decimate;
|
||||||
|
lineTypeSave();
|
||||||
detailSave();
|
detailSave();
|
||||||
|
|
||||||
// load script extensions
|
// load script extensions
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,13 @@
|
||||||
{ name: "good" },
|
{ name: "good" },
|
||||||
{ name: "fair" },
|
{ name: "fair" },
|
||||||
{ name: "poor" },
|
{ name: "poor" },
|
||||||
|
],
|
||||||
|
linetype: [
|
||||||
|
{ name: "path" },
|
||||||
|
{ name: "flat" },
|
||||||
|
{ name: "line" }
|
||||||
]
|
]
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const tweak = {
|
const tweak = {
|
||||||
|
|
@ -1447,7 +1453,6 @@
|
||||||
function updateFields() {
|
function updateFields() {
|
||||||
updateFieldsFromSettings(settings.device);
|
updateFieldsFromSettings(settings.device);
|
||||||
updateFieldsFromSettings(settings.process);
|
updateFieldsFromSettings(settings.process);
|
||||||
updateFieldsFromSettings(settings.layers);
|
|
||||||
updateFieldsFromSettings(settings.controller);
|
updateFieldsFromSettings(settings.controller);
|
||||||
updateExtruderFields(settings.device);
|
updateExtruderFields(settings.device);
|
||||||
}
|
}
|
||||||
|
|
@ -1490,7 +1495,6 @@
|
||||||
}
|
}
|
||||||
updateSettingsFromFields(settings.device);
|
updateSettingsFromFields(settings.device);
|
||||||
updateSettingsFromFields(settings.process);
|
updateSettingsFromFields(settings.process);
|
||||||
updateSettingsFromFields(settings.layers);
|
|
||||||
let device = settings.device;
|
let device = settings.device;
|
||||||
if (device.extruders && device.extruders[device.internal]) {
|
if (device.extruders && device.extruders[device.internal]) {
|
||||||
updateSettingsFromFields(device.extruders[device.internal]);
|
updateSettingsFromFields(device.extruders[device.internal]);
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
|
|
||||||
const output = scope.output = [ seq ];
|
const output = scope.output = [ seq ];
|
||||||
|
|
||||||
function G0G1(moving, line) {
|
function G0G1(g0, line) {
|
||||||
const mov = {};
|
const mov = {};
|
||||||
line.forEach(function(tok) {
|
line.forEach(function(tok) {
|
||||||
if (abs) {
|
if (abs) {
|
||||||
|
|
@ -157,6 +157,8 @@
|
||||||
factor * pos.Z + off.Z + xoff.Z + dz
|
factor * pos.Z + off.Z + xoff.Z + dz
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const moving = g0 || (fdm && pos.E <= 0);
|
||||||
|
|
||||||
// always add moves to the current sequence
|
// always add moves to the current sequence
|
||||||
if (moving) {
|
if (moving) {
|
||||||
addOutput(seq, point, false, pos.F, tool);
|
addOutput(seq, point, false, pos.F, tool);
|
||||||
|
|
@ -218,7 +220,7 @@
|
||||||
G0G1(true, line);
|
G0G1(true, line);
|
||||||
break;
|
break;
|
||||||
case 'G1':
|
case 'G1':
|
||||||
G0G1(fdm ? pos.E <= 0 : false, line);
|
G0G1(false, line);
|
||||||
break;
|
break;
|
||||||
case 'M6':
|
case 'M6':
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -180,14 +180,14 @@ KIRI.worker = {
|
||||||
const print = current.print = KIRI.newPrint(settings, Object.values(cache));
|
const print = current.print = KIRI.newPrint(settings, Object.values(cache));
|
||||||
const tools = settings.device.extruders;
|
const tools = settings.device.extruders;
|
||||||
const mode = settings.mode;
|
const mode = settings.mode;
|
||||||
const thin = settings.controller.thinRender || mode !== 'FDM';
|
const thin = settings.controller.lineType === 'line' || mode !== 'FDM';
|
||||||
|
const flat = settings.controller.lineType === 'flat' && mode === 'FDM';
|
||||||
const parsed = print.parseGCode(code, offset, progress => {
|
const parsed = print.parseGCode(code, offset, progress => {
|
||||||
send.data({ progress: progress * 0.5 });
|
send.data({ progress: progress * 0.5 });
|
||||||
}, done => {
|
}, done => {
|
||||||
const layers = KIRI.driver.FDM.prepareRender(done.output, progress => {
|
const layers = KIRI.driver.FDM.prepareRender(done.output, progress => {
|
||||||
send.data({ progress: 0.5 + progress * 0.5 });
|
send.data({ progress: 0.5 + progress * 0.5 });
|
||||||
}, { thin, tools, xspeed: mode === 'FDM' });
|
}, { thin, flat, tools });
|
||||||
send.done({parsed: KIRI.codec.encode(layers)});
|
send.done({parsed: KIRI.codec.encode(layers)});
|
||||||
}, { fdm : mode === 'FDM' });
|
}, { fdm : mode === 'FDM' });
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@
|
||||||
slices = [],
|
slices = [],
|
||||||
sliceEntry,
|
sliceEntry,
|
||||||
print = self.worker.print = KIRI.newPrint(settings, widgets),
|
print = self.worker.print = KIRI.newPrint(settings, widgets),
|
||||||
isThin = settings.controller.thinRender;
|
isThin = settings.controller.lineType === "line",
|
||||||
|
isFlat = settings.controller.lineType === "flat";
|
||||||
|
|
||||||
// TODO pick a widget with a slice on the first layer and use that nozzle
|
// TODO pick a widget with a slice on the first layer and use that nozzle
|
||||||
// create brim, skirt, raft if specificed in FDM mode (code shared by laser)
|
// create brim, skirt, raft if specificed in FDM mode (code shared by laser)
|
||||||
|
|
@ -376,7 +377,7 @@
|
||||||
print.output = output;
|
print.output = output;
|
||||||
print.render = FDM.prepareRender(output, progress => {
|
print.render = FDM.prepareRender(output, progress => {
|
||||||
update(0.5 + progress * 0.5);
|
update(0.5 + progress * 0.5);
|
||||||
}, { tools: device.extruders, thin: isThin });
|
}, { tools: device.extruders, thin: isThin, flat: isFlat });
|
||||||
|
|
||||||
return print.render;
|
return print.render;
|
||||||
};
|
};
|
||||||
|
|
@ -507,7 +508,7 @@
|
||||||
.addPolys(moves, { thin: true, z: opts.z });
|
.addPolys(moves, { thin: true, z: opts.z });
|
||||||
Object.values(prints).forEach(array => {
|
Object.values(prints).forEach(array => {
|
||||||
array.forEach(poly => {
|
array.forEach(poly => {
|
||||||
if (poly.appearsClosed()) {
|
if (flat && poly.appearsClosed()) {
|
||||||
poly.setClosed();
|
poly.setClosed();
|
||||||
poly.points.pop();
|
poly.points.pop();
|
||||||
poly.length--;
|
poly.length--;
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@
|
||||||
sliceFillAngle = spro.sliceFillAngle,
|
sliceFillAngle = spro.sliceFillAngle,
|
||||||
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;
|
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;
|
||||||
|
|
||||||
isFlat = false;
|
isFlat = settings.controller.lineType === "flat";
|
||||||
isThin = !isFlat && settings.controller.thinRender;
|
isThin = !isFlat && settings.controller.lineType === "line";
|
||||||
offset = nozzleSize / 2;
|
offset = nozzleSize / 2;
|
||||||
|
|
||||||
if (isFlat) {
|
if (isFlat) {
|
||||||
|
|
@ -84,7 +84,13 @@
|
||||||
color.line = 1
|
color.line = 1
|
||||||
color.opacity = 0.5;
|
color.opacity = 0.5;
|
||||||
});
|
});
|
||||||
};
|
} else {
|
||||||
|
Object.values(COLOR).forEach(color => {
|
||||||
|
color.flat = false;
|
||||||
|
color.line = 1
|
||||||
|
color.opacity = 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!(sliceHeight > 0 && sliceHeight < 100)) {
|
if (!(sliceHeight > 0 && sliceHeight < 100)) {
|
||||||
return ondone("invalid slice height");
|
return ondone("invalid slice height");
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,8 @@ kiri.lang['en-us'] = {
|
||||||
op_invr_l: "invert mouse wheel\nscroll zoom",
|
op_invr_l: "invert mouse wheel\nscroll zoom",
|
||||||
op_thin_s: "thin lines",
|
op_thin_s: "thin lines",
|
||||||
op_thin_l: "faster part visualization\nsacrificing visual quality",
|
op_thin_l: "faster part visualization\nsacrificing visual quality",
|
||||||
|
op_line_s: "line type",
|
||||||
|
op_line_l: "line style for path rendering\nimpacts 3d performance\npath: 3d best\nflat: 2d good\nline = 1d fast",
|
||||||
op_unit_s: "units",
|
op_unit_s: "units",
|
||||||
op_unit_l: "workspace units affects\nspeeds and distances",
|
op_unit_l: "workspace units affects\nspeeds and distances",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue