fix arc output, add rounded corners expert option

This commit is contained in:
Stewart Allen 2025-12-14 00:18:34 -05:00
commit dca7c03bd7
5 changed files with 10 additions and 2 deletions

View file

@ -578,6 +578,7 @@ export const conf = {
camRoughStockZ: 0, camRoughStockZ: 0,
camRoughTool: 1000, camRoughTool: 1000,
camRoughTop: true, camRoughTop: true,
camRoundCorners: true,
camStockClipTo: false, camStockClipTo: false,
camStockIndexed: false, camStockIndexed: false,
camStockIndexGrid: true, camStockIndexGrid: true,

View file

@ -153,6 +153,7 @@ export function menu() {
camArcTolerance: newInput(LANG.cx_arct_s, {title:LANG.cx_arct_l, convert:toFloat, bound:bound(0,100), units, trigger, show:() => ui.camArcEnabled.checked}), 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}), camArcResolution: newInput(LANG.cx_arcr_s, {title:LANG.cx_arcr_l, convert:toFloat, bound:bound(0,180), trigger, show:() => ui.camArcEnabled.checked}),
camExpertFast: newBoolean(LANG.cx_fast_s, onBooleanClick, { title:LANG.cx_fast_l }), camExpertFast: newBoolean(LANG.cx_fast_s, onBooleanClick, { title:LANG.cx_fast_l }),
camRoundCorners: newBoolean(LANG.cx_smof_s, onBooleanClick, { title:LANG.cx_smof_l }),
}; };
}; };

View file

@ -39,6 +39,7 @@ class OpArea extends CamOp {
let zBottom = Math.max(workarea.bottom_z, workarea.bottom_part); let zBottom = Math.max(workarea.bottom_z, workarea.bottom_part);
let shadowBase = state.shadow.base; let shadowBase = state.shadow.base;
let thruHoles = state.shadow.holes; let thruHoles = state.shadow.holes;
let roundSharps = settings.process.camRoundCorners;
// also updates tab offsets // also updates tab offsets
setToolDiam(toolDiam); setToolDiam(toolDiam);
@ -116,7 +117,8 @@ class OpArea extends CamOp {
let bounds = area.getBounds3D(); let bounds = area.getBounds3D();
let ts_off = toolDiam / 2 - ts_eps; let ts_off = toolDiam / 2 - ts_eps;
let offopt = { let offopt = {
join: ClipperLib.JoinType.jtRound, arc: 250,
join: roundSharps ? ClipperLib.JoinType.jtRound : undefined,
clean: true, clean: true,
simple: false, simple: false,
cleanDist: 10, cleanDist: 10,

View file

@ -371,6 +371,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
point = toWorkCoords(point); point = toWorkCoords(point);
let { let {
center,
factor = 1, factor = 1,
feed = feedRate, feed = feedRate,
shortCut = toolDiamMove, shortCut = toolDiamMove,
@ -545,7 +546,8 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
point, point,
emit, emit,
rate, rate,
tool tool,
{ center }
); );
return point; return point;

View file

@ -917,6 +917,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_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_s: "true shadow",
cx_true_l: ["computationally correct shadow","will be slower but produce","better cuts for complex parts"], cx_true_l: ["computationally correct shadow","will be slower but produce","better cuts for complex parts"],
cx_smof_s: "rounded corners",
cx_smof_l: ["sharp outside angles","are converted to arcs"],
cx_arce_s: "arc output", cx_arce_s: "arc output",
cx_arce_l: ["EXPERIMENTAL: enable path to arc conversion"], cx_arce_l: ["EXPERIMENTAL: enable path to arc conversion"],
cx_arct_s: "arc tolerance", cx_arct_s: "arc tolerance",