add 'animate' button when action is valid. trace info on hover. bump rev 2.4.D10
This commit is contained in:
parent
dfd2dacac7
commit
d252b7d1f6
13 changed files with 79 additions and 43 deletions
4
notes.md
4
notes.md
|
|
@ -1,8 +1,6 @@
|
|||
# Kiri:Moto todo and notes
|
||||
|
||||
## 2.4 roadmap
|
||||
* `cnc`
|
||||
* - compute tolerance from animesh when set to 0
|
||||
* `laser`
|
||||
* - drag knife support
|
||||
* `all`
|
||||
|
|
@ -65,6 +63,8 @@
|
|||
|
||||
# CAM
|
||||
|
||||
* `B` crossing interior open spaces doesn't lift high enough
|
||||
* https://forum.grid.space/t/g0-movement-hits-the-stock-using-custom-tabs-positioning/171/2
|
||||
* `B` climb vs conventional not fully consistent after refactor
|
||||
* `B` outside cutting direction in roughing mode inverted
|
||||
* `B` top clearing operations should use linear, not offset, passes
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "grid-apps",
|
||||
"version": "2.4.9D",
|
||||
"version": "2.4.10D",
|
||||
"description": "grid.space 3d slice & modeling tools",
|
||||
"author": "Stewart Allen <sa@grid.space>",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -1332,6 +1332,7 @@
|
|||
func: {
|
||||
slice: $('act-slice'),
|
||||
preview: $('act-preview'),
|
||||
animate: $('act-animate'),
|
||||
export: $('act-export')
|
||||
},
|
||||
|
||||
|
|
@ -1604,7 +1605,7 @@
|
|||
camContourOver: UC.newInput(LANG.cc_sovr_s, {title:LANG.cc_sovr_l, convert:UC.toFloat, bound:UC.bound(0.05,1.0), modes:CAM}),
|
||||
camContourSpeed: UC.newInput(LANG.cc_feed_s, {title:LANG.cc_feed_l, convert:UC.toInt, modes:CAM, units:true}),
|
||||
camContourAngle: UC.newInput(LANG.cf_angl_s, {title:LANG.cf_angl_l, convert:UC.toFloat, bound:UC.bound(45,90), modes:CAM}),
|
||||
camTolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0.001,1.0), modes:CAM, units:true}),
|
||||
camTolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), modes:CAM, units:true}),
|
||||
camContourCurves: UC.newBoolean(LANG.cf_curv_s, onBooleanClick, {title:LANG.cf_curv_l, modes:CAM}),
|
||||
camContourIn: UC.newBoolean(LANG.cf_olin_s, onBooleanClick, {title:LANG.cf_olin_l, modes:CAM}),
|
||||
camContourSep: UC.newBlank({class:"pop-sep"}),
|
||||
|
|
@ -2000,15 +2001,15 @@
|
|||
|
||||
API.platform.update_size();
|
||||
|
||||
SPACE.mouse.onHover((int, ev, ints) => {
|
||||
SPACE.mouse.onHover((int, event, ints) => {
|
||||
if (!API.feature.hover) return;
|
||||
if (!int) return API.widgets.meshes();
|
||||
API.event.emit('mouse.hover', {int, ints, point: int.point, type: 'widget'});
|
||||
API.event.emit('mouse.hover', {int, event, point: int.point, type: 'widget'});
|
||||
});
|
||||
|
||||
SPACE.platform.onHover((int, ev) => {
|
||||
SPACE.platform.onHover((int, event) => {
|
||||
if (!API.feature.hover) return;
|
||||
if (int) API.event.emit('mouse.hover', {point: int, type: 'platform'});
|
||||
if (int) API.event.emit('mouse.hover', {point: int, event, type: 'platform'});
|
||||
});
|
||||
|
||||
SPACE.mouse.downSelect((int,event) => {
|
||||
|
|
@ -2255,6 +2256,7 @@
|
|||
UI.trash.onclick = API.selection.delete;
|
||||
UI.func.slice.onclick = (ev) => { ev.stopPropagation(); API.function.slice() };
|
||||
UI.func.preview.onclick = (ev) => { ev.stopPropagation(); API.function.print() };
|
||||
UI.func.animate.onclick = (ev) => { ev.stopPropagation(); API.function.animate() };
|
||||
UI.func.export.onclick = (ev) => { ev.stopPropagation(); API.function.export() };
|
||||
$('view-arrange').onclick = API.platform.layout;
|
||||
$('view-top').onclick = SPACE.view.top;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@
|
|||
showFavorites = SDB.getItem('dev-favorites') === 'true',
|
||||
alerts = [],
|
||||
grouping = false,
|
||||
saveTimer = null;
|
||||
saveTimer = null,
|
||||
noop = () => {};
|
||||
|
||||
DBUG.enable();
|
||||
|
||||
|
|
@ -236,8 +237,8 @@
|
|||
},
|
||||
device: {
|
||||
get: currentDeviceName,
|
||||
set: undefined, // set during init
|
||||
clone: undefined // set during init
|
||||
set: noop, // set during init
|
||||
clone: noop // set during init
|
||||
},
|
||||
dialog: {
|
||||
show: showModal,
|
||||
|
|
@ -259,6 +260,7 @@
|
|||
slice: prepareSlices,
|
||||
print: preparePreview,
|
||||
prepare: preparePreview,
|
||||
animate: noop,
|
||||
export: prepareExport,
|
||||
cancel: cancelWorker,
|
||||
clear: KIRI.client.clear
|
||||
|
|
@ -292,7 +294,7 @@
|
|||
selection,
|
||||
show: {
|
||||
alert: alert2,
|
||||
devices: undefined, // set during init
|
||||
devices: noop, // set during init
|
||||
progress: setProgress,
|
||||
controls: setControlsVisible,
|
||||
favorites: getShowFavorites,
|
||||
|
|
|
|||
|
|
@ -766,9 +766,8 @@
|
|||
}
|
||||
|
||||
// unlike other elements, does not auto-add to a row
|
||||
function newButton(label, action, options) {
|
||||
let opt = options || {},
|
||||
b = DOC.createElement('button');
|
||||
function newButton(label, action, opt = {}) {
|
||||
let b = DOC.createElement('button');
|
||||
|
||||
b.onclick = function() {
|
||||
hidePoppers();
|
||||
|
|
@ -785,12 +784,15 @@
|
|||
d.innerHTML = opt.icon;
|
||||
b.appendChild(d);
|
||||
}
|
||||
if (opt.title) {
|
||||
b.setAttribute('title', opt.title);
|
||||
}
|
||||
if (label) {
|
||||
b.appendChild(DOC.createTextNode(label));
|
||||
}
|
||||
|
||||
addModeControls(b, options);
|
||||
addId(b, options);
|
||||
addModeControls(b, opt);
|
||||
addId(b, opt);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
let terms = {
|
||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||
LICENSE: "See the license.md file included with the source distribution",
|
||||
VERSION: "2.4.D9"
|
||||
VERSION: "2.4.D10"
|
||||
};
|
||||
|
||||
if (typeof(module) === 'object') {
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ self.kiri.loader.push(function() {
|
|||
layer.innerHTML = '';
|
||||
UC.setGroup(layer);
|
||||
UC.newRow([
|
||||
UC.newButton(null,replay,{icon:'<i class="fas fa-fast-backward"></i>'}),
|
||||
UC.newButton(null,play,{icon:'<i class="fas fa-play"></i>'}),
|
||||
UC.newButton(null,step,{icon:'<i class="fas fa-step-forward"></i>'}),
|
||||
UC.newButton(null,fast,{icon:'<i class="fas fa-fast-forward"></i>'}),
|
||||
UC.newButton(null,pause,{icon:'<i class="fas fa-pause"></i>'}),
|
||||
UC.newButton(null,replay,{icon:'<i class="fas fa-fast-backward"></i>',title:"restart"}),
|
||||
UC.newButton(null,play,{icon:'<i class="fas fa-play"></i>',title:"play"}),
|
||||
UC.newButton(null,step,{icon:'<i class="fas fa-step-forward"></i>',title:"step"}),
|
||||
UC.newButton(null,fast,{icon:'<i class="fas fa-forward"></i>',title:"faster"}),
|
||||
UC.newButton(null,pause,{icon:'<i class="fas fa-pause"></i>',title:"pause"}),
|
||||
speedLabel = UC.newLabel("speed")
|
||||
]);
|
||||
updateSpeed();
|
||||
|
|
|
|||
|
|
@ -36,6 +36,15 @@
|
|||
|
||||
toolInfo = $('tool-info');
|
||||
|
||||
// wire up animate button in ui
|
||||
api.function.animate = () => {
|
||||
api.function.prepare(() => {
|
||||
if (isCamMode && camStock) {
|
||||
animate();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
api.event.on("mode.set", (mode) => {
|
||||
isCamMode = mode === 'CAM';
|
||||
$('set-tools').style.display = isCamMode ? '' : 'none';
|
||||
|
|
@ -44,6 +53,7 @@
|
|||
if (!isCamMode) {
|
||||
func.tabClear();
|
||||
func.traceDone();
|
||||
UI.func.animate.style.display = 'none';
|
||||
}
|
||||
// do not persist traces across page reloads
|
||||
func.traceClear();
|
||||
|
|
@ -243,7 +253,6 @@
|
|||
KIRI.api.widgets.opacity(0.5);
|
||||
KIRI.api.widgets.for(widget => {
|
||||
if (ids.indexOf(widget.id) >= 0) {
|
||||
console.log('clear_traces', widget.id);
|
||||
clearTraces(widget);
|
||||
widget.trace_stack = null;
|
||||
}
|
||||
|
|
@ -312,6 +321,12 @@
|
|||
}
|
||||
lastTrace = data.int.object;
|
||||
if (lastTrace.selected) {
|
||||
let event = data.event;
|
||||
let target = event.target;
|
||||
let { clientX, clientY } = event;
|
||||
let { offsetWidth, offsetHeight } = target;
|
||||
toolInfo.style.right = `${offsetWidth - clientX + 5}px`;
|
||||
toolInfo.style.bottom = `${offsetHeight - clientY + 5}px`;
|
||||
let traceInfo = lastTrace.trace.poly.traceInfo;
|
||||
let tool = new CAM.Tool(current, traceInfo.tool);
|
||||
toolInfo.innerText = [
|
||||
|
|
@ -537,9 +552,13 @@
|
|||
let csox = 0;
|
||||
let csoy = 0;
|
||||
let stock = settings.stock = { };
|
||||
let compute = enabled && stockSet && widgets.length;
|
||||
|
||||
UI.func.animate.style.display = refresh ? '' : 'none';
|
||||
|
||||
// create/inject cam stock if stock size other than default
|
||||
if (enabled && stockSet && widgets.length) {
|
||||
if (compute) {
|
||||
UI.func.animate.style.display = '';
|
||||
let csx = proc.camStockX;
|
||||
let csy = proc.camStockY;
|
||||
let csz = proc.camStockZ;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@
|
|||
|
||||
// drop points too close together
|
||||
if (deltaXY < 0.001 && point.z === lastPoint.z) {
|
||||
console.trace(["drop dup",lastPoint,point]);
|
||||
// console.trace(["drop dup",lastPoint,point]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,20 +18,13 @@
|
|||
noop = function() {};
|
||||
|
||||
class Topo {
|
||||
constructor(widget, settings, options) {
|
||||
const opt = options || {},
|
||||
ondone = opt.ondone || noop,
|
||||
onupdate = opt.onupdate || noop,
|
||||
shadow = opt.shadow,
|
||||
constructor(widget, settings, opt = {}) {
|
||||
const density = parseInt(settings.controller.animesh) * 2500,
|
||||
proc = settings.process,
|
||||
inside = proc.camContourIn,
|
||||
resolution = proc.camTolerance,
|
||||
tool = new CAM.Tool(settings, proc.camContourTool),
|
||||
toolOffset = tool.generateProfile(resolution).profile,
|
||||
toolDiameter = tool.fluteDiameter(),
|
||||
toolStep = toolDiameter * proc.camContourOver,
|
||||
traceJoin = toolDiameter / 2,
|
||||
pocketOnly = proc.camOutlinePocket,
|
||||
tolerance = proc.camTolerance,
|
||||
onupdate = opt.onupdate || noop,
|
||||
ondone = opt.ondone || noop,
|
||||
shadow = opt.shadow,
|
||||
bounds = widget.getBoundingBox().clone(),
|
||||
minX = bounds.min.x,
|
||||
maxX = bounds.max.x,
|
||||
|
|
@ -41,6 +34,14 @@
|
|||
zMin = Math.max(bounds.min.z, zBottom) + 0.0001,
|
||||
boundsX = maxX - minX,
|
||||
boundsY = maxY - minY,
|
||||
inside = proc.camContourIn,
|
||||
resolution = tolerance ? tolerance : 1/Math.sqrt(density/(boundsX * boundsY)),
|
||||
tool = new CAM.Tool(settings, proc.camContourTool),
|
||||
toolOffset = tool.generateProfile(resolution).profile,
|
||||
toolDiameter = tool.fluteDiameter(),
|
||||
toolStep = toolDiameter * proc.camContourOver,
|
||||
traceJoin = toolDiameter / 2,
|
||||
pocketOnly = proc.camOutlinePocket,
|
||||
maxangle = proc.camContourAngle,
|
||||
curvesOnly = proc.camContourCurves,
|
||||
R2A = 180 / Math.PI,
|
||||
|
|
@ -73,6 +74,10 @@
|
|||
debug_topo_lines = debug && true,
|
||||
debug_topo_shells = debug && true;
|
||||
|
||||
if (tolerance == 0) {
|
||||
console.log(`contour auto tolerance`,resolution.round(4));
|
||||
}
|
||||
|
||||
if (tabs) {
|
||||
clipTab.appendAll(tabs.map(tab => {
|
||||
let ctab = POLY.expand([tab.poly], toolDiameter/2);
|
||||
|
|
|
|||
|
|
@ -1199,10 +1199,12 @@ th, tr, td, label {
|
|||
#tool-info {
|
||||
position: fixed;
|
||||
white-space: pre;
|
||||
background-color: rgba(255,255,255,0.25);
|
||||
border: 1px solid rgba(0,0,0,0.25);
|
||||
border-radius: 4px;
|
||||
padding: 4px;
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
bottom: 5px;
|
||||
left: 5px;
|
||||
color: #000;
|
||||
}
|
||||
#winfo {
|
||||
|
|
|
|||
|
|
@ -131,11 +131,15 @@
|
|||
<i class="fas fa-bars"></i>
|
||||
<label>slice</label>
|
||||
<div id="pop-slice" class="pop-lcol f-row">
|
||||
<div id="act-preview" xclass="lt-menu lt-enabled">
|
||||
<div id="act-preview" xclass="lt-menu">
|
||||
<i class="fas fa-cubes"></i>
|
||||
<label>preview</label>
|
||||
</div>
|
||||
<div id="act-export" xclass="lt-menu lt-enabled">
|
||||
<div id="act-animate" xclass="lt-menu">
|
||||
<i class="fas fa-running"></i>
|
||||
<label>animate</label>
|
||||
</div>
|
||||
<div id="act-export" xclass="lt-menu">
|
||||
<i class="fas fa-file-download"></i>
|
||||
<label>export</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ kiri.lang['en-us'] = {
|
|||
|
||||
// OUTPUT CAM
|
||||
ou_toll_s: "tolerance",
|
||||
ou_toll_l: "surface precision\nin workspace units\nlower is slower and\nuses more memory",
|
||||
ou_toll_l: "surface precision\nin workspace units\nlower is slower and\nuses more memory\n0 = automatic based\non animate preference",
|
||||
ou_ztof_s: "z top offset",
|
||||
ou_ztof_l: "offset from stock surface\nto top face of part\nin workspace units",
|
||||
ou_zbot_s: "z bottom",
|
||||
|
|
|
|||
Loading…
Reference in a new issue