add ease-in ease-out to thread profile

This commit is contained in:
Stewart Allen 2024-08-24 23:48:55 -04:00
commit 8c52f743ac
2 changed files with 16 additions and 9 deletions

View file

@ -1081,13 +1081,13 @@ const tool = {
},
invert() {
for (let m of selection.models()) {
for (let m of selection.models(false)) {
m.invert(api.mode.get());
}
},
triangulate() {
for (let m of selection.models()) {
for (let m of selection.models(false)) {
m.triangulateSelections();
}
},

View file

@ -830,24 +830,31 @@ mesh.tool = class MeshTool {
let z2step = zstep / steps;
let points = []
let iter = 0;
let iter_max = turns * steps;
let mute_min = Math.round(steps * 1.25);
let iter_max = turns * steps + steps;
let mute_min = Math.round(steps * 2.5);
let mute_max = iter_max - mute_min;
for (let turn=0; turn<turns; turn++) {
for (let step=0; step<steps; step++) {
iter++;
let itern = iter + steps;
let rm = radius - depth;
let rx = radius;
// iter < mute_min ? rm + (iter / mute_min) * depth :
// iter > mute_max ? rm + ((iter_max - iter) / mute_min) * depth :
// radius;
let rx = true &&
iter < mute_min ? rm + (iter / mute_min) * depth :
iter > mute_max ? rm + ((iter_max - iter) / mute_min) * depth :
radius;
let rxt = true &&
itern < mute_min ? rm + (itern / mute_min) * depth :
itern > mute_max ? rm + ((iter_max - itern) / mute_min) * depth :
radius;
let angle0 = rstep * step - Math.PI/2;
let z0 = (zstep * turn) + (z2step * step);
let x0 = Math.cos(angle0) * (rm);
let y0 = Math.sin(angle0) * (rm);
let x1 = Math.cos(angle0) * (rx);
let y1 = Math.sin(angle0) * (rx);
let p0 = [ x1, y1, z0 + zstep/2 ];
let x1t = Math.cos(angle0) * (rxt);
let y1t = Math.sin(angle0) * (rxt);
let p0 = [ x1t, y1t, z0 + zstep/2 ];
let p1 = [ x0, y0, z0 ];
let p2 = [ x1, y1, z0 - zstep/2 ];
let [ pp0, pp1, pp2 ] = points;