diff --git a/auto-generated-widget.html b/auto-generated-widget.html index c264bcf..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; @@ -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,7 +1072,7 @@ // push this line onto gcode array this.solderMaskGcodePath.push(deflatePath); - + } else { // no path left, so done deflating isStillAPath = false; @@ -1077,31 +1082,6 @@ // 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; @@ -7300,6 +7280,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);