update thin wall comments, enable for local mode testing

This commit is contained in:
Stewart Allen 2020-10-31 16:02:29 -04:00
commit 5df89763b0
6 changed files with 33 additions and 15 deletions

View file

@ -86,3 +86,7 @@
* http://wiki.imal.org/howto/cnc-milling-introduction-cutting-tools * http://wiki.imal.org/howto/cnc-milling-introduction-cutting-tools
* http://www.twak.co.uk/2011/01/degeneracy-in-weighted-straight.html * http://www.twak.co.uk/2011/01/degeneracy-in-weighted-straight.html
* http://photon.chrisgraf.de/ * http://photon.chrisgraf.de/
# More CNC
* https://www.researchgate.net/publication/250328721_Toolpath_Optimization_on_Automatic_Removal_Uncut_and_Application

View file

@ -531,7 +531,7 @@
let circ1 = sumCirc(orig), let circ1 = sumCirc(orig),
circ2 = sumCirc(polys), circ2 = sumCirc(polys),
diff = Math.abs(1 - (circ1 / circ2)); diff = Math.abs(1 - (circ1 / circ2));
// if circularity of original and offset differ, possible wall gaps
if (diff > 0.2) { if (diff > 0.2) {
thins(orig, out.length ? polys : null, diff, -over); thins(orig, out.length ? polys : null, diff, -over);
} }

View file

@ -1512,8 +1512,8 @@
zHopDistance: UC.newInput(LANG.ad_zhop_s, {title:LANG.ad_zhop_l, bound:UC.bound(0,3.0), convert:UC.toFloat, modes:FDM, expert:true}), zHopDistance: UC.newInput(LANG.ad_zhop_s, {title:LANG.ad_zhop_l, bound:UC.bound(0,3.0), convert:UC.toFloat, modes:FDM, expert:true}),
antiBacklash: UC.newInput(LANG.ad_abkl_s, {title:LANG.ad_abkl_l, bound:UC.bound(0,3), convert:UC.toInt, modes:FDM, expert:true}), antiBacklash: UC.newInput(LANG.ad_abkl_s, {title:LANG.ad_abkl_l, bound:UC.bound(0,3), convert:UC.toInt, modes:FDM, expert:true}),
sliceRotation: LOCAL ? UC.newInput(LANG.ad_slrt_s, {title:LANG.ad_slrt_l, bound:UC.bound(-45,45), convert:UC.toFloat, modes:FDM, expert:true}) : null, sliceRotation: LOCAL ? UC.newInput(LANG.ad_slrt_s, {title:LANG.ad_slrt_l, bound:UC.bound(-45,45), convert:UC.toFloat, modes:FDM, expert:true}) : null,
// detectThinWalls: UC.newBoolean("thin wall fill", onBooleanClick, {title: "detect and fill thin openings\nbetween shells walls", modes:FDM, expert:true})
gcodePauseLayers: UC.newInput(LANG.ag_paws_s, {title:LANG.ag_paws_l, modes:FDM, expert:true, comma:true}), gcodePauseLayers: UC.newInput(LANG.ag_paws_s, {title:LANG.ag_paws_l, modes:FDM, expert:true, comma:true}),
detectThinWalls: LOCAL ? UC.newBoolean(LANG.ad_thin_s, onBooleanClick, {title: LANG.ad_thin_l, modes:FDM, expert:true}) : null,
outputLayerRetract: UC.newBoolean(LANG.ad_lret_s, onBooleanClick, {title:LANG.ad_lret_l, modes:FDM, expert:true}), outputLayerRetract: UC.newBoolean(LANG.ad_lret_s, onBooleanClick, {title:LANG.ad_lret_l, modes:FDM, expert:true}),
// SLA // SLA

View file

