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