some cam slicer debugging
This commit is contained in:
parent
cf4ce12679
commit
54395c17d5
2 changed files with 10 additions and 4 deletions
|
|
@ -353,7 +353,7 @@ CAM.traces = async function(settings, widget, single) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
base.polygons.flatten(data.tops,null,true).forEach(poly => {
|
base.polygons.flatten(data.tops).forEach(poly => {
|
||||||
poly.inner = null;
|
poly.inner = null;
|
||||||
poly.parent = null;
|
poly.parent = null;
|
||||||
let z = poly.getZ();
|
let z = poly.getZ();
|
||||||
|
|
@ -366,6 +366,7 @@ CAM.traces = async function(settings, widget, single) {
|
||||||
}
|
}
|
||||||
// do not add duplicates
|
// do not add duplicates
|
||||||
if (traces[i].isEquivalent(poly) && dz < 0.1) {
|
if (traces[i].isEquivalent(poly) && dz < 0.1) {
|
||||||
|
// console.log({ dup: poly });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,10 @@ class Slicer {
|
||||||
p2 = newPoint(0,0,0),
|
p2 = newPoint(0,0,0),
|
||||||
p3 = newPoint(0,0,0);
|
p3 = newPoint(0,0,0);
|
||||||
|
|
||||||
|
// for (let i = 0, il = points.length; i < il; ) {
|
||||||
|
// points[i] = points[i++].toFixed(5);
|
||||||
|
// }
|
||||||
|
|
||||||
for (let i = 0, il = points.length; i < il; ) {
|
for (let i = 0, il = points.length; i < il; ) {
|
||||||
p1.set(points[i++], points[i++], points[i++]);
|
p1.set(points[i++], points[i++], points[i++]);
|
||||||
p2.set(points[i++], points[i++], points[i++]);
|
p2.set(points[i++], points[i++], points[i++]);
|
||||||
|
|
@ -185,8 +189,8 @@ class Slicer {
|
||||||
let zmax = Math.max(p1.z, p2.z, p3.z);
|
let zmax = Math.max(p1.z, p2.z, p3.z);
|
||||||
for (let bucket of buckets) {
|
for (let bucket of buckets) {
|
||||||
const { zs, index } = bucket;
|
const { zs, index } = bucket;
|
||||||
const min = zs[0];
|
const min = Math.min(...zs);
|
||||||
const max = zs.last();
|
const max = Math.max(...zs);
|
||||||
if (zmin < min && zmax < min) {
|
if (zmin < min && zmax < min) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -199,7 +203,7 @@ class Slicer {
|
||||||
end("create buckets");
|
end("create buckets");
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log({ zs, zlen, count, step, buckets });
|
// console.log({ zs, zlen, count, step, buckets, flatoff });
|
||||||
|
|
||||||
begin("slicing");
|
begin("slicing");
|
||||||
const { minions } = kiri;
|
const { minions } = kiri;
|
||||||
|
|
@ -326,6 +330,7 @@ class Slicer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dedup) {
|
if (dedup) {
|
||||||
|
// console.log({ z, dedup: lines, points });
|
||||||
lines = sliceDedup(lines, debug);
|
lines = sliceDedup(lines, debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue