update api for modules, add n-series pause, update notes

This commit is contained in:
Stewart Allen 2018-03-05 10:38:21 -05:00
commit 8d03dd53de
6 changed files with 26 additions and 16 deletions

View file

@ -201,12 +201,7 @@ var gs_kiri_slicer = exports;
}); });
} else { } else {
// FDM is the simplest case. Just offset and slice at // FDM is the simplest case. Just offset and slice at
// predicable offsets. First offset is half a slice height. // predicable offsets.
// this was once configurable, but that turned out not to be
// terribly useful. In future, first layer height may be
// adjusted separately, but that would also require other
// settings changes (flow rate, etc).
// ... only this one special case for first layer :)
if (options.firstHeight) { if (options.firstHeight) {
zIndexes.push(options.firstHeight / 2); zIndexes.push(options.firstHeight / 2);
zMin = options.firstHeight; zMin = options.firstHeight;

View file

@ -551,12 +551,15 @@ self.kiri.license = exports.LICENSE;
******************************************************************* */ ******************************************************************* */
function sendOnEvent(name, data) { function sendOnEvent(name, data) {
if (name && onEvent[name]) onEvent[name](data); if (name && onEvent[name]) onEvent[name].forEach(function(fn) {
fn(data);
});
} }
function addOnEvent(name, handler) { function addOnEvent(name, handler) {
if (name && typeof(name) === 'string' && typeof(handler) === 'function') { if (name && typeof(name) === 'string' && typeof(handler) === 'function') {
onEvent[name] = handler; onEvent[name] = onEvent[name] || [];
onEvent[name].push(handler);
} }
} }

View file

@ -930,8 +930,8 @@ function initModule(file, dir) {
api: api, api: api,
const: { const: {
script: script, script: script,
moddir: dir,
rootdir: currentDir, rootdir: currentDir,
moddir: dir,
args: args args: args
}, },
util: { util: {
@ -948,6 +948,11 @@ function initModule(file, dir) {
api: db, api: db,
level: level level: level
}, },
inject: {
kiri: file => {
script.kiri.splice(0, 0, dir + "/" + file);
}
},
path: { path: {
any: arg => { modPaths.push(arg) }, any: arg => { modPaths.push(arg) },
pre: arg => { modPaths.push(prepath(arg)) }, pre: arg => { modPaths.push(prepath(arg)) },

View file

@ -59,9 +59,9 @@
# FDM todo # FDM todo
* adaptive layer heights
* preview doesn't show proper z offsets * preview doesn't show proper z offsets
* trim support offset from layer below * trim support offset from layer below
* optional startpoint based on fill origin when seek > retract distance
* feather sharp tips by reducing extrusion in area of overlap * feather sharp tips by reducing extrusion in area of overlap
* add option to reduce poly speed to match shortest/slowest segment * add option to reduce poly speed to match shortest/slowest segment
(helps when no k-factor support in firmware) (helps when no k-factor support in firmware)
@ -69,13 +69,11 @@
* fix thin fill (outside). compute before sparse as separate logic. * fix thin fill (outside). compute before sparse as separate logic.
* fix wrong first point in general (all modes) * fix wrong first point in general (all modes)
* add lay-flat auto-rotation or from selected face * add lay-flat auto-rotation or from selected face
* add pause at specified layers
* add manual supports * add manual supports
* determine start point from gcode preamble * determine start point from gcode preamble
* check for support / brim intersections on first layer * check for support / brim intersections on first layer
* fan / layer control * update forum * fan / layer control * update forum
* dual extruder support * dual extruder support
* add min layer time (slowdown or cool-off wait)
* option to support interior bridges when 0% infill * option to support interior bridges when 0% infill
* fix multiple part layout export offset (resend position @ print time) * fix multiple part layout export offset (resend position @ print time)
* add gyroid infill * https://en.wikipedia.org/wiki/Gyroid * add gyroid infill * https://en.wikipedia.org/wiki/Gyroid
@ -106,14 +104,11 @@
# Sample FDM Pause/Unpause ``` # Sample FDM Pause/Unpause ```
; --- pause ---
G91 ; Relative Positioning G91 ; Relative Positioning
G0 Z20 ; Move Bed down 20mm G0 Z20 ; Move Bed down 20mm
G90 ; Absolute positioning G90 ; Absolute positioning
G0 X10 Y10 ; Move to 10,10 G0 X10 Y10 ; Move to 10,10
M2000 ; Raise3D N2 Pause command M2000 ; Raise3D N2 Pause command
; --- un-pause ---
G91 ; Relative Positioning G91 ; Relative Positioning
G0 Z-20 ; Move Bed up 20mm G0 Z-20 ; Move Bed up 20mm
G90 ; Absolute positioning G90 ; Absolute positioning

View file

@ -32,7 +32,7 @@
"express-useragent": "^1.0.12", "express-useragent": "^1.0.12",
"leveldown": "^1.9.0", "leveldown": "^1.9.0",
"levelup": "^1.3.9", "levelup": "^1.3.9",
"moment": "^2.20.1", "moment": "^2.21.0",
"n3d-threejs": "^72.0.0", "n3d-threejs": "^72.0.0",
"pixi.js": "^4.7.0", "pixi.js": "^4.7.0",
"request": "^2.83.0", "request": "^2.83.0",

View file

@ -36,6 +36,18 @@
";Material#1 Used: {material}", ";Material#1 Used: {material}",
";Material#2 Used: 0.0" ";Material#2 Used: 0.0"
], ],
"pause":[
"; --- pause begin ---",
"G91 ; Relative Positioning",
"G0 Z20 ; Move Bed down 20mm",
"G90 ; Absolute positioning",
"G0 X10 Y10 ; Move to 10,10",
"M2000 ; Pause command",
"G91 ; Relative Positioning",
"G0 Z-20 ; Move Bed up 20mm",
"G90 ; Absolute positioning",
"; --- pause end ---"
],
"cmd":{ "cmd":{
"fan_power": "M106 S{fan_speed}", "fan_power": "M106 S{fan_speed}",
"layer": [ "layer": [