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;
|
||||
|
||||
updateToolDiams(toolDiam);
|
||||
let faces = cylinders[widget.id];
|
||||
// console.log({cylinders})
|
||||
let faces = cylinders[widget.id] ?? [];
|
||||
if (faces.faces) faces = faces.faces;
|
||||
let polys = [];
|
||||
|
||||
|
|
@ -75,9 +76,14 @@ export class OpHelical extends CamOp {
|
|||
radAdd = toolDiam / 2;
|
||||
}
|
||||
}
|
||||
console.log({ radius, radAdd });
|
||||
radius += radAdd;
|
||||
|
||||
if( radius <= 0 ){
|
||||
//if negative radius, skip this cylinder
|
||||
console.log('negative radius', radius);
|
||||
continue
|
||||
}
|
||||
|
||||
let startPoint = center
|
||||
.clone()
|
||||
.setZ(zmax)
|
||||
|
|
@ -122,24 +128,33 @@ export class OpHelical extends CamOp {
|
|||
)
|
||||
);
|
||||
|
||||
console.log({down,toBottom,ofFull,ofCircle,finalAngle,finalEnd});
|
||||
|
||||
//circle down to final point
|
||||
poly.addPoints(
|
||||
arcToPath(startPoint.setZ(currentZ), finalEnd, numSegs * ofFull, {
|
||||
arcToPath(startPoint.setZ(currentZ), finalEnd, numSegs , {
|
||||
clockwise: !clockwise,
|
||||
radius,
|
||||
center,
|
||||
})
|
||||
);
|
||||
|
||||
// poly.addPoints([
|
||||
// newPoint(0,0,0)
|
||||
// ])
|
||||
|
||||
//do a full circle at the bottom
|
||||
poly.addPoints(
|
||||
arcToPath(finalEnd, finalEnd, numSegs, {
|
||||
clockwise,
|
||||
radius,
|
||||
center,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
poly.append(
|
||||
finalEnd.clone().setZ(zBottom),
|
||||
)
|
||||
break;
|
||||
}
|
||||
currentZ = bottom;
|
||||
|
|
@ -180,7 +195,7 @@ export class OpHelical extends CamOp {
|
|||
|
||||
let pp = getPrintPoint();
|
||||
|
||||
console.log(polys)
|
||||
// console.log(polys)
|
||||
|
||||
polys = polys.slice();
|
||||
for (;;) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue