add workspace auto-save. add path line caps
This commit is contained in:
parent
ba56b36af2
commit
23f33083c9
7 changed files with 58 additions and 21 deletions
3
notes.md
3
notes.md
|
|
@ -1,9 +1,7 @@
|
||||||
# Kiri:Moto todo
|
# Kiri:Moto todo
|
||||||
|
|
||||||
## 2.3 remaining
|
## 2.3 remaining
|
||||||
* cap path ends
|
|
||||||
* fix ruler axis name label
|
* fix ruler axis name label
|
||||||
* onshape mouse mapping option
|
|
||||||
|
|
||||||
## 2.4 tenative list
|
## 2.4 tenative list
|
||||||
* cnc
|
* cnc
|
||||||
|
|
@ -33,6 +31,7 @@
|
||||||
* `P` duplicate objects should share same slice data unless rotated or scaled
|
* `P` duplicate objects should share same slice data unless rotated or scaled
|
||||||
* `P` worker state cache cleanup and organization
|
* `P` worker state cache cleanup and organization
|
||||||
* `P` client/worker interface normalization and cleanup
|
* `P` client/worker interface normalization and cleanup
|
||||||
|
* `C` improve path line caps
|
||||||
|
|
||||||
# FDM
|
# FDM
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,7 @@
|
||||||
hoverPop: false,
|
hoverPop: false,
|
||||||
zoomSpeed: 1.0,
|
zoomSpeed: 1.0,
|
||||||
lineType: "path",
|
lineType: "path",
|
||||||
|
autoSave: true,
|
||||||
reverseZoom: true,
|
reverseZoom: true,
|
||||||
showOrigin: false,
|
showOrigin: false,
|
||||||
showRulers: false,
|
showRulers: false,
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
CATALOG.putFile("sample cube.stl", vert);
|
CATALOG.putFile("sample cube.stl", vert);
|
||||||
platform.compute_max_z();
|
platform.compute_max_z();
|
||||||
SPACE.view.home();
|
SPACE.view.home();
|
||||||
setTimeout(API.space.save,500);
|
setTimeout(() => { API.space.save(true) },500);
|
||||||
then();
|
then();
|
||||||
API.help.show();
|
API.help.show();
|
||||||
});
|
});
|
||||||
|
|
@ -129,6 +129,7 @@
|
||||||
control.autoLayout = UI.autoLayout.checked;
|
control.autoLayout = UI.autoLayout.checked;
|
||||||
control.freeLayout = UI.freeLayout.checked;
|
control.freeLayout = UI.freeLayout.checked;
|
||||||
control.alignTop = UI.alignTop.checked;
|
control.alignTop = UI.alignTop.checked;
|
||||||
|
control.autoSave = UI.autoSave.checked;
|
||||||
control.reverseZoom = UI.reverseZoom.checked;
|
control.reverseZoom = UI.reverseZoom.checked;
|
||||||
control.dark = UI.dark.checked;
|
control.dark = UI.dark.checked;
|
||||||
control.exportOcto = UI.exportOcto.checked;
|
control.exportOcto = UI.exportOcto.checked;
|
||||||
|
|
@ -243,27 +244,27 @@
|
||||||
case 37: // left arrow
|
case 37: // left arrow
|
||||||
if (inputHasFocus()) return false;
|
if (inputHasFocus()) return false;
|
||||||
if (deg) API.selection.rotate(0, 0, -deg);
|
if (deg) API.selection.rotate(0, 0, -deg);
|
||||||
if (move > 0) moveSelection(-move, 0, 0);
|
if (move > 0) API.selection.move(-move, 0, 0);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
break;
|
break;
|
||||||
case 39: // right arrow
|
case 39: // right arrow
|
||||||
if (inputHasFocus()) return false;
|
if (inputHasFocus()) return false;
|
||||||
if (deg) API.selection.rotate(0, 0, deg);
|
if (deg) API.selection.rotate(0, 0, deg);
|
||||||
if (move > 0) moveSelection(move, 0, 0);
|
if (move > 0) API.selection.move(move, 0, 0);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
break;
|
break;
|
||||||
case 38: // up arrow
|
case 38: // up arrow
|
||||||
if (inputHasFocus()) return false;
|
if (inputHasFocus()) return false;
|
||||||
if (evt.metaKey) return API.show.layer(API.var.layer_at+1);
|
if (evt.metaKey) return API.show.layer(API.var.layer_at+1);
|
||||||
if (deg) API.selection.rotate(deg, 0, 0);
|
if (deg) API.selection.rotate(deg, 0, 0);
|
||||||
if (move > 0) moveSelection(0, move, 0);
|
if (move > 0) API.selection.move(0, move, 0);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
break;
|
break;
|
||||||
case 40: // down arrow
|
case 40: // down arrow
|
||||||
if (inputHasFocus()) return false;
|
if (inputHasFocus()) return false;
|
||||||
if (evt.metaKey) return API.show.layer(API.var.layer_at-1);
|
if (evt.metaKey) return API.show.layer(API.var.layer_at-1);
|
||||||
if (deg) API.selection.rotate(-deg, 0, 0);
|
if (deg) API.selection.rotate(-deg, 0, 0);
|
||||||
if (move > 0) moveSelection(0, -move, 0);
|
if (move > 0) API.selection.move(0, -move, 0);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
break;
|
break;
|
||||||
case 65: // 'a' for select all
|
case 65: // 'a' for select all
|
||||||
|
|
@ -1383,12 +1384,13 @@
|
||||||
], {modes:GCODE, class:"ext-buttons f-row"}),
|
], {modes:GCODE, class:"ext-buttons f-row"}),
|
||||||
|
|
||||||
lprefs: UC.newGroup(LANG.op_menu, $('prefs-gen1'), {inline: true}),
|
lprefs: UC.newGroup(LANG.op_menu, $('prefs-gen1'), {inline: true}),
|
||||||
expert: UC.newBoolean(LANG.op_xprt_s, booleanSave, {title:LANG.op_xprt_l}),
|
autoSave: UC.newBoolean(LANG.op_auto_s, booleanSave, {title:LANG.op_auto_l}),
|
||||||
hoverPop: UC.newBoolean(LANG.op_hopo_s, booleanSave, {title:LANG.op_hopo_l}),
|
hoverPop: UC.newBoolean(LANG.op_hopo_s, booleanSave, {title:LANG.op_hopo_l}),
|
||||||
dark: UC.newBoolean(LANG.op_dark_s, booleanSave, {title:LANG.op_dark_l}),
|
dark: UC.newBoolean(LANG.op_dark_s, booleanSave, {title:LANG.op_dark_l}),
|
||||||
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}),
|
||||||
|
expert: UC.newBoolean(LANG.op_xprt_s, booleanSave, {title:LANG.op_xprt_l}),
|
||||||
|
|
||||||
lprefs: UC.newGroup(LANG.op_menu, $('prefs-gen2'), {inline: true}),
|
lprefs: UC.newGroup(LANG.op_disp, $('prefs-gen2'), {inline: true}),
|
||||||
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}),
|
||||||
|
|
@ -1983,6 +1985,7 @@
|
||||||
UI.autoLayout.checked = control.autoLayout;
|
UI.autoLayout.checked = control.autoLayout;
|
||||||
UI.alignTop.checked = control.alignTop;
|
UI.alignTop.checked = control.alignTop;
|
||||||
UI.reverseZoom.checked = control.reverseZoom;
|
UI.reverseZoom.checked = control.reverseZoom;
|
||||||
|
UI.autoSave.checked = control.autoSave;
|
||||||
UI.decimate.checked = control.decimate;
|
UI.decimate.checked = control.decimate;
|
||||||
lineTypeSave();
|
lineTypeSave();
|
||||||
detailSave();
|
detailSave();
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@
|
||||||
busy = 0,
|
busy = 0,
|
||||||
showFavorites = SDB.getItem('dev-favorites') === 'true',
|
showFavorites = SDB.getItem('dev-favorites') === 'true',
|
||||||
alerts = [],
|
alerts = [],
|
||||||
grouping = false;
|
grouping = false,
|
||||||
|
saveTimer = null;
|
||||||
|
|
||||||
DBUG.enable();
|
DBUG.enable();
|
||||||
|
|
||||||
|
|
@ -108,7 +109,7 @@
|
||||||
set_axes: SPACE.platform.setAxes,
|
set_axes: SPACE.platform.setAxes,
|
||||||
set_volume: SPACE.platform.setVolume,
|
set_volume: SPACE.platform.setVolume,
|
||||||
top_z: () => { return topZ },
|
top_z: () => { return topZ },
|
||||||
clear: () => { platform.delete(WIDGETS.slice()) }
|
clear: () => { clearWorkspace(); saveWorkspace(true) }
|
||||||
};
|
};
|
||||||
|
|
||||||
const color = {
|
const color = {
|
||||||
|
|
@ -327,6 +328,16 @@
|
||||||
}, time || 100);
|
}, time || 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function auto_save() {
|
||||||
|
if (!settings.controller.autoSave) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clearTimeout(saveTimer);
|
||||||
|
saveTimer = setTimeout(() => {
|
||||||
|
API.space.save(true);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
/** ******************************************************************
|
/** ******************************************************************
|
||||||
* Stats accumulator
|
* Stats accumulator
|
||||||
******************************************************************* */
|
******************************************************************* */
|
||||||
|
|
@ -924,8 +935,8 @@
|
||||||
w.move(x, y, z, abs);
|
w.move(x, y, z, abs);
|
||||||
});
|
});
|
||||||
API.event.emit('selection.move', {x, y, z, abs});
|
API.event.emit('selection.move', {x, y, z, abs});
|
||||||
// platform.update_stock();
|
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
|
auto_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
function scaleSelection() {
|
function scaleSelection() {
|
||||||
|
|
@ -940,8 +951,8 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
updateSelectedInfo();
|
updateSelectedInfo();
|
||||||
// platform.update_stock(true);
|
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
|
auto_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
function rotateSelection(x, y, z) {
|
function rotateSelection(x, y, z) {
|
||||||
|
|
@ -951,8 +962,8 @@
|
||||||
platform.compute_max_z();
|
platform.compute_max_z();
|
||||||
API.event.emit('selection.rotate', {x, y, z});
|
API.event.emit('selection.rotate', {x, y, z});
|
||||||
updateSelectedInfo();
|
updateSelectedInfo();
|
||||||
// platform.update_stock(true);
|
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
|
auto_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ******************************************************************
|
/** ******************************************************************
|
||||||
|
|
@ -1204,6 +1215,7 @@
|
||||||
platform.select(widget, shift);
|
platform.select(widget, shift);
|
||||||
platform.compute_max_z();
|
platform.compute_max_z();
|
||||||
API.event.emit('widget.add', widget);
|
API.event.emit('widget.add', widget);
|
||||||
|
auto_save();
|
||||||
if (nolayout) {
|
if (nolayout) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1240,6 +1252,7 @@
|
||||||
platformUpdateSelected();
|
platformUpdateSelected();
|
||||||
if (feature.drop_layout) platform.layout();
|
if (feature.drop_layout) platform.layout();
|
||||||
API.event.emit('widget.delete', widget);
|
API.event.emit('widget.delete', widget);
|
||||||
|
auto_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
function platformSelectAll() {
|
function platformSelectAll() {
|
||||||
|
|
@ -1267,6 +1280,7 @@
|
||||||
|
|
||||||
setViewMode(VIEWS.ARRANGE);
|
setViewMode(VIEWS.ARRANGE);
|
||||||
hideSlices();
|
hideSlices();
|
||||||
|
auto_save();
|
||||||
|
|
||||||
// only auto-layout when in arrange mode
|
// only auto-layout when in arrange mode
|
||||||
if (oldmode !== VIEWS.ARRANGE) {
|
if (oldmode !== VIEWS.ARRANGE) {
|
||||||
|
|
@ -1622,7 +1636,7 @@
|
||||||
// alert2("drag/drop STL files onto platform to import\nreload page to return to last saved state");
|
// alert2("drag/drop STL files onto platform to import\nreload page to return to last saved state");
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveWorkspace() {
|
function saveWorkspace(quiet) {
|
||||||
API.conf.save();
|
API.conf.save();
|
||||||
let newWidgets = [],
|
let newWidgets = [],
|
||||||
oldWidgets = js2o(SDB.getItem('ws-widgets'), []);
|
oldWidgets = js2o(SDB.getItem('ws-widgets'), []);
|
||||||
|
|
@ -1643,7 +1657,9 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, "ws-save-" ,"ws-savf");
|
}, "ws-save-" ,"ws-savf");
|
||||||
alert2("workspace saved", 1);
|
if (!quiet) {
|
||||||
|
alert2("workspace saved", 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreSettings(save) {
|
function restoreSettings(save) {
|
||||||
|
|
|
||||||
|
|
@ -311,6 +311,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!contourClosed) {
|
||||||
|
// cheating because we know the profile length is 4 (for now)
|
||||||
|
const p1 = 0 + profile.count * 0;
|
||||||
|
const p2 = 1 + profile.count * 0;
|
||||||
|
const p3 = 2 + profile.count * 0;
|
||||||
|
const p4 = 3 + profile.count * 0;
|
||||||
|
index.push(p1, p2, p3);
|
||||||
|
index.push(p1, p3, p4);
|
||||||
|
const lc = lastCorner;
|
||||||
|
const p5 = 0 + profile.count * lc;
|
||||||
|
const p6 = 1 + profile.count * lc;
|
||||||
|
const p7 = 2 + profile.count * lc;
|
||||||
|
const p8 = 3 + profile.count * lc;
|
||||||
|
index.push(p7, p6, p5);
|
||||||
|
index.push(p8, p7, p5);
|
||||||
|
}
|
||||||
|
|
||||||
return {index, faces};
|
return {index, faces};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,14 @@ MOTO.CTRL = function (object, domElement, notify, slider) {
|
||||||
// default mouse buttons
|
// default mouse buttons
|
||||||
this.mouseDefault = {
|
this.mouseDefault = {
|
||||||
ORBIT: THREE.MOUSE.LEFT,
|
ORBIT: THREE.MOUSE.LEFT,
|
||||||
// ZOOM: THREE.MOUSE.MIDDLE,
|
ZOOM: THREE.MOUSE.MIDDLE,
|
||||||
PAN: THREE.MOUSE.RIGHT
|
PAN: THREE.MOUSE.RIGHT
|
||||||
};
|
};
|
||||||
|
|
||||||
// Onshape
|
// Onshape
|
||||||
this.mouseOnshape = {
|
this.mouseOnshape = {
|
||||||
ORBIT: THREE.MOUSE.RIGHT,
|
ORBIT: THREE.MOUSE.RIGHT,
|
||||||
// ZOOM: THREE.MOUSE.MIDDLE,
|
ZOOM: THREE.MOUSE.LEFT,
|
||||||
PAN: THREE.MOUSE.MIDDLE
|
PAN: THREE.MOUSE.MIDDLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,9 @@ kiri.lang['en-us'] = {
|
||||||
|
|
||||||
// OPTIONS
|
// OPTIONS
|
||||||
op_menu: "interface",
|
op_menu: "interface",
|
||||||
|
op_disp: "display",
|
||||||
op_xprt_s: "expert",
|
op_xprt_s: "expert",
|
||||||
op_xprt_l: "enable expert options",
|
op_xprt_l: "show more settings options",
|
||||||
op_hopo_s: "hover pop",
|
op_hopo_s: "hover pop",
|
||||||
op_hopo_l: "enable menu hover\nto activate",
|
op_hopo_l: "enable menu hover\nto activate",
|
||||||
op_dark_s: "dark mode",
|
op_dark_s: "dark mode",
|
||||||
|
|
@ -137,8 +138,8 @@ kiri.lang['en-us'] = {
|
||||||
op_free_l: "permit dragable layout\nno effect in laser mode",
|
op_free_l: "permit dragable layout\nno effect in laser mode",
|
||||||
op_invr_s: "invert zoom",
|
op_invr_s: "invert zoom",
|
||||||
op_invr_l: "invert mouse wheel\nscroll zoom",
|
op_invr_l: "invert mouse wheel\nscroll zoom",
|
||||||
op_thin_s: "thin lines",
|
op_auto_s: "auto save",
|
||||||
op_thin_l: "faster part visualization\nsacrificing visual quality",
|
op_auto_l: "preserve objects in workspace\nbetween application reloads",
|
||||||
op_line_s: "line type",
|
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_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",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue