add grid visibility controls for CAM indexed stock mode
This commit is contained in:
parent
1369edb8f3
commit
29f50728c5
7 changed files with 30 additions and 15 deletions
1
notes.md
1
notes.md
|
|
@ -88,7 +88,6 @@
|
||||||
* `F` add adaptive clearing strategy
|
* `F` add adaptive clearing strategy
|
||||||
* `F` add ease-down support to trace op
|
* `F` add ease-down support to trace op
|
||||||
* `F` add climb/conventional into each operation
|
* `F` add climb/conventional into each operation
|
||||||
* `F` add lathe mode / A-axis / 4th axis / rotary milling ops
|
|
||||||
* `F` add support for tapered ball mills
|
* `F` add support for tapered ball mills
|
||||||
* `F` change color of line selection in trace op when not a closed poly
|
* `F` change color of line selection in trace op when not a closed poly
|
||||||
* `F` limit cut depth to flute length of selected tool (or warn)
|
* `F` limit cut depth to flute length of selected tool (or warn)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto
|
||||||
|
|
||||||
# Release 3.7
|
# Release 3.7
|
||||||
|
|
||||||
|
* add CAM 4th axis indexing support, timeline op, updated visuals
|
||||||
* align FDM top/bottom layer options with convention
|
* align FDM top/bottom layer options with convention
|
||||||
* add Mesh:Tool SVG import options for extrusion depth and boolean repair
|
* add Mesh:Tool SVG import options for extrusion depth and boolean repair
|
||||||
* replace jscad/modeling with Manifold project for faster mesh boolean
|
* replace jscad/modeling with Manifold project for faster mesh boolean
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,8 @@ CAM.init = function(kiri, api) {
|
||||||
UC = api.uc;
|
UC = api.uc;
|
||||||
API = api;
|
API = api;
|
||||||
|
|
||||||
function zBottom() {
|
function updateAxisMode(refresh) {
|
||||||
return API.conf.get().process.camZBottom > 0;
|
const { camStockIndexGrid, camStockIndexed, camStockOn } = current.process;
|
||||||
}
|
|
||||||
|
|
||||||
function setAnimationStyle(refresh) {
|
|
||||||
const { camStockIndexed, camStockOn } = current.process;
|
|
||||||
let newIndexed = camStockIndexed && camStockOn;
|
let newIndexed = camStockIndexed && camStockOn;
|
||||||
let changed = refresh || isIndexed !== newIndexed;
|
let changed = refresh || isIndexed !== newIndexed;
|
||||||
isIndexed = newIndexed;
|
isIndexed = newIndexed;
|
||||||
|
|
@ -86,6 +82,7 @@ CAM.init = function(kiri, api) {
|
||||||
}
|
}
|
||||||
animVer = isIndexed ? 1 : 0;
|
animVer = isIndexed ? 1 : 0;
|
||||||
SPACE.platform.setVisible(!isIndexed);
|
SPACE.platform.setVisible(!isIndexed);
|
||||||
|
SPACE.platform.showGrid2(!isIndexed || camStockIndexGrid);
|
||||||
$('cam-index').style.display = isIndexed ? '' : 'none';
|
$('cam-index').style.display = isIndexed ? '' : 'none';
|
||||||
if (!changed) {
|
if (!changed) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -112,7 +109,7 @@ CAM.init = function(kiri, api) {
|
||||||
|
|
||||||
api.event.on("widget.add", widget => {
|
api.event.on("widget.add", widget => {
|
||||||
if (isCamMode && !Array.isArray(widget)) {
|
if (isCamMode && !Array.isArray(widget)) {
|
||||||
setAnimationStyle(true);
|
updateAxisMode(true);
|
||||||
widget.setIndexed(camStock && isIndexed ? camStock.scale.z : 0);
|
widget.setIndexed(camStock && isIndexed ? camStock.scale.z : 0);
|
||||||
api.platform.update_bounds();
|
api.platform.update_bounds();
|
||||||
}
|
}
|
||||||
|
|
@ -191,7 +188,7 @@ CAM.init = function(kiri, api) {
|
||||||
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
|
api.ui.camTabs.marker.style.display = hasTabs ? 'flex' : 'none';
|
||||||
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none';
|
||||||
api.platform.update_bounds();
|
api.platform.update_bounds();
|
||||||
setAnimationStyle();
|
updateAxisMode();
|
||||||
updateStock();
|
updateStock();
|
||||||
func.opRender();
|
func.opRender();
|
||||||
});
|
});
|
||||||
|
|
@ -201,7 +198,7 @@ CAM.init = function(kiri, api) {
|
||||||
if (!isCamMode) return;
|
if (!isCamMode) return;
|
||||||
validateTools(settings.tools);
|
validateTools(settings.tools);
|
||||||
restoreTabs(api.widgets.all());
|
restoreTabs(api.widgets.all());
|
||||||
setAnimationStyle();
|
updateAxisMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
api.event.on("boolean.click", api.platform.update_bounds);
|
api.event.on("boolean.click", api.platform.update_bounds);
|
||||||
|
|
@ -1155,6 +1152,10 @@ CAM.init = function(kiri, api) {
|
||||||
return current.device.spindleMax > 0;
|
return current.device.spindleMax > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function zBottom() {
|
||||||
|
return API.conf.get().process.camZBottom > 0;
|
||||||
|
}
|
||||||
|
|
||||||
createPopOp('level', {
|
createPopOp('level', {
|
||||||
tool: 'camLevelTool',
|
tool: 'camLevelTool',
|
||||||
spindle: 'camLevelSpindle',
|
spindle: 'camLevelSpindle',
|
||||||
|
|
|
||||||
|
|
@ -566,6 +566,7 @@ const conf = exports({
|
||||||
camStockOffset: true,
|
camStockOffset: true,
|
||||||
camStockClipTo: false,
|
camStockClipTo: false,
|
||||||
camStockIndexed: false,
|
camStockIndexed: false,
|
||||||
|
camStockIndexGrid: false,
|
||||||
camIndexAxis: 0,
|
camIndexAxis: 0,
|
||||||
camIndexAbs: true,
|
camIndexAbs: true,
|
||||||
camStockOn: true,
|
camStockOn: true,
|
||||||
|
|
|
||||||
|
|
@ -1918,6 +1918,7 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
camStockOffset: uc.newBoolean(LANG.cs_offs_s, onBooleanClick, {title:LANG.cs_offs_l, modes:CAM}),
|
camStockOffset: uc.newBoolean(LANG.cs_offs_s, onBooleanClick, {title:LANG.cs_offs_l, modes:CAM}),
|
||||||
camStockClipTo: uc.newBoolean(LANG.cs_clip_s, onBooleanClick, {title:LANG.cs_clip_l, modes:CAM}),
|
camStockClipTo: uc.newBoolean(LANG.cs_clip_s, onBooleanClick, {title:LANG.cs_clip_l, modes:CAM}),
|
||||||
camSep: uc.newBlank({class:"pop-sep"}),
|
camSep: uc.newBlank({class:"pop-sep"}),
|
||||||
|
camStockIndexGrid: uc.newBoolean(LANG.cs_ishg_s, onBooleanClick, {title:LANG.cs_ishg_l, modes:CAM, show:() => ui.camStockOn.checked && ui.camStockIndexed.checked}),
|
||||||
camStockIndexed: uc.newBoolean(LANG.cs_indx_s, onBooleanClick, {title:LANG.cs_indx_l, modes:CAM, show:() => ui.camStockOn.checked}),
|
camStockIndexed: uc.newBoolean(LANG.cs_indx_s, onBooleanClick, {title:LANG.cs_indx_l, modes:CAM, show:() => ui.camStockOn.checked}),
|
||||||
camStockOn: uc.newBoolean(LANG.cs_offe_s, onBooleanClick, {title:LANG.cs_offe_l, modes:CAM}),
|
camStockOn: uc.newBoolean(LANG.cs_offe_s, onBooleanClick, {title:LANG.cs_offe_l, modes:CAM}),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
showPlatform = true,
|
showPlatform = true,
|
||||||
hidePlatformBelow = true,
|
hidePlatformBelow = true,
|
||||||
hideGridBelow = false,
|
hideGridBelow = false,
|
||||||
|
showGridLines = true,
|
||||||
showFocus = 0,
|
showFocus = 0,
|
||||||
focalPoint = undefined,
|
focalPoint = undefined,
|
||||||
lightInfo = {
|
lightInfo = {
|
||||||
|
|
@ -73,7 +74,9 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
colorY: 0x6666ff,
|
colorY: 0x6666ff,
|
||||||
zoff: 0,
|
zoff: 0,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
view: undefined
|
view: undefined,
|
||||||
|
axes: undefined,
|
||||||
|
lines: undefined
|
||||||
},
|
},
|
||||||
ruler = {
|
ruler = {
|
||||||
x1: 0,
|
x1: 0,
|
||||||
|
|
@ -556,8 +559,13 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
function updateGrid() {
|
function updateGrid() {
|
||||||
let { view, unitMinor, unitMajor, colorMajor, colorMinor, colorX, colorY } = grid;
|
let { view, unitMinor, unitMajor, colorMajor, colorMinor, colorX, colorY } = grid;
|
||||||
let oldView = view;
|
let oldView = view;
|
||||||
|
let axes = grid.axes = new THREE.Group();
|
||||||
|
let lines = grid.lines = new THREE.Group();
|
||||||
|
|
||||||
view = grid.view = new THREE.Group();
|
view = grid.view = new THREE.Group();
|
||||||
view.visible = oldView ? oldView.visible : true;
|
view.visible = oldView ? oldView.visible : true;
|
||||||
|
view.add(lines);
|
||||||
|
view.add(axes);
|
||||||
|
|
||||||
let majors = [],
|
let majors = [],
|
||||||
minors = [],
|
minors = [],
|
||||||
|
|
@ -601,19 +609,20 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
let arr = modMatch(y, unitMajor) ? majors : minors;
|
let arr = modMatch(y, unitMajor) ? majors : minors;
|
||||||
arr.append({x:-ow, y:y-yo, z:zp}).append({x:ow, y:y-yo, z:zp});
|
arr.append({x:-ow, y:y-yo, z:zp}).append({x:ow, y:y-yo, z:zp});
|
||||||
}
|
}
|
||||||
view.add(makeLinesFromPoints(majors, colorMajor));
|
lines.add(makeLinesFromPoints(majors, colorMajor));
|
||||||
view.add(makeLinesFromPoints(minors, colorMinor));
|
lines.add(makeLinesFromPoints(minors, colorMinor));
|
||||||
view.add(makeLinesFromPoints([
|
axes.add(makeLinesFromPoints([
|
||||||
{x: -xo, y:y1-yo, z:zp},
|
{x: -xo, y:y1-yo, z:zp},
|
||||||
{x: -xo, y:y2-yo, z:zp},
|
{x: -xo, y:y2-yo, z:zp},
|
||||||
], colorY));
|
], colorY));
|
||||||
view.add(makeLinesFromPoints([
|
axes.add(makeLinesFromPoints([
|
||||||
{x: x1-xo, y:-yo, z:zp},
|
{x: x1-xo, y:-yo, z:zp},
|
||||||
{x: x2-xo, y:-yo, z:zp},
|
{x: x2-xo, y:-yo, z:zp},
|
||||||
], colorX));
|
], colorX));
|
||||||
|
|
||||||
Space.scene.remove(oldView);
|
Space.scene.remove(oldView);
|
||||||
Space.scene.add(grid.view);
|
Space.scene.add(grid.view);
|
||||||
|
lines.visible = showGridLines;
|
||||||
requestRefresh();
|
requestRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1178,6 +1187,7 @@ gapp.register("moto.space", [], (root, exports) => {
|
||||||
showVolume,
|
showVolume,
|
||||||
showGridBelow: (b) => { hideGridBelow = !b },
|
showGridBelow: (b) => { hideGridBelow = !b },
|
||||||
showGrid: (b) => { grid.view.visible = b },
|
showGrid: (b) => { grid.view.visible = b },
|
||||||
|
showGrid2: (b) => { showGridLines = grid.lines.visible = b },
|
||||||
setMaxZ: (z) => { panY = z / 2 },
|
setMaxZ: (z) => { panY = z / 2 },
|
||||||
setCenter: (x,y,z) => { panX = x; panY = z, panZ = y },
|
setCenter: (x,y,z) => { panX = x; panY = z, panZ = y },
|
||||||
setHidden: (b) => { showPlatform = !b; platform.visible = !b },
|
setHidden: (b) => { showPlatform = !b; platform.visible = !b },
|
||||||
|
|
|
||||||
|
|
@ -689,6 +689,8 @@ self.kiri.lang['en-us'] = {
|
||||||
cs_offs_l: ["use width, depth, height","as offsets from max","part size on platform"],
|
cs_offs_l: ["use width, depth, height","as offsets from max","part size on platform"],
|
||||||
cs_clip_s: "clip to",
|
cs_clip_s: "clip to",
|
||||||
cs_clip_l: ["rough and outline","clip cutting paths","to defined stock"],
|
cs_clip_l: ["rough and outline","clip cutting paths","to defined stock"],
|
||||||
|
cs_ishg_s: "show grid",
|
||||||
|
cs_ishg_l: ["show platform grid in indexed mode"],
|
||||||
cs_indx_s: "indexed",
|
cs_indx_s: "indexed",
|
||||||
cs_indx_l: ["stock is mounted to a rotatary indexer"],
|
cs_indx_l: ["stock is mounted to a rotatary indexer"],
|
||||||
cs_offe_s: "enable",
|
cs_offe_s: "enable",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue