disable arc conversion by default, add explicit checkbox to enable, add additional arc checks in preview code path

This commit is contained in:
Stewart Allen 2025-07-15 17:55:09 -04:00
commit 4d0fe0d71c
4 changed files with 10 additions and 5 deletions

View file

@ -570,7 +570,8 @@ export const conf = {
outputInvertY: false,
camExpertFast: false,
camTrueShadow: false,
camArcTolerance: 0.006,
camArcEnabled: false,
camArcTolerance: 0.15,
camArcResolution: 5,
camForceZMax: false,
camFirstZMax: false,

View file

@ -120,8 +120,9 @@ export function menu() {
camExpertFast: newBoolean(LANG.cx_fast_s, onBooleanClick, {title:LANG.cx_fast_l, show: () => !ui.camTrueShadow.checked }),
camTrueShadow: newBoolean(LANG.cx_true_s, onBooleanClick, {title:LANG.cx_true_l, show: () => !ui.camExpertFast.checked }),
separator: newBlank({ class:"set-sep", driven }),
camArcTolerance: newInput(LANG.cx_arct_s, {title:LANG.cx_arct_l, convert:toFloat, units, bound:bound(0,100)}),
camArcResolution: newInput(LANG.cx_arcr_s, {title:LANG.cx_arcr_l, convert:toFloat, bound:bound(0,180), show:() => ui.camArcTolerance.value > 0}),
camArcEnabled: newBoolean(LANG.cx_arce_s, onBooleanClick, {title:LANG.cx_arce_l}),
camArcTolerance: newInput(LANG.cx_arct_s, {title:LANG.cx_arct_l, convert:toFloat, bound:bound(0,100), units, trigger, show:() => ui.camArcEnabled.checked}),
camArcResolution: newInput(LANG.cx_arcr_s, {title:LANG.cx_arcr_l, convert:toFloat, bound:bound(0,180), trigger, show:() => ui.camArcEnabled.checked}),
};
};

View file

@ -88,6 +88,7 @@ export function prepEach(widget, settings, print, firstPoint, update) {
engageFactor = process.camFullEngage,
arcTolerance = process.camArcTolerance,
arcRes = toRadians(process.camArcResolution),
arcEnabled = process.camArcEnabled && arcTolerance > 0 && arcRes > 0,
tolerance = 0,
drillDown = 0,
drillLift = 0,
@ -776,7 +777,7 @@ export function prepEach(widget, settings, print, firstPoint, update) {
if (indexA == startIndex) {
camOut(pointA.clone(), 0, { factor: engageFactor });
// if first point, move to and call export function
arcQ.push(pointA);
if (arcEnabled) arcQ.push(pointA);
}
lastPoint = arcExport(pointB, pointA);
}, !poly.isClosed(), startIndex);
@ -793,7 +794,7 @@ export function prepEach(widget, settings, print, firstPoint, update) {
function arcExport(point, lastp) {
let dist = lastp ? point.distTo2D(lastp) : 0;
if (lastp) {
if (dist > lineTolerance && lastp) {
if (arcEnabled && dist > lineTolerance && lastp) {
let rec = Object.assign(point, { dist });
arcQ.push(rec);

View file

@ -858,6 +858,8 @@ self.lang['en-us'] = {
cx_fast_l: ["disable overhang detection","can be faster and use less","memory with complex models","but fails with overhangs","try enabling if slicing","hangs during shadowing"],
cx_true_s: "true shadow",
cx_true_l: ["computationally correct shadow","will be slower but produce","better cuts for complex parts"],
cx_arce_s: "arc output",
cx_arce_l: ["enable path to arc conversion"],
cx_arct_s: "arc tolerance",
cx_arct_l: ["convert cicrular paths to arcs;","center point drift tolerance","when matching arc points","consider values around 0.15","in mm, or 0.006 inches;","High values may cause","unexpected behavior","0 to disable"],
cx_arcr_s: "arc resolution",