Merge branch 'master' of github.com:GridSpace/grid-apps
This commit is contained in:
commit
1bd3f7cf97
2 changed files with 13 additions and 5 deletions
|
|
@ -386,7 +386,6 @@
|
||||||
q = hsv.v * (1.0 - (hsv.s * rem)),
|
q = hsv.v * (1.0 - (hsv.s * rem)),
|
||||||
t = hsv.v * (1.0 - (hsv.s * (1.0 - rem))),
|
t = hsv.v * (1.0 - (hsv.s * (1.0 - rem))),
|
||||||
out = {};
|
out = {};
|
||||||
|
|
||||||
switch (seg) {
|
switch (seg) {
|
||||||
case 0:
|
case 0:
|
||||||
out.r = hsv.v;
|
out.r = hsv.v;
|
||||||
|
|
|
||||||
|
|
@ -1286,7 +1286,16 @@
|
||||||
moves, moving = true,
|
moves, moving = true,
|
||||||
opt = options || {},
|
opt = options || {},
|
||||||
tools = opt.tools || [],
|
tools = opt.tools || [],
|
||||||
showmoves = !opt.nomoves;
|
showmoves = !opt.nomoves,
|
||||||
|
maxspeed = 0;
|
||||||
|
// find max speed
|
||||||
|
scope.output.forEach(function(layerout) {
|
||||||
|
layerout.forEach(function(out, index) {
|
||||||
|
if (out.emit && out.speed) {
|
||||||
|
maxspeed = Math.max(maxspeed, out.speed);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
// render layered output
|
// render layered output
|
||||||
scope.lines = 0;
|
scope.lines = 0;
|
||||||
scope.output.forEach(function(layerout) {
|
scope.output.forEach(function(layerout) {
|
||||||
|
|
@ -1303,7 +1312,7 @@
|
||||||
cprint = base.newPolygon().setOpen(true).append(last);
|
cprint = base.newPolygon().setOpen(true).append(last);
|
||||||
print.push({
|
print.push({
|
||||||
poly: cprint,
|
poly: cprint,
|
||||||
speed: out.speed || 4000,
|
speed: out.speed || maxspeed || 4000,
|
||||||
tool:tools[out.tool]
|
tool:tools[out.tool]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1346,8 +1355,8 @@
|
||||||
print.forEach(segment => {
|
print.forEach(segment => {
|
||||||
let {poly, speed, tool} = segment;
|
let {poly, speed, tool} = segment;
|
||||||
let off = tool ? (tool.extNozzle || 0.4) / 2 : 0.2;
|
let off = tool ? (tool.extNozzle || 0.4) / 2 : 0.2;
|
||||||
let sint = Math.min(9000, parseInt(speed));
|
let sint = Math.min(maxspeed, parseInt(speed));
|
||||||
let rgb = scope.hsv2rgb({h:sint/9000, s:1, v:1});
|
let rgb = scope.hsv2rgb({h:sint/maxspeed, s:1, v:1});
|
||||||
let color = ((rgb.r * 0xff) << 16) |
|
let color = ((rgb.r * 0xff) << 16) |
|
||||||
((rgb.g * 0xff) << 8) |
|
((rgb.g * 0xff) << 8) |
|
||||||
((rgb.b * 0xff) << 0);
|
((rgb.b * 0xff) << 0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue