add outline wide cutout
This commit is contained in:
parent
6d28e75079
commit
1773430679
4 changed files with 17 additions and 12 deletions
|
|
@ -287,7 +287,7 @@ export function createPopOps() {
|
|||
omitthru: UC.newBoolean(LANG.co_omit_s, undefined, { title: LANG.co_omit_l }),
|
||||
omitvoid: UC.newBoolean(LANG.co_omvd_s, undefined, { title: LANG.co_omvd_l, xshow: (op) => { return op.inputs.outside.checked } }),
|
||||
sep: UC.newBlank({ class: "pop-sep" }),
|
||||
wide: UC.newBoolean(LANG.co_wide_s, undefined, { title: LANG.co_wide_l }),
|
||||
wide: UC.newBoolean(LANG.co_wide_s, undefined, { title: LANG.co_wide_l, show: () => env.poppedRec.outside }),
|
||||
dogbones: UC.newBoolean(LANG.co_dogb_s, undefined, { title: LANG.co_dogb_l, show: (op) => { return !op.inputs.wide.checked } }),
|
||||
revbones: UC.newBoolean(LANG.co_dogr_s, undefined, { title: LANG.co_dogr_l, show: () => env.poppedRec.dogbones }),
|
||||
sep: UC.newBlank({ class: "pop-sep" }),
|
||||
|
|
@ -681,7 +681,6 @@ export function createPopOps() {
|
|||
follow: 'camAreaFollow',
|
||||
refine: 'camAreaRefine',
|
||||
outline: 'camAreaOutline',
|
||||
edgeonly: 'camAreaEdgeOnly',
|
||||
tolerance: 'camTolerance',
|
||||
dogbones: 'camAreaDogbones',
|
||||
revbones: 'camAreaRevbones',
|
||||
|
|
@ -698,7 +697,6 @@ export function createPopOps() {
|
|||
UC.newButton("surface", surfaceAdd),
|
||||
], { class: "ext-buttons f-row" }),
|
||||
outline: UC.newBoolean(LANG.cp_outl_s, undefined, { title: LANG.cp_outl_l }),
|
||||
edgeonly: UC.newBoolean("edges only", undefined, { title: "edges only", show: isClear }),
|
||||
expand: UC.newInput(LANG.cp_xpnd_s, { title: LANG.cp_xpnd_l, convert: toFloat, units }),
|
||||
smooth: UC.newInput(LANG.cp_smoo_s, { title: LANG.cp_smoo_l, convert: toInt, xshow: isSurface }),
|
||||
follow: UC.newInput(LANG.cp_foll_s, { title: LANG.cp_foll_l, convert: toFloat }),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class OpArea extends CamOp {
|
|||
|
||||
async slice(progress) {
|
||||
let { op, state } = this;
|
||||
let { tool, mode, down, drape, over, follow, edgeonly, expand, outline, smooth } = op;
|
||||
let { tool, mode, down, drape, over, follow, expand, outline, smooth } = op;
|
||||
let { ov_topz, ov_botz, direction, rename } = op;
|
||||
let { settings, widget, tabs, color } = state;
|
||||
let { addSlices, setToolDiam, cutTabs, shadowAt, workarea } = state;
|
||||
|
|
@ -146,7 +146,7 @@ class OpArea extends CamOp {
|
|||
let clip = [];
|
||||
POLY.subtract([ area ], shadow, clip, undefined, undefined, 0);
|
||||
POLY.offset(clip, [ -toolDiam / 2, -toolOver ], {
|
||||
count: edgeonly ? 1 : 999, outs, flat: true, z, minArea: 0
|
||||
count: op.steps ?? 999, outs, flat: true, z, minArea: 0
|
||||
});
|
||||
// if we see no offsets, re-check the mesh bottom Z then exit
|
||||
if (outs.length === 0) {
|
||||
|
|
@ -220,8 +220,11 @@ class OpArea extends CamOp {
|
|||
offit = omitMatching(offit, thruHoles);
|
||||
}
|
||||
// todo: move this out of the zs loop
|
||||
POLY.offset(offit, tr_type === 'inside' ? [ -toolDiam / 2 ] : [ toolDiam / 2 ], {
|
||||
count: 1, outs, flat: true, z, minArea: 0, open: true
|
||||
let stepping = tr_type === 'inside' ?
|
||||
[ -toolDiam / 2, -toolOver ] :
|
||||
[ toolDiam / 2, toolOver ];
|
||||
POLY.offset(offit, stepping, {
|
||||
count: op.steps ?? 1, outs, flat: true, z, minArea: 0, open: true
|
||||
});
|
||||
}
|
||||
if (outs.length === 0) {
|
||||
|
|
|
|||
|
|
@ -26,25 +26,29 @@ class OpOutline extends CamOp {
|
|||
let ops_list = this.ops_list = [ ];
|
||||
|
||||
if (outside) {
|
||||
let areas = POLY.flatten(POLY.expand(shadow.base, state.tool.fluteDiameter() / 2 - 0.001));
|
||||
// let areas = POLY.flatten(POLY.expand(shadow.base, state.tool.fluteDiameter() / 2 - 0.001));
|
||||
let areas = shadow.base.clone(true);
|
||||
ops_list.push(new OpArea(state, {
|
||||
areas: { [widget.id]: areas.map(p => p.toArray()) },
|
||||
dogbones,
|
||||
down,
|
||||
expand: 0,
|
||||
mode: 'trace',
|
||||
outline: omitthru,
|
||||
omitthru,
|
||||
// outline: omitthru,
|
||||
ov_botz,
|
||||
ov_topz,
|
||||
over: op.wide ? op.step : 0,
|
||||
plunge,
|
||||
rate,
|
||||
rename: rename ?? "outline",
|
||||
revbones,
|
||||
smooth: 0,
|
||||
spindle,
|
||||
steps: op.wide ? op.steps + 1 : 1,
|
||||
surfaces: {},
|
||||
tool,
|
||||
tr_type: 'none',
|
||||
tr_type: 'outside',
|
||||
}));
|
||||
} else {
|
||||
let areas = shadow.base.clone(true);
|
||||
|
|
@ -57,8 +61,8 @@ class OpOutline extends CamOp {
|
|||
mode: 'trace',
|
||||
omitinner: omitvoid,
|
||||
omitouter: inside,
|
||||
outline: omitthru,
|
||||
omitthru,
|
||||
// outline: omitthru,
|
||||
ov_botz,
|
||||
ov_topz,
|
||||
plunge,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="index.css">
|
||||
<link href="manifest.json" rel="manifest">
|
||||
<link href="../font/css/all.min.css" rel="stylesheet">
|
||||
<script type="module" src="/lib/kiri/run/worker.js"></script>
|
||||
<!-- <script type="module" src="/lib/kiri/run/worker.js"></script> -->
|
||||
<!-- <script type="module" src="/lib/kiri/run/minion.js"></script> -->
|
||||
<script src="../lib/ext/tween.js"></script>
|
||||
<script src="../font/js/all.min.js" crossorigin="anonymous" defer></script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue