release, device utility updates

This commit is contained in:
Stewart Allen 2022-02-24 13:07:53 -05:00
commit adc38d3697
4 changed files with 38 additions and 33 deletions

View file

@ -1,4 +1,4 @@
# Grid:Apps TODOs and Notes
# Grid:Apps Future Notes
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
@ -21,6 +21,8 @@
* `F` warn if part hanging in negative Z space or off bed in general
* `F` date column and sorting in recent files list
* `C` reflow device dialog to add bottom tabbing, vertical macro list
# FDM
* `B` fix support projection/end with grouped parts
@ -129,11 +131,5 @@
* fix mirror to work with groups (just models currently)
* bounding box toggle should be global, not selection
* add analyze results dialog
* rename analyze > patch
* remove repair function?
## Links
* libtess https://www.npmjs.com/package/libtess ... earcut sometimes wrong
* https://stackoverflow.com/questions/52818307/determine-whether-one-polygon-contains-another
* remove auto-repair function

View file

@ -10,20 +10,20 @@
* `C` refactor main into supporting classes (part of a larger ui re-org)
* `C` group "main" entry points under "kiri-run"
* `C` extract and group utilities from print and other modules
* `P` refactor slicers to use single improved slice core (cnc tbd)
* `C` add thin wall pull-down & allow for newer strategies
* `C` extract preview render engine from FDM
* `C` allow loading of workspaces from url on page load
* `C` properly import profiles attached to devices
* `C` improved routing on "fast" layers & layers with multiple islands
* `P` refactor slicers to use single improved slice core (cnc tbd)
* `P` template vars: nozzles used and layers until next use (IDEX)
* `-` start/stop minions depending on whether threading enabled
* `-` workflow to edit in and bounce back / reload
* `-` workflow to edit in M:T and bounce back / replace vertices
* `-` abstract file loading (onshape import, mesh replace, etc)
* `-` tighten export dialogs (reduce size for smaller screens)
## Mesh:Tool
* `-` face selection and pref
* `-` prefs like normal length
* `-` face selection and matchinbg preferences
* `-` add prefs for normal length, maybe color picker
* `-` svg and image import conversion (share code with Kiri:Moto)

View file

@ -97,6 +97,7 @@ function device_v1_to_v2(device) {
function device_from_code(code,mode) {
// presence of internal field indicates already converted
if (code.internal >= 0) return code;
// if (self.navigator) console.log({mode, convert: code});
let cmd = code.cmd || {},
set = code.settings || {},

View file

@ -1,24 +1,32 @@
let fs = require('fs');
var clone = Object.clone = function(o) {
return JSON.parse(JSON.stringify(o));
};
var self = { kiri: { api: { clone } } };
// device legacy format converter
const arg = process.argv.slice(2);
const mode = arg.shift();
const umode = mode.toUpperCase();
const lmode = mode.toLowerCase();
const fs = require('fs');
const self = {};
eval( fs.readFileSync("src/main/gapp.js").toString() );
const gapp = self.gapp;
eval( fs.readFileSync("src/add/array.js").toString() );
eval( fs.readFileSync("src/data/local.js").toString() );
eval( fs.readFileSync("src/kiri/conf.js").toString() );
let arg = process.argv.slice(2);
let mode = arg.shift();
let umode = mode.toUpperCase();
let lmode = mode.toLowerCase();
let kiri = self.kiri;
let conf = kiri.conf;
for (let file of arg) {
let code = JSON.parse(fs.readFileSync(file).toString());
let devi = conf.device_from_code(code, umode);
conf.fill_cull_once(devi, conf.defaults[lmode].d);
delete devi.new;
delete devi.internal;
delete devi.deviceName;
// console.log({code, devi});
console.log(JSON.stringify(code,undefined,4));
}
gapp.main(undefined, undefined, root => {
let kiri = root.kiri;
let conf = kiri.conf;
for (let file of arg) {
let code = JSON.parse(fs.readFileSync(file).toString());
let devi = conf.device_from_code(code, umode);
conf.fill_cull_once(devi, conf.defaults[lmode].d);
delete devi.new;
delete devi.internal;
delete devi.deviceName;
// console.log(JSON.stringify(code, undefined, 4));
console.log(JSON.stringify([code, "-----", devi], undefined, 2));
}
});