bump rev 2.6.D11. rework rotation and bounds (again)
This commit is contained in:
parent
a82c62b73a
commit
6ba89b1b8f
6 changed files with 28 additions and 34 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "grid-apps",
|
"name": "grid-apps",
|
||||||
"version": "2.6.10D",
|
"version": "2.6.11D",
|
||||||
"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",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
if (!self.kiri) {
|
if (!self.kiri) {
|
||||||
self.kiri = {
|
self.kiri = {
|
||||||
beta: 2610,
|
beta: 2611,
|
||||||
driver: {}, // driver modules
|
driver: {}, // driver modules
|
||||||
loader: [] // module loading: array of functions
|
loader: [] // module loading: array of functions
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2182,7 +2182,7 @@
|
||||||
function init_two() {
|
function init_two() {
|
||||||
API.event.emit('init.two');
|
API.event.emit('init.two');
|
||||||
|
|
||||||
API.space.set_focus();
|
// API.space.set_focus();
|
||||||
|
|
||||||
// call driver initializations, if present
|
// call driver initializations, if present
|
||||||
Object.values(KIRI.driver).forEach(driver => {
|
Object.values(KIRI.driver).forEach(driver => {
|
||||||
|
|
|
||||||
|
|
@ -85,44 +85,36 @@ KIRI.worker = {
|
||||||
return send.done({});
|
return send.done({});
|
||||||
}
|
}
|
||||||
|
|
||||||
function mins(vert) {
|
function mins(vert, last = {}) {
|
||||||
let miny = Infinity, minz = Infinity;
|
let miny = last.miny || Infinity,
|
||||||
|
maxy = last.maxy || -Infinity;
|
||||||
for (let i=0, l=vert.length; i<l; ) {
|
for (let i=0, l=vert.length; i<l; ) {
|
||||||
let x = vert[i++];
|
let x = vert[i++];
|
||||||
let y = vert[i++];
|
let y = vert[i++];
|
||||||
let z = vert[i++];
|
let z = vert[i++];
|
||||||
|
if (z < 0.01) {
|
||||||
miny = Math.min(miny, y);
|
miny = Math.min(miny, y);
|
||||||
minz = Math.min(minz, z);
|
maxy = Math.max(maxy, y);
|
||||||
}
|
}
|
||||||
return {miny, minz};
|
}
|
||||||
|
return { miny, maxy };
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let group of Object.values(wgroup)) {
|
for (let group of Object.values(wgroup)) {
|
||||||
|
let minv = {};
|
||||||
|
for (let w of group) {
|
||||||
|
minv = mins(w.vertices, minv);
|
||||||
|
}
|
||||||
|
let { miny, maxy } = minv;
|
||||||
|
|
||||||
let widget = group[0];
|
let widget = group[0];
|
||||||
let rotation = (Math.PI / 180) * 45;
|
|
||||||
|
|
||||||
// need min y for post-rotation offset in prepare
|
|
||||||
// let vert = widget.vertices;
|
|
||||||
// let miny = Infinity;
|
|
||||||
// for (let i=0, l=vert.length; i<l; ) {
|
|
||||||
// let x = vert[i++];
|
|
||||||
// let y = vert[i++];
|
|
||||||
// let z = vert[i++];
|
|
||||||
// if (z < 0.01) miny = Math.min(miny, y);
|
|
||||||
// }
|
|
||||||
|
|
||||||
let min1 = mins(widget.vertices);
|
|
||||||
let miny = min1.miny;
|
|
||||||
|
|
||||||
widget.groupBounds();
|
|
||||||
let track = widget.track;
|
let track = widget.track;
|
||||||
let xpos = track.pos.x;
|
let xpos = track.pos.x;
|
||||||
let ypos = settings.device.bedDepth / 2 + track.pos.y + miny;
|
let ypos = settings.device.bedDepth / 2 + track.pos.y + miny;
|
||||||
|
let rotation = (Math.PI / 180) * 45;
|
||||||
widget.rotate(rotation,0,0,true);
|
|
||||||
widget.groupBounds();
|
|
||||||
|
|
||||||
widget.belt = { xpos, ypos };
|
widget.belt = { xpos, ypos };
|
||||||
|
widget.rotate(rotation,0,0,true);
|
||||||
for (let others of group.slice(1)) {
|
for (let others of group.slice(1)) {
|
||||||
others.belt = widget.belt;
|
others.belt = widget.belt;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,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: "2.6.D10"
|
VERSION: "2.6.D11"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof(module) === 'object') {
|
if (typeof(module) === 'object') {
|
||||||
|
|
|
||||||
|
|
@ -291,12 +291,14 @@
|
||||||
for (let widget of widgets) {
|
for (let widget of widgets) {
|
||||||
let { rotinfo, belt } = widget;
|
let { rotinfo, belt } = widget;
|
||||||
let offset = Object.clone(widget.track.pos);
|
let offset = Object.clone(widget.track.pos);
|
||||||
// let offset = widget.mesh ? Object.clone(widget.mesh.position) : {x:0, y:0, z:0};
|
|
||||||
if (isBelt) {
|
if (isBelt) {
|
||||||
offset.x = rotinfo.xpos;
|
let o = rotinfo.ypos * beltfact;
|
||||||
offset.y = -belt.midy;
|
offset = {
|
||||||
offset.y += rotinfo.ypos * beltfact;
|
x: rotinfo.xpos,
|
||||||
offset.z = rotinfo.ypos * beltfact;
|
y: o - belt.midy,// - belt.miny,
|
||||||
|
z: o,
|
||||||
|
};
|
||||||
|
// offset = { x:0, y:0, z:0 };
|
||||||
// locate the lowest point in slices and widget overall
|
// locate the lowest point in slices and widget overall
|
||||||
let minby = Infinity;
|
let minby = Infinity;
|
||||||
for (let slice of widget.slices) {
|
for (let slice of widget.slices) {
|
||||||
|
|
@ -412,7 +414,7 @@
|
||||||
// if a declared extruder isn't used in a layer, use selected
|
// if a declared extruder isn't used in a layer, use selected
|
||||||
// extruder to fill the relevant purge blocks for later support
|
// extruder to fill the relevant purge blocks for later support
|
||||||
track.forEach(ext => {
|
track.forEach(ext => {
|
||||||
if (ext) {
|
if (ext && lastOut) {
|
||||||
printPoint = purge(ext.extruder, track, layerout, printPoint, lastOut.z, lastExt);
|
printPoint = purge(ext.extruder, track, layerout, printPoint, lastOut.z, lastExt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue