arc notes. rm dead code

This commit is contained in:
Stewart Allen 2026-01-01 22:43:35 -05:00
commit 76fabfa7f5
3 changed files with 9 additions and 12 deletions

View file

@ -212,12 +212,13 @@ class Print {
let { arc } = point;
if (arc) {
arcInfo = arc;
// non-emit arc points get -1 for rendering
scope.addOutput(output, point, shellMult, moveSpeed, tool);
// arc center is relative to first point
arcInfo.center.move({ x: -point.x, y: -point.y, z: 0 });
last = point;
continue;
} else if (arcInfo) {
// accumulate and pass to last point to calc FDM E value
arcDist += last.distTo2D(point);
if (--arcInfo.skip === 0) {
arcInfo.distance = arcDist;

View file

@ -866,6 +866,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
let { arc } = point;
skip = arc.skip;
type = arc.clockwise ? 2 : 3;
// arc center is relative to first point
center = arc.center.clone().move({ x: -point.x, y: -point.y });
xfactors.push(xfactors.shift());
}

View file

@ -120,6 +120,7 @@ export function fdm_export(print, online, ondone, ondebug) {
// lenghts of each filament (by nozzle) consumed
segments = [];
// build tool use list for this job
let tools_used = Object.keys(tools);
for (let tool of tools_used) {
subst[`tool_used_${tool}`] = true;
@ -694,6 +695,7 @@ export function fdm_export(print, online, ondone, ondebug) {
continue;
}
// distance to last point for accumulation and emit calc
dist = lastp ? lastp.distTo2D(point) : 0;
// re-engage post-retraction before new extrusion
@ -705,6 +707,8 @@ export function fdm_export(print, online, ondone, ondebug) {
if (isBelt) {
setTempFanSpeed(out.fan);
}
// run fan speed macro when value changes
if (fanSpeed !== lastFanSpeed) {
appendAllSub(gcodeFan);
lastFanSpeed = fanSpeed;
@ -741,10 +745,8 @@ export function fdm_export(print, online, ondone, ondebug) {
if (dist && speedMMM) {
time += (dist / speedMMM) * 60 * timeFactor;
}
// if (isNaN(time)) {
// console.log({ layer, path, dist, speedMMM, timeFactor });
// throw "NaN";
// }
// accumulate distance traveled and update macro var
distance += dist;
subst.progress = progress = Math.round((distance / totaldistance) * 100);
@ -773,13 +775,6 @@ export function fdm_export(print, online, ondone, ondebug) {
subst.remain_time = Math.ceil(print.total_time / 60);
}
function emitQrec(rec) {
let {e, x, y, dist, emitPerMM, speedMMM} = rec;
emitMM = extrudeMM(dist, emitPerMM, e);
moveTo({x:x, y:y, e:emitMM}, speedMMM);
emitted += emitMM;
}
if (inloops) {
append(`M808`);
}