diff --git a/src/kiri/conf.js b/src/kiri/conf.js index 4608391b..0ed1beb7 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -665,7 +665,8 @@ detail: "good", animesh: "200", healMesh: false, - ortho: false + ortho: false, + devel: false }, // label state preferences labels: { diff --git a/src/kiri/init.js b/src/kiri/init.js index 859d5450..4dc5f5ae 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -158,6 +158,7 @@ control.decimate = UI.decimate.checked; control.healMesh = UI.healMesh.checked; control.ortho = UI.ortho.checked; + control.devel = UI.devel.checked; SPACE.view.setZoom(control.reverseZoom, control.zoomSpeed); // platform.layout(); API.conf.save(); @@ -1609,13 +1610,14 @@ reverseZoom: UC.newBoolean(LANG.op_invr_s, booleanSave, {title:LANG.op_invr_l}), ortho: UC.newBoolean(LANG.op_orth_s, booleanSave, {title:LANG.op_orth_l}), dark: UC.newBoolean(LANG.op_dark_s, booleanSave, {title:LANG.op_dark_l}), - decals: UC.newBoolean(LANG.op_decl_s, booleanSave, {title:LANG.op_decl_s}), + devel: UC.newBoolean(LANG.op_devl_s, booleanSave, {title:LANG.op_devl_l}), danger: UC.newBoolean(LANG.op_dang_s, booleanSave, {title:LANG.op_dang_l}), lprefs: UC.newGroup(LANG.op_disp, $('prefs-gen2'), {inline: true}), showOrigin: UC.newBoolean(LANG.op_shor_s, booleanSave, {title:LANG.op_shor_l}), showRulers: UC.newBoolean(LANG.op_shru_s, booleanSave, {title:LANG.op_shru_l}), showSpeeds: UC.newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}), + decals: UC.newBoolean(LANG.op_decl_s, booleanSave, {title:LANG.op_decl_s}), lineType: UC.newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"), animesh: UC.newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"), units: UC.newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM, trace:true}, "units"), @@ -2411,6 +2413,7 @@ UI.decimate.checked = control.decimate; UI.healMesh.checked = control.healMesh; UI.ortho.checked = control.ortho; + UI.devel.checked = control.devel; lineTypeSave(); detailSave(); updateFPS(); diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 70e5aef4..59ffd2df 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -27,7 +27,7 @@ PROTO = Object.clone(COLOR), bwcomp = (1 / Math.cos(Math.PI/4)), getRangeParameters = FDM.getRangeParameters, - debug = false; + debug = true; let isThin = false; // force line rendering let isFlat = false; // force flat rendering @@ -449,7 +449,7 @@ if (render) { forSlices(0.9, 1.0, slice => { let params = getRangeParameters(settings, slice.index); - doRender(slice, isSynth, params); + doRender(slice, isSynth, params, ctrl.devel); }, "render"); } @@ -472,56 +472,56 @@ return Math.max(min,Math.min(max,v)); } - function doRender(slice, isSynth, params) { + function doRender(slice, isSynth, params, devel) { const output = slice.output(); const height = slice.height / 2; const solidWidth = params.sliceFillWidth || 1; slice.tops.forEach(top => { if (isThin) output - .setLayer('slice', { line: 0x000066, check: 0x000066 }) + .setLayer('part', { line: 0x333333, check: 0x333333 }) .addPolys(top.poly); - if (top.shells) output + output .setLayer("shells", isSynth ? COLOR.support : COLOR.shell) - .addPolys(top.shells, vopt({ offset, height, clean: true })); + .addPolys(top.shells || [], vopt({ offset, height, clean: true })); + + output + .setLayer("solid fill", isSynth ? COLOR.support : COLOR.fill) + .addLines(top.fill_lines || [], vopt({ offset: offset * solidWidth, height })); + + output + .setLayer("sparse fill", COLOR.infill) + .addPolys(top.fill_sparse || [], vopt({ offset, height, outline: true })) + + if (top.thin_fill) output + .setLayer("thin fill", COLOR.fill) + .addLines(top.thin_fill, vopt({ offset, height })); if (top.gaps) output .setLayer("gaps", COLOR.gaps) .addPolys(top.gaps, vopt({ offset, height, thin: true })); - if (isThin && debug) { + if (isThin && devel) { slice.output() - .setLayer('offset', { face: 0, line: 0x888888 }) - .addPolys(top.fill_off) - .setLayer('last', { face: 0, line: 0x008888 }) - .addPolys(top.last); + .setLayer('fill inset', { face: 0, line: 0xaaaaaa, check: 0xaaaaaa }) + .addPolys(top.fill_off); + // .setLayer('last', { face: 0, line: 0x008888, check: 0x008888 }) + // .addPolys(top.last); } - - if (top.fill_lines && top.fill_lines.length) output - .setLayer("fill", isSynth ? COLOR.support : COLOR.fill) - .addLines(top.fill_lines, vopt({ offset: offset * solidWidth, height })); - - if (top.fill_sparse) output - .setLayer("infill", COLOR.infill) - .addPolys(top.fill_sparse, vopt({ offset, height, outline: true })) - - if (top.thin_fill) output - .setLayer("fill", COLOR.fill) - .addLines(top.thin_fill, vopt({ offset, height })); }); - if (isThin && debug) { - if (slice.solids) output - .setLayer("solids", { face: 0x00dd00 }) + if (isThin && devel) { + if (slice.solids && slice.solids.length) output + .setLayer("solids", { face: 0xbbbb00, check: 0xbbbb00 }) .addAreas(slice.solids); - if (slice.bridges) output - .setLayer("bridges", { face: 0x00aaaa, line: 0x00aaaa }) + if (slice.bridges && slice.bridges.length) output + .setLayer("bridges", { face: 0x00cccc, line: 0x00cccc, check: 0x00cccc }) .addAreas(slice.bridges); - if (slice.flats) output - .setLayer("flats", { face: 0xaa00aa, line: 0xaa00aa }) + if (slice.flats && slice.flats.length) output + .setLayer("flats", { face: 0xaa00aa, line: 0xaa00aa, check: 0xaa00aa }) .addAreas(slice.flats); } diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 757efba6..83cf6b21 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -192,10 +192,12 @@ kiri.lang['en-us'] = { op_disp: "display", op_xprt_s: "expert", op_xprt_l: "show more settings options", - op_decl_s: "decals", + op_decl_s: "show decals", op_decl_l: "show device decals and logos", op_dang_s: "experimental", op_dang_l: "show experimental parameters", + op_devl_s: "developer", + op_devl_l: "show developer options", op_hopo_s: "hover pop", op_hopo_l: ["enable menu hover","to activate"], op_dark_s: "dark mode",