diff --git a/src/kiri/conf.js b/src/kiri/conf.js index c6e1c0c6..6499fb5a 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -655,7 +655,8 @@ exportPreview: false, decimate: true, detail: "good", - animesh: "200" + animesh: "200", + healMesh: false }, // label state preferences labels: { diff --git a/src/kiri/init.js b/src/kiri/init.js index f7413b84..b71f8569 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -152,6 +152,7 @@ control.exportLocal = UI.exportLocal.checked; control.exportPreview = UI.exportPreview.checked; control.decimate = UI.decimate.checked; + control.healMesh = UI.healMesh.checked; SPACE.view.setZoom(control.reverseZoom, control.zoomSpeed); // platform.layout(); API.conf.save(); @@ -1645,6 +1646,7 @@ parts: UC.newGroup(LANG.pt_menu, $('prefs-prt'), {inline: true}), detail: UC.newSelect(LANG.pt_qual_s, {title: LANG.pt_qual_l, action: detailSave}, "detail"), decimate: UC.newBoolean(LANG.pt_deci_s, booleanSave, {title: LANG.pt_deci_l}), + healMesh: UC.newBoolean(LANG.pt_heal_s, booleanSave, {title: LANG.pt_heal_l}), prefadd: UC.checkpoint($('prefs-add')), @@ -2373,6 +2375,7 @@ UI.reverseZoom.checked = control.reverseZoom; UI.autoSave.checked = control.autoSave; UI.decimate.checked = control.decimate; + UI.healMesh.checked = control.healMesh; lineTypeSave(); detailSave(); updateFPS(); diff --git a/src/kiri/slicer.js b/src/kiri/slicer.js index 515bb1e9..94816a56 100644 --- a/src/kiri/slicer.js +++ b/src/kiri/slicer.js @@ -530,6 +530,9 @@ // for topo slices, we just need the raw lines if (!topoMode && !simpleMode) { slice.groups = connectLines(slice.lines, slice.z); + if (options.union) { + slice.groups = POLY.flatten(POLY.union(POLY.nest(slice.groups), null, true), null, true); + } if ((debug && slice.lines.excessive) || xray) { const dash = xray || 3; slice.lines.forEach((line, i) => { diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 9981bcff..74b9540e 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -151,6 +151,7 @@ height: sliceHeight, minHeight: sliceMinHeight, firstHeight: firstSliceHeight, + union: settings.controller.healMesh, // debug: true, // xray: 3, // view: view diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 5783548e..d545d80d 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -164,6 +164,8 @@ kiri.lang['en-us'] = { pt_deci_l: "enable or disable point decimation\nduring port import. for faster slicing\nand lower memory usage", pt_qual_s: "quality", pt_qual_l: "level of detail to retain\nduring slicing operations\nlower is faster", + pt_heal_s: "heal mesh", + pt_heal_l: "attempt to heal\nnon-manifild meshes", xp_menu: "exports",