fix bottom circle generation
This commit is contained in:
parent
c13d6eaba4
commit
314891975a
1 changed files with 20 additions and 5 deletions
|
|
@ -35,7 +35,8 @@ export class OpHelical extends CamOp {
|
||||||
startAngle = forceStartAng ? startAng : 0;
|
startAngle = forceStartAng ? startAng : 0;
|
||||||
|
|
||||||
updateToolDiams(toolDiam);
|
updateToolDiams(toolDiam);
|
||||||
let faces = cylinders[widget.id];
|
// console.log({cylinders})
|
||||||
|
let faces = cylinders[widget.id] ?? [];
|
||||||
if (faces.faces) faces = faces.faces;
|
if (faces.faces) faces = faces.faces;
|
||||||
let polys = [];
|
let polys = [];
|
||||||
|
|
||||||
|
|
@ -75,9 +76,14 @@ export class OpHelical extends CamOp {
|
||||||
radAdd = toolDiam / 2;
|
radAdd = toolDiam / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log({ radius, radAdd });
|
|
||||||
radius += radAdd;
|
radius += radAdd;
|
||||||
|
|
||||||
|
if( radius <= 0 ){
|
||||||
|
//if negative radius, skip this cylinder
|
||||||
|
console.log('negative radius', radius);
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
let startPoint = center
|
let startPoint = center
|
||||||
.clone()
|
.clone()
|
||||||
.setZ(zmax)
|
.setZ(zmax)
|
||||||
|
|
@ -122,24 +128,33 @@ export class OpHelical extends CamOp {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log({down,toBottom,ofFull,ofCircle,finalAngle,finalEnd});
|
||||||
|
|
||||||
//circle down to final point
|
//circle down to final point
|
||||||
poly.addPoints(
|
poly.addPoints(
|
||||||
arcToPath(startPoint.setZ(currentZ), finalEnd, numSegs * ofFull, {
|
arcToPath(startPoint.setZ(currentZ), finalEnd, numSegs , {
|
||||||
clockwise: !clockwise,
|
clockwise: !clockwise,
|
||||||
radius,
|
radius,
|
||||||
center,
|
center,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// poly.addPoints([
|
||||||
|
// newPoint(0,0,0)
|
||||||
|
// ])
|
||||||
|
|
||||||
//do a full circle at the bottom
|
//do a full circle at the bottom
|
||||||
poly.addPoints(
|
poly.addPoints(
|
||||||
arcToPath(finalEnd, finalEnd, numSegs, {
|
arcToPath(finalEnd, finalEnd, numSegs, {
|
||||||
clockwise,
|
clockwise,
|
||||||
radius,
|
radius,
|
||||||
center,
|
center,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
poly.append(
|
||||||
|
finalEnd.clone().setZ(zBottom),
|
||||||
|
)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
currentZ = bottom;
|
currentZ = bottom;
|
||||||
|
|
@ -180,7 +195,7 @@ export class OpHelical extends CamOp {
|
||||||
|
|
||||||
let pp = getPrintPoint();
|
let pp = getPrintPoint();
|
||||||
|
|
||||||
console.log(polys)
|
// console.log(polys)
|
||||||
|
|
||||||
polys = polys.slice();
|
polys = polys.slice();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue