From 61595b70e26ba6edc370292a29573ac10929c72f Mon Sep 17 00:00:00 2001 From: Jimmie Clark Date: Fri, 6 Aug 2021 11:02:54 -0400 Subject: [PATCH 1/3] bug fix - removed unecessary overlap on pads --- auto-generated-widget.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auto-generated-widget.html b/auto-generated-widget.html index c264bcf..bbc2852 100644 --- a/auto-generated-widget.html +++ b/auto-generated-widget.html @@ -7300,6 +7300,11 @@ }, this); // draw temp union of padgroup + if (temparr.length > 0) { + //debugger; + var sol_paths = this.getUnionOfClipperPaths(temparr); + temparr = sol_paths; + } temparr.forEach(function (d) { this.clipperPads.push(d); }, this); From 592612a5c44676f5294468092905ab7e71fc0b21 Mon Sep 17 00:00:00 2001 From: Jimmie Clark Date: Fri, 6 Aug 2021 11:20:35 -0400 Subject: [PATCH 2/3] tweak for final uncovered section --- auto-generated-widget.html | 41 ++++++-------------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/auto-generated-widget.html b/auto-generated-widget.html index bbc2852..a55eeef 100644 --- a/auto-generated-widget.html +++ b/auto-generated-widget.html @@ -1021,6 +1021,11 @@ // then keep deflating until we have nothing left deflatePath = this.getInflatePath(deflatePath, deflateBy); + //Clear the middles via the size of the structure, instead of a line + if (deflatePath.length == 0 && lastDeflatePath != null) { + deflatePath = this.getInflatePath(lastDeflatePath, deflateBy / 1.5); + } + console.log("deflatePath:", deflatePath); // check if 1st time thru we get no path. if so, show alert @@ -1067,41 +1072,7 @@ // push this line onto gcode array this.solderMaskGcodePath.push(deflatePath); - - } else { - // no path left, so done deflating - isStillAPath = false; - - console.log("done deflating. lastDeflatePath:", lastDeflatePath); - - // however, we need to draw a line to the center to make sure we laser/cut - // all of the pad/smd - - // make sure there is a lastDeflatePath - if (lastDeflatePath != null) { - - // get middle of pad - // do this by creating a three.js mesh, then using bounding box - var mesh = this.getMeshLineFromClipperPath({clipperPath:lastDeflatePath}); - console.log("mesh of lastDeflatePath. mesh:", mesh); - - // get center - var centroid = this.getCentroid(mesh.children[1].children[0]); - - // get point of last deflatePath and draw line to center - console.log("centroid:", centroid, "lastDeflatePath:", lastDeflatePath); - //lastDeflatePath[lastDeflatePath.length - 1]; - var lastPath = lastDeflatePath[0]; - var lastPt = lastPath[0]; // lastPath[lastPath.length - 1]; - - var clipperLine = [[{X:lastPt.X, Y:lastPt.Y}, {X:centroid.x, Y:centroid.y}]]; - - this.drawPathAsLineOrMesh(clipperLine, w, isShowAsMesh, this.solderMaskGrp); - - // push this line onto gcode array - this.solderMaskGcodePath.push(clipperLine); - } - + } lastDeflatePath = deflatePath; From 1a1758c6b97182cd504649e3ad58b413545515c5 Mon Sep 17 00:00:00 2001 From: Jimmie Clark Date: Fri, 6 Aug 2021 11:49:52 -0400 Subject: [PATCH 3/3] fix for infinite loop --- auto-generated-widget.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/auto-generated-widget.html b/auto-generated-widget.html index a55eeef..c3dcb0e 100644 --- a/auto-generated-widget.html +++ b/auto-generated-widget.html @@ -992,7 +992,7 @@ padsAndSmds.forEach(function(pad) { console.log("pad:", pad); - this.solderMaskGcodePath.push("move to pad/smd start"); + this.solderMaskGcodePath.push("move to pad/smd/via/poly start"); var deflateBy = w * (1 - overlapPct / 100) * -1; @@ -1073,6 +1073,15 @@ // push this line onto gcode array this.solderMaskGcodePath.push(deflatePath); + } else { + // no path left, so done deflating + isStillAPath = false; + + console.log("done deflating. lastDeflatePath:", lastDeflatePath); + + // however, we need to draw a line to the center to make sure we laser/cut + // all of the pad/smd + } lastDeflatePath = deflatePath;