Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 12 additions & 27 deletions auto-generated-widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1067,7 +1072,7 @@

// push this line onto gcode array
this.solderMaskGcodePath.push(deflatePath);

} else {
// no path left, so done deflating
isStillAPath = false;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down