@ -358,20 +358,21 @@
} }
if (count) { if (count) {
// permit offset of 0 for laser // permit offset of 0 for laser and drag knife
if (offset1 === 0 && count === 1) { if (offset1 === 0 && count === 1) {
last = top_poly.clone(true); last = top_poly.clone(true);
top.traces = last; top.traces = last;
} else { } else {
if (opt.thin) { if (opt.thin) {
// thin wall offset strategy
let on1s2 = offset1 * 2, let on1s2 = offset1 * 2,
on2s2 = offsetN * 2; on2s2 = offsetN * 2;
POLY.expand2( POLY.expand2(
top_poly, top_poly, // reference polygon(s)
-offset1, -offset1, // first inset distance
-offsetN, -offsetN, // subsequent inset distnace
top.traces, top.traces, // accumulator array
count, count, // numberof insets to perform
// on each new offset trace ... // on each new offset trace ...
function(polys, countNow) { function(polys, countNow) {
last = polys; last = polys;
@ -385,6 +386,10 @@
}); });
}, },
// thin wall probe // thin wall probe
// p1 = original polys
// p2 = collected polys
// diff = circularity difference
// dist = over-expansion distance
function(p1, p2, diff, dist) { function(p1, p2, diff, dist) {
if (p2) { if (p2) {
// nth offset // nth offset
@ -405,13 +410,14 @@
}, },
z); z);
} else { } else {
// standard wall offsetting strategy
POLY.expand( POLY.expand(
top_poly, top_poly, // reference polygon(s)
-offset1, -offset1, // first inset distance
z, z, // set new polys to this z
top.traces, top.traces, // accumulator array
count, count, // number of insets to perform
-offsetN, -offsetN, // subsequent inset distance
// on each new offset trace ... // on each new offset trace ...
function(polys, countNow) { function(polys, countNow) {
last = polys; last = polys;
@ -427,6 +433,7 @@
} }
} }
} else { } else {
// no shells, just infill, is permitted
last = [top.poly]; last = [top.poly];
} }

View file

@ -172,7 +172,7 @@
) && !vaseMode; ) && !vaseMode;
slice.doShells(spro.sliceShells, firstOffset, shellOffset, fillOffset, { slice.doShells(spro.sliceShells, firstOffset, shellOffset, fillOffset, {
vase: vaseMode, vase: vaseMode,
thin: false && spro.detectThinWalls thin: spro.detectThinWalls
}); });
if (solid) slice.doSolidLayerFill(fillSpacing, sliceFillAngle); if (solid) slice.doSolidLayerFill(fillSpacing, sliceFillAngle);
sliceFillAngle += 90.0; sliceFillAngle += 90.0;
@ -192,6 +192,11 @@
slice.doThinFill(fillSpacing, sliceFillAngle); slice.doThinFill(fillSpacing, sliceFillAngle);
sliceFillAngle += 90.0; sliceFillAngle += 90.0;
}, "solids"); }, "solids");
} else if (spro.detectThinWalls) {
forSlices(0.35, 0.5, function(slice) {
slice.doThinFill(fillSpacing, sliceFillAngle);
sliceFillAngle += 90.0;
}, "thins");
} }
// calculations only relevant when supports are enabled // calculations only relevant when supports are enabled

View file

@ -427,6 +427,8 @@ kiri.lang['en-us'] = {
ad_zhop_l: "amount to raise z\non retraction moves\nin millimeters\n0 to disable", ad_zhop_l: "amount to raise z\non retraction moves\nin millimeters\n0 to disable",
ad_abkl_s: "anti-backlash", ad_abkl_s: "anti-backlash",
ad_abkl_l: "use micro-movements to cancel\nbacklash during fills\nin millimeters", ad_abkl_l: "use micro-movements to cancel\nbacklash during fills\nin millimeters",
ad_thin_s: "thin walls",
ad_thin_l: "detect and fill gaps\nbetween shell walls",
ad_slrt_s: "slice rotation", ad_slrt_s: "slice rotation",
ad_slrt_l: "slice object on a bias\nangle in the y axis.\nuseful for extremely\nlarge format prints", ad_slrt_l: "slice object on a bias\nangle in the y axis.\nuseful for extremely\nlarge format prints",
ad_lret_s: "layer retract", ad_lret_s: "layer retract",