Merge branch 'master' into cam-topo-new
This commit is contained in:
commit
9502a07c62
11 changed files with 85 additions and 29 deletions
1
notes.md
1
notes.md
|
|
@ -76,6 +76,7 @@
|
||||||
* `B` need to force cut line at synthetic z bottom (midlines, etc)
|
* `B` need to force cut line at synthetic z bottom (midlines, etc)
|
||||||
* `B` contour does not honor clip to stock
|
* `B` contour does not honor clip to stock
|
||||||
|
|
||||||
|
* `F` get gcode coordinates off a part with point/click or hover?
|
||||||
* `F` include tools in default devices (Carvera)
|
* `F` include tools in default devices (Carvera)
|
||||||
* `F` add `match faces` option in `outline` operation
|
* `F` add `match faces` option in `outline` operation
|
||||||
* `F` add {progress} substitution and maybe {time-remaining} if can be calc'd
|
* `F` add {progress} substitution and maybe {time-remaining} if can be calc'd
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "grid-apps",
|
"name": "grid-apps",
|
||||||
"version": "3.8.6D",
|
"version": "3.8.8D",
|
||||||
"description": "grid.space 3d slice & modeling tools",
|
"description": "grid.space 3d slice & modeling tools",
|
||||||
"author": "Stewart Allen <sa@grid.space>",
|
"author": "Stewart Allen <sa@grid.space>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ Full docs @ https://docs.grid.space/projects/kiri-moto
|
||||||
* add CAM origin offset optional parameters
|
* add CAM origin offset optional parameters
|
||||||
* remove auto-decimation on object import
|
* remove auto-decimation on object import
|
||||||
* fix FDM raft line fill strategy
|
* fix FDM raft line fill strategy
|
||||||
|
* slicing memory reduction from team lychee
|
||||||
|
* option to control first CAM output point order
|
||||||
- refactor object/group storage model in Mesh:Tool
|
- refactor object/group storage model in Mesh:Tool
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1285,6 +1285,18 @@ class Polygon {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
freeParentRefs() {
|
||||||
|
if (this.inner && this.inner.length > 0) {
|
||||||
|
for (let inner of this.inner) {
|
||||||
|
inner.freeParentRefs();
|
||||||
|
delete inner.parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let p of this.points) {
|
||||||
|
delete p.poly;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newUndeleted() {
|
newUndeleted() {
|
||||||
let poly = newPolygon();
|
let poly = newPolygon();
|
||||||
this.forEachPoint(p => {
|
this.forEachPoint(p => {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ async function slice(points, options = {}) {
|
||||||
zScale, // bucket span in z units
|
zScale, // bucket span in z units
|
||||||
zSum = 0.0, // sanity check that points enclose non-zere volume
|
zSum = 0.0, // sanity check that points enclose non-zere volume
|
||||||
buckets = [], // banded/grouped faces to speed up slice/search
|
buckets = [], // banded/grouped faces to speed up slice/search
|
||||||
bucketMap = {},
|
|
||||||
overlapMax = options.overlap || 0.75,
|
overlapMax = options.overlap || 0.75,
|
||||||
bucketMax = options.bucketMax || 100,
|
bucketMax = options.bucketMax || 100,
|
||||||
onupdate = options.onupdate || function() {},
|
onupdate = options.onupdate || function() {},
|
||||||
|
|
@ -162,6 +161,11 @@ async function slice(points, options = {}) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create empty buckets
|
||||||
|
for (i = 0; i < bucketCount; i++) {
|
||||||
|
buckets.push({ points: [], slices: [] });
|
||||||
|
}
|
||||||
|
|
||||||
if (bucketCount > 1) {
|
if (bucketCount > 1) {
|
||||||
let failAt = (points.length * overlapMax) | 0, bucket;
|
let failAt = (points.length * overlapMax) | 0, bucket;
|
||||||
// copy triples into all matching z-buckets
|
// copy triples into all matching z-buckets
|
||||||
|
|
@ -175,12 +179,7 @@ async function slice(points, options = {}) {
|
||||||
bM = Math.min(Math.ceil(zM * zScale), bucketCount);
|
bM = Math.min(Math.ceil(zM * zScale), bucketCount);
|
||||||
// add point to all buckets in range
|
// add point to all buckets in range
|
||||||
for (j = bm; j < bM; j++) {
|
for (j = bm; j < bM; j++) {
|
||||||
let map = bucketMap[j];
|
bucket = buckets[j].points;
|
||||||
if (!map) {
|
|
||||||
map = bucketMap[j] = { points: [], slices: [] };
|
|
||||||
buckets.push(map);
|
|
||||||
}
|
|
||||||
bucket = map.points;
|
|
||||||
bucket.push(p1);
|
bucket.push(p1);
|
||||||
bucket.push(p2);
|
bucket.push(p2);
|
||||||
bucket.push(p3);
|
bucket.push(p3);
|
||||||
|
|
@ -197,7 +196,6 @@ async function slice(points, options = {}) {
|
||||||
// fallback if we can't partition point space
|
// fallback if we can't partition point space
|
||||||
if (bucketCount === 1) {
|
if (bucketCount === 1) {
|
||||||
buckets = [{ points, slices: [] }];
|
buckets = [{ points, slices: [] }];
|
||||||
bucketMap[0] = buckets[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create buckets data structure
|
// create buckets data structure
|
||||||
|
|
@ -206,7 +204,11 @@ async function slice(points, options = {}) {
|
||||||
index = bucketCount <= 1 ? 0 :
|
index = bucketCount <= 1 ? 0 :
|
||||||
Math.min(Math.floor(z * zScale), bucketCount - 1),
|
Math.min(Math.floor(z * zScale), bucketCount - 1),
|
||||||
bucket = buckets[index];
|
bucket = buckets[index];
|
||||||
if (bucket) bucket.slices.push(z); else console.log({skip: index});
|
if (bucket) {
|
||||||
|
bucket.slices.push(z);
|
||||||
|
} else {
|
||||||
|
console.log({ missing_bucket: z, index });
|
||||||
|
}
|
||||||
onupdate((i / zIndexes.length) * 0.1);
|
onupdate((i / zIndexes.length) * 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -402,6 +404,23 @@ async function sliceZ(z, points, options = {}) {
|
||||||
if (fn) fn(rval, options);
|
if (fn) fn(rval, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// free objects to be re-claimed and reduce memory pressure
|
||||||
|
if (true) {
|
||||||
|
delete rval.groups
|
||||||
|
delete rval.lines
|
||||||
|
delete rval.clip.m_AllPolys
|
||||||
|
|
||||||
|
for (let top of rval.tops) {
|
||||||
|
top.poly.freeParentRefs();
|
||||||
|
top.simple.freeParentRefs();
|
||||||
|
for (let shell of top.shells) shell.freeParentRefs();
|
||||||
|
for (let fillo of top.fill_off) fillo.freeParentRefs();
|
||||||
|
for (let last of top.last) last.freeParentRefs();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let clip of rval.clip) clip.freeParentRefs();
|
||||||
|
}
|
||||||
|
|
||||||
if (each) each(rval);
|
if (each) each(rval);
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,22 @@ CAM.export = function(print, online) {
|
||||||
if (points === 0) {
|
if (points === 0) {
|
||||||
pos.x = pos.y = pos.z = 0;
|
pos.x = pos.y = pos.z = 0;
|
||||||
points++;
|
points++;
|
||||||
|
if (spro.camFirstZMax) {
|
||||||
|
moveTo({
|
||||||
|
// speed: Infinity,
|
||||||
|
tool: out.tool,
|
||||||
|
point: { x: pos.x, y: pos.y, z: newpos.z, a: newpos.a }
|
||||||
|
}, {
|
||||||
|
dx: 0, dy: 0, dz: 1, time: 0
|
||||||
|
});
|
||||||
|
moveTo({
|
||||||
|
// speed: Infinity,
|
||||||
|
tool: out.tool,
|
||||||
|
point: { x: newpos.x, y: newpos.y, z: newpos.z, a: pos.a }
|
||||||
|
}, {
|
||||||
|
dx: 1, dy: 1, dz: 0, time: 0
|
||||||
|
});
|
||||||
|
} else if (newpos.z <= pos.z) {
|
||||||
moveTo({
|
moveTo({
|
||||||
// speed: Infinity,
|
// speed: Infinity,
|
||||||
tool: out.tool,
|
tool: out.tool,
|
||||||
|
|
@ -225,6 +241,7 @@ CAM.export = function(print, online) {
|
||||||
}, {
|
}, {
|
||||||
dx: 0, dy: 0, dz: 1, time: 0
|
dx: 0, dy: 0, dz: 1, time: 0
|
||||||
});
|
});
|
||||||
|
}
|
||||||
points--;
|
points--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -581,6 +581,7 @@ const conf = exports({
|
||||||
camExpertFast: false,
|
camExpertFast: false,
|
||||||
camTrueShadow: false,
|
camTrueShadow: false,
|
||||||
camForceZMax: false,
|
camForceZMax: false,
|
||||||
|
camFirstZMax: false,
|
||||||
ops: [], // current ops
|
ops: [], // current ops
|
||||||
op2: [] // flip ops
|
op2: [] // flip ops
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1974,6 +1974,8 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
camConventional: uc.newBoolean(LANG.ou_conv_s, onBooleanClick, {title:LANG.ou_conv_l, modes:CAM}),
|
camConventional: uc.newBoolean(LANG.ou_conv_s, onBooleanClick, {title:LANG.ou_conv_l, modes:CAM}),
|
||||||
camEaseDown: uc.newBoolean(LANG.cr_ease_s, onBooleanClick, {title:LANG.cr_ease_l, modes:CAM}),
|
camEaseDown: uc.newBoolean(LANG.cr_ease_s, onBooleanClick, {title:LANG.cr_ease_l, modes:CAM}),
|
||||||
camDepthFirst: uc.newBoolean(LANG.ou_depf_s, onBooleanClick, {title:LANG.ou_depf_l, modes:CAM}),
|
camDepthFirst: uc.newBoolean(LANG.ou_depf_s, onBooleanClick, {title:LANG.ou_depf_l, modes:CAM}),
|
||||||
|
fdmSep: uc.newBlank({class:"pop-sep", modes:FDM_CAM}),
|
||||||
|
camFirstZMax: uc.newBoolean(LANG.ou_z1st_s, onBooleanClick, {title:LANG.ou_z1st_l, modes:CAM}),
|
||||||
camForceZMax: uc.newBoolean(LANG.ou_forz_s, onBooleanClick, {title:LANG.ou_forz_l, modes:CAM}),
|
camForceZMax: uc.newBoolean(LANG.ou_forz_s, onBooleanClick, {title:LANG.ou_forz_l, modes:CAM}),
|
||||||
outputOriginBounds: uc.newBoolean(LANG.or_bnds_s, onBooleanClick, {title:LANG.or_bnds_l, modes:LASER}),
|
outputOriginBounds: uc.newBoolean(LANG.or_bnds_s, onBooleanClick, {title:LANG.or_bnds_l, modes:LASER}),
|
||||||
outputOriginCenter: uc.newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, modes:LASER}),
|
outputOriginCenter: uc.newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, modes:LASER}),
|
||||||
|
|
@ -1982,9 +1984,9 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
camOriginTop: uc.newBoolean(LANG.or_topp_s, onBooleanClick, {title:LANG.or_topp_l, modes:CAM}),
|
camOriginTop: uc.newBoolean(LANG.or_topp_s, onBooleanClick, {title:LANG.or_topp_l, modes:CAM}),
|
||||||
camOriginCenter: uc.newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, modes:CAM}),
|
camOriginCenter: uc.newBoolean(LANG.or_cntr_s, onBooleanClick, {title:LANG.or_cntr_l, modes:CAM}),
|
||||||
camSep: uc.newBlank({class:"pop-sep", modes:CAM}),
|
camSep: uc.newBlank({class:"pop-sep", modes:CAM}),
|
||||||
camOriginOffX: uc.newInput(LANG.co_offx_s, {title:LANG.co_offx_l, convert:uc.toInt, modes:CAM}),
|
camOriginOffX: uc.newInput(LANG.co_offx_s, {title:LANG.co_offx_l, convert:uc.toFloat, modes:CAM}),
|
||||||
camOriginOffY: uc.newInput(LANG.co_offy_s, {title:LANG.co_offy_l, convert:uc.toInt, modes:CAM}),
|
camOriginOffY: uc.newInput(LANG.co_offy_s, {title:LANG.co_offy_l, convert:uc.toFloat, modes:CAM}),
|
||||||
camOriginOffZ: uc.newInput(LANG.co_offz_s, {title:LANG.co_offz_l, convert:uc.toInt, modes:CAM}),
|
camOriginOffZ: uc.newInput(LANG.co_offz_s, {title:LANG.co_offz_l, convert:uc.toFloat, modes:CAM}),
|
||||||
|
|
||||||
camExpert: uc.newGroup(LANG.op_xprt_s, null, {group: "cam_expert", modes:CAM, marker: false}),
|
camExpert: uc.newGroup(LANG.op_xprt_s, null, {group: "cam_expert", modes:CAM, marker: false}),
|
||||||
camExpertFast: uc.newBoolean(LANG.cx_fast_s, onBooleanClick, {title:LANG.cx_fast_l, modes:CAM, show: () => !ui.camTrueShadow.checked }),
|
camExpertFast: uc.newBoolean(LANG.cx_fast_s, onBooleanClick, {title:LANG.cx_fast_l, modes:CAM, show: () => !ui.camTrueShadow.checked }),
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ gapp.main("main.kiri", [], (root) => {
|
||||||
const modfns = root.kirimod = ( root.kirimod || [] );
|
const modfns = root.kirimod = ( root.kirimod || [] );
|
||||||
|
|
||||||
const kiri = root.kiri = {
|
const kiri = root.kiri = {
|
||||||
beta: 3806,
|
beta: 3808,
|
||||||
driver: {}, // driver modules
|
driver: {}, // driver modules
|
||||||
load(fn) {
|
load(fn) {
|
||||||
modfns.push(fn);
|
modfns.push(fn);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
let terms = {
|
let terms = {
|
||||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||||
LICENSE: "See the license.md file included with the source distribution",
|
LICENSE: "See the license.md file included with the source distribution",
|
||||||
VERSION: (is_self ? self : this).debug_version || "3.8.D6"
|
VERSION: (is_self ? self : this).debug_version || "3.8.D8"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof(module) === 'object') {
|
if (typeof(module) === 'object') {
|
||||||
|
|
|
||||||
|
|
@ -678,6 +678,8 @@ self.kiri.lang['en-us'] = {
|
||||||
ou_depf_l: ["optimize pocket cuts","with depth priority"],
|
ou_depf_l: ["optimize pocket cuts","with depth priority"],
|
||||||
ou_forz_s: "force z max",
|
ou_forz_s: "force z max",
|
||||||
ou_forz_l: "all moves between pockets will go to z max (above stock). this is usually required if you are not performing a roughing operation before pocketing operations.",
|
ou_forz_l: "all moves between pockets will go to z max (above stock). this is usually required if you are not performing a roughing operation before pocketing operations.",
|
||||||
|
ou_z1st_s: "first z max",
|
||||||
|
ou_z1st_l: "first move in the job will be to Z max (travel distance above stock)",
|
||||||
|
|
||||||
// CAM STOCK
|
// CAM STOCK
|
||||||
cs_menu: "stock",
|
cs_menu: "stock",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue