add feature macros

This commit is contained in:
Stewart Allen 2022-05-08 13:41:12 -04:00
commit 7f8a9f6f75
6 changed files with 45 additions and 26 deletions

View file

@ -2,34 +2,40 @@
Full docs @ https://docs.grid.space/projects/kiri-moto Full docs @ https://docs.grid.space/projects/kiri-moto
# Release 3.4 (in progress)
## `C` complete, `I` in progress, `-` todo # Release 3.5 (future)
## Kiri:moto ## Kiri:moto
* `C` added batch processing to object adds/removes to speedup complex workspace restore * ~ refactor vertex replacement and widget update matrix tracking
* `C` substitute some prusa slicer [variables] with KM {variables} on import * ~ refactor cnc to use core slicer engine
* `C` fix CAM output order for tool changes an spindle speed updates
* `C` add CAM pocket operation using surface selection
* `C` fix dogbones on outlines cut by tabs # Release 3.4 (2022-05-14 est)
* `C` skip pockets that resolve to null
* `C` 10x speedup for true shadow generation ## Kiri:moto
* `-` refactor cnc to use new core slicer engine
* `-` improve vertex replacement and widget update matrix tracking * added batch processing to object adds/removes to speedup complex workspace restore
* substitute some prusa slicer [variables] with KM {variables} on import
* fix CAM output order for tool changes an spindle speed updates
* add CAM pocket operation using surface selection
* fix dog-bones on outlines cut by tabs
* skip pockets that resolve to null
* fix cnc contour path collision
* 10x speedup for true shadow generation
## Mesh:Tool (1.2.0) ## Mesh:Tool (1.2.0)
* `C` auto-fog in wireframe view to aid close mesh inspections * auto-fog in wireframe view to aid close mesh inspections
* `C` significant speed-up for large surface selections * significant speed-up for large surface selections
* `C` add boolean operations for subtract and intersect * add boolean operations for subtract and intersect
* `C` multi-body identification and isolation * multi-body identification and isolation
* `C` quick add primitives: cube, cylinder * quick add primitives: cube, cylinder
* `C` control wireframe transparency * control wireframe transparency
* `-` parameterize svg and image import * ~ parameterize png/jpg image import
* `-` undo / redo for some operations * ~ undo / redo for some operations
* `-` show camera focal point * ~ show camera focal point
* `-` better Z split snapping and split at defined Z index * ~ better Z split snapping and split at defined Z index
# Release 3.3 (2022-04-01) # Release 3.3 (2022-04-01)

View file

@ -19,7 +19,7 @@ FDM.export = function(print, online, ondone, ondebug) {
const { danger, exportThumb } = device; const { danger, exportThumb } = device;
const { bedWidth, bedDepth, bedRound, bedBelt, maxHeight } = device; const { bedWidth, bedDepth, bedRound, bedBelt, maxHeight } = device;
const { extruders, fwRetract } = device; const { extruders, fwRetract } = device;
const { gcodeFan, gcodeLayer, gcodeTrack, gcodePause } = device; const { gcodeFan, gcodeLayer, gcodeTrack, gcodePause, gcodeFeature } = device;
let layers = print.output, let layers = print.output,
extras = device.extras || {}, extras = device.extras || {},
@ -622,8 +622,12 @@ FDM.export = function(print, online, ondone, ondebug) {
// emit comment on output type chage // emit comment on output type chage
if (last && out.type !== last.type) { if (last && out.type !== last.type) {
lastType = subst.feature = out.type;
if (gcodeFeature && gcodeFeature.length) {
appendAllSub(gcodeFeature);
} else {
append(`; feature ${out.type}`); append(`; feature ${out.type}`);
lastType = out.type; }
} }
// look for extruder change, run scripts, recalc emit factor // look for extruder change, run scripts, recalc emit factor

View file

@ -125,6 +125,7 @@ function device_from_code(code,mode) {
extrudeAbs: valueOf(set.extrude_abs, false), extrudeAbs: valueOf(set.extrude_abs, false),
spindleMax: valueOf(set.spindle_max, 0), spindleMax: valueOf(set.spindle_max, 0),
gcodeFan: valueOf(cmd.fan_power || code.fan_power, []), gcodeFan: valueOf(cmd.fan_power || code.fan_power, []),
gcodeFeature: valueOf(cmd.feature || code.feature, []),
gcodeTrack: valueOf(cmd.progress || code.progress, []), gcodeTrack: valueOf(cmd.progress || code.progress, []),
gcodeLayer: valueOf(cmd.layer || code.layer, []), gcodeLayer: valueOf(cmd.layer || code.layer, []),
gcodePre: valueOf(code.pre, []), gcodePre: valueOf(code.pre, []),
@ -276,6 +277,7 @@ const conf = exports({
gcodePost: [], gcodePost: [],
gcodeProc: "", gcodeProc: "",
gcodeFan: [], gcodeFan: [],
gcodeFeature: [],
gcodeTrack: [], gcodeTrack: [],
gcodeLayer: [], gcodeLayer: [],
gcodeFExt: "", gcodeFExt: "",

View file

@ -749,6 +749,7 @@ gapp.register("kiri.init", [], (root, exports) => {
api.event.emit('device.set', devicename); api.event.emit('device.set', devicename);
let mode = api.mode.get(), let mode = api.mode.get(),
lmode = mode.toLowerCase(),
current = settings(), current = settings(),
local = isLocalDevice(devicename), local = isLocalDevice(devicename),
dev = current.device = conf.device_from_code(code,mode), dev = current.device = conf.device_from_code(code,mode),
@ -757,6 +758,9 @@ gapp.register("kiri.init", [], (root, exports) => {
predev = current.filter[mode], // previous device selection predev = current.filter[mode], // previous device selection
chgdev = predev !== devicename; // device is changing chgdev = predev !== devicename; // device is changing
// fill missing device fields
conf.fill_cull_once(dev, conf.defaults[lmode].d);
// first time device use, add any print profiles and set to default if present // first time device use, add any print profiles and set to default if present
if (code.profiles) { if (code.profiles) {
for (let profile of code.profiles) { for (let profile of code.profiles) {
@ -829,6 +833,7 @@ gapp.register("kiri.init", [], (root, exports) => {
ui.filamentSource, ui.filamentSource,
ui.deviceZMax, ui.deviceZMax,
ui.gcodeFan, ui.gcodeFan,
ui.gcodeFeature,
ui.gcodeTrack, ui.gcodeTrack,
ui.gcodeLayer, ui.gcodeLayer,
ui.extFilament, ui.extFilament,
@ -1720,6 +1725,7 @@ gapp.register("kiri.init", [], (root, exports) => {
(ui.gcodeLayer = uc.newGCode(LANG.dv_layr_s, {title:LANG.dv_layr_l, modes:FDM, area:gcode})).button, (ui.gcodeLayer = uc.newGCode(LANG.dv_layr_s, {title:LANG.dv_layr_l, modes:FDM, area:gcode})).button,
(ui.gcodeTrack = uc.newGCode(LANG.dv_prog_s, {title:LANG.dv_prog_l, modes:FDM, area:gcode})).button, (ui.gcodeTrack = uc.newGCode(LANG.dv_prog_s, {title:LANG.dv_prog_l, modes:FDM, area:gcode})).button,
(ui.gcodeFan = uc.newGCode(LANG.dv_fanp_s, {title:LANG.dv_fanp_l, modes:FDM, area:gcode})).button, (ui.gcodeFan = uc.newGCode(LANG.dv_fanp_s, {title:LANG.dv_fanp_l, modes:FDM, area:gcode})).button,
(ui.gcodeFeature = uc.newGCode(LANG.dv_feat_s, {title:LANG.dv_feat_l, modes:FDM, area:gcode})).button,
(ui.gcodeLaserOn = uc.newGCode(LANG.dv_lzon_s, {title:LANG.dv_lzon_l, modes:LASER, area:gcode})).button, (ui.gcodeLaserOn = uc.newGCode(LANG.dv_lzon_s, {title:LANG.dv_lzon_l, modes:LASER, area:gcode})).button,
(ui.gcodeLaserOff = uc.newGCode(LANG.dv_lzof_s, {title:LANG.dv_lzof_l, modes:LASER, area:gcode})).button, (ui.gcodeLaserOff = uc.newGCode(LANG.dv_lzof_s, {title:LANG.dv_lzof_l, modes:LASER, area:gcode})).button,
(ui.gcodeChange = uc.newGCode(LANG.dv_tool_s, {title:LANG.dv_tool_l, modes:CAM, area:gcode})).button, (ui.gcodeChange = uc.newGCode(LANG.dv_tool_s, {title:LANG.dv_tool_l, modes:CAM, area:gcode})).button,

View file

@ -321,7 +321,6 @@ class Widget {
mesh.renderOrder = 1; mesh.renderOrder = 1;
geometry.computeVertexNormals(); geometry.computeVertexNormals();
geometry.addGroup(0, Infinity, 0); geometry.addGroup(0, Infinity, 0);
// mesh.material[0].side = THREE.DoubleSide;
mesh.castShadow = true; mesh.castShadow = true;
mesh.receiveShadow = true; mesh.receiveShadow = true;
mesh.widget = this; mesh.widget = this;

View file

@ -122,8 +122,10 @@ self.kiri.lang['en-us'] = {
dv_fsrc_l: ["how filament is fed\ninto the extruder"], dv_fsrc_l: ["how filament is fed\ninto the extruder"],
dv_retr_s: "firmware retract", dv_retr_s: "firmware retract",
dv_retr_l: ["device fimware supports G10/G11"], dv_retr_l: ["device fimware supports G10/G11"],
dv_fanp_s: "fan power", dv_fanp_s: "cooling",
dv_fanp_l: "set cooling fan power", dv_fanp_l: "set cooling fan power",
dv_feat_s: "feature",
dv_feat_l: "inject code for specified features",
dv_prog_s: "progress", dv_prog_s: "progress",
dv_prog_l: "output on each % progress", dv_prog_l: "output on each % progress",
dv_layr_s: "layer", dv_layr_s: "layer",