fix ball mill profile
This commit is contained in:
parent
9515ce5451
commit
dd315aac40
3 changed files with 12 additions and 5 deletions
1
notes.md
1
notes.md
|
|
@ -56,7 +56,6 @@
|
||||||
|
|
||||||
# CAM
|
# CAM
|
||||||
|
|
||||||
* `B` fix ball mill profile
|
|
||||||
* `B` climb vs conventional not fully consistent after refactor
|
* `B` climb vs conventional not fully consistent after refactor
|
||||||
* `B` outside cutting direction in roughing mode inverted
|
* `B` outside cutting direction in roughing mode inverted
|
||||||
* `B` clear voids has double interior pass because wrong offset shadow used
|
* `B` clear voids has double interior pass because wrong offset shadow used
|
||||||
|
|
|
||||||
|
|
@ -367,11 +367,12 @@ self.kiri.loader.push(function() {
|
||||||
}
|
}
|
||||||
tool = new CAM.Tool({ tools }, undefined, toolnum);
|
tool = new CAM.Tool({ tools }, undefined, toolnum);
|
||||||
tool.generateProfile(rez);
|
tool.generateProfile(rez);
|
||||||
const flen = tool.fluteLength() || 30;
|
const flen = tool.fluteLength() || 15;
|
||||||
|
const slen = tool.shaftLength() || 15;
|
||||||
// const frad = tool.fluteDiameter() / 2;
|
// const frad = tool.fluteDiameter() / 2;
|
||||||
const prof = tool.profile;
|
const prof = tool.profile;
|
||||||
const { size, pix } = tool.profileDim;
|
const { size, pix } = tool.profileDim;
|
||||||
const { pos, ind } = createGrid(pix, pix, {x:size, y:size, z:flen}, rez);
|
const { pos, ind } = createGrid(pix, pix, {x:size, y:size, z:flen+slen}, rez);
|
||||||
const mid = Math.floor(pix/2);
|
const mid = Math.floor(pix/2);
|
||||||
// deform mesh to fit tool profile
|
// deform mesh to fit tool profile
|
||||||
for (let i=0, il=prof.length; i < il; ) {
|
for (let i=0, il=prof.length; i < il; ) {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,10 @@
|
||||||
return this.unitScale() * this.tool.taper_tip;
|
return this.unitScale() * this.tool.taper_tip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shaftLength() {
|
||||||
|
return this.unitScale() * this.tool.shaft_len;
|
||||||
|
}
|
||||||
|
|
||||||
shaftDiameter() {
|
shaftDiameter() {
|
||||||
return this.unitScale() * this.tool.shaft_diam;
|
return this.unitScale() * this.tool.shaft_diam;
|
||||||
}
|
}
|
||||||
|
|
@ -77,7 +81,8 @@
|
||||||
profile_pix_iter = shaft_pix_int + (1 - shaft_pix_int % 2),
|
profile_pix_iter = shaft_pix_int + (1 - shaft_pix_int % 2),
|
||||||
toolCenter = (shaft_pix_int - (shaft_pix_int % 2)) / 2,
|
toolCenter = (shaft_pix_int - (shaft_pix_int % 2)) / 2,
|
||||||
toolOffset = [],
|
toolOffset = [],
|
||||||
larger_shaft = shaft_diameter - flute_diameter > 0.001;
|
larger_shaft = shaft_diameter - flute_diameter > 0.001,
|
||||||
|
rpixsq = flute_radius_pix_float * flute_radius_pix_float;
|
||||||
|
|
||||||
// for each point in tool profile, check inside radius
|
// for each point in tool profile, check inside radius
|
||||||
for (let x = 0; x < profile_pix_iter; x++) {
|
for (let x = 0; x < profile_pix_iter; x++) {
|
||||||
|
|
@ -90,7 +95,9 @@
|
||||||
// flute offset points
|
// flute offset points
|
||||||
let z_offset = 0;
|
let z_offset = 0;
|
||||||
if (ball) {
|
if (ball) {
|
||||||
z_offset = (1 - Math.cos((dist_from_center / flute_radius_pix_float) * HPI)) * -flute_radius;
|
let rd = dist_from_center * dist_from_center;
|
||||||
|
z_offset = Math.sqrt(rpixsq - rd) * resolution - flute_radius;
|
||||||
|
// z_offset = (1 - Math.cos((dist_from_center / flute_radius_pix_float) * HPI)) * -flute_radius;
|
||||||
} else if (taper && dist_from_center >= tip_radius_pix_float) {
|
} else if (taper && dist_from_center >= tip_radius_pix_float) {
|
||||||
z_offset = ((dist_from_center - tip_radius_pix_float) / tip_max_radius_offset) * -shaft_offset;
|
z_offset = ((dist_from_center - tip_radius_pix_float) / tip_max_radius_offset) * -shaft_offset;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue