Improve routing between areas for CAM area operations
This commit is contained in:
parent
5e0201d68e
commit
c07419cf61
1 changed files with 4 additions and 1 deletions
|
|
@ -471,7 +471,8 @@ class OpArea extends CamOp {
|
||||||
while (areas?.length) {
|
while (areas?.length) {
|
||||||
let min = {
|
let min = {
|
||||||
dist: Infinity,
|
dist: Infinity,
|
||||||
area: undefined
|
area: undefined,
|
||||||
|
point: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let area of areas.filter(p => !p.used)) {
|
for (let area of areas.filter(p => !p.used)) {
|
||||||
|
|
@ -486,12 +487,14 @@ class OpArea extends CamOp {
|
||||||
if (find.distance < min.dist) {
|
if (find.distance < min.dist) {
|
||||||
min.area = area;
|
min.area = area;
|
||||||
min.dist = find.distance;
|
min.dist = find.distance;
|
||||||
|
min.point = find.point
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we have a next-closest top poly, pocket that
|
// if we have a next-closest top poly, pocket that
|
||||||
if (min.area) {
|
if (min.area) {
|
||||||
min.area.used = true;
|
min.area.used = true;
|
||||||
|
printPoint = min.point;
|
||||||
pocket({
|
pocket({
|
||||||
cutdir: op.ov_conv,
|
cutdir: op.ov_conv,
|
||||||
depthFirst: process.camDepthFirst,
|
depthFirst: process.camDepthFirst,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue