#usage "en:This ULP generates for LONG and OFFSET pads in inner layers the same diameter and shape as it is in the outer layers.
"
"
"
"If you are using a LONG or OFFSET pad for a oblong soldering lug, and you defined a slotted hole with contours "
"drawn in layer 46, Milling, it is necessary to expand the pad in the inner layers with additional WIRE "
"segments. So the DRC is able to check possible conflicts with the slotted hole, and polygons with a different "
"signal name can be calculated properly.
"
"However, there might occur a problem with thermals because the ULP can't recognize whether the pad is "
"connected to a polygon with thermals in the current layer. It can happen that the pad extension connects "
"fully with the copper plane.
"
"If a (list of) Element_name(s) is given, the extended shape will be generated for the given element(s); "
"if there is no Element_name given, extended shapes are generated for all elements that have long pads.
"
"RUN make-long-pad-inner-layer [Element_name [Element_name] .. ] "
"In order to avoid DRC Overlap errors, you have to connect each pad. "
"The wires must have the correct signal name! Therefore connect each referring pin in the schematic with a NET. "
"The ERC reports 'Only one pin on net...' then, but this has to be approved. "
" "
" "
" "
"RUN make-long-pad-inner-layer [Bauteilname [Bauteilname] .. ] "
"Die Innenlagen müssen benutzt sein! "
"Um Overlap-Fehler im DRC zu vermeiden, muß jedes PAD angeschlossen sein; "
"somit haben die erzeugten WIREs auch den entsprechenden Signal-Namen. "
"Dazu verbinden Sie im Schaltplan die Pins mit einem NETz. "
"Dadurch bedingt, meldet der ERC 'Nur ein Pin an Net... Diese Meldung kann aber toleriert werden.'"
" "
" Version " + Version, "OK", "Cancel") != 0) exit(-1);
board(B) {
B.layers(L) {
if (L.number < 16 & L.number > 1) {
if (L.used) {
usedLayer[L.number] = 1;
nameLayer[L.number] = L.name;
usedsum++;
}
}
}
B.elements(E) {
if (!argv[1] || checkEname(E.name) ) {
E.package.contacts(C) {
if (C.pad) {
string p, m;
real l;
if (C.pad.shape[16] == PAD_SHAPE_LONG) {
l = u2mm(C.pad.diameter[1]) * C.pad.elongation * 0.005;
sprintf(m, "MARK (%.9f %.9f);\n", u2mm(C.x), u2mm(C.y));
sprintf(s, "WIRE %s %.9f (R0 0) (P%.9f %0.1f);\n", // 2013-01-15 more resolution
checkname(C.pad.signal),
u2mm(C.pad.diameter[1]),
l, C.pad.angle
);
p += s;
sprintf(s, "WIRE %s %.9f (R0 0) (P%.9f %.1f);\n", // 2013-01-15 more resolution
checkname(C.pad.signal),
u2mm(C.pad.diameter[1]),
l, C.pad.angle+180.0
);
p += s;
if (!C.pad.signal) err(E.name, C.pad.name, u2mm(C.x), u2mm(C.y) );
}
else if (C.pad.shape[16] == PAD_SHAPE_OFFSET) {
real l = u2mm(C.pad.diameter[1]) * C.pad.elongation * 0.01;
sprintf(m, "MARK (%.9f %.9f);\n", u2mm(C.x), u2mm(C.y));
sprintf(s, "WIRE %s %.9f (R0 0) (P%.9f %0.1f);\n", // 2013-01-15 more resolution
checkname(C.pad.signal),
u2mm(C.pad.diameter[1]),
l, C.pad.angle
);
p += s;
if (!C.pad.signal) err(E.name, C.pad.name, u2mm(C.x), u2mm(C.y) );
}
if (p) {
cmd += m;
for (int n = 2; n < 16; n++) {
if (usedLayer[n]) { // 2011-11-14
sprintf(s, "CHANGE LAYER %d;\n", n);
cmd += s;
cmd += p;
} // 2011-11-14
}
}
}
}
}
}
}
if (!usedsum) {
dlgMessageBox("!Inner layer not used!
"
"The inner layers must be used.!
There has to be at least one WIRE oder POLYGON "
"in the inner layer.
"
"Wird für längliche Lötanschlüsse (Lötfahnen) ein LONG- oder OFFSET-Pad benutzt und die Bohrung zusätzlich "
"geschlitzt, wobei die Fräskontur für den Längsschlitz im Layer 46 (Milling) definiert wird, so muß "
"in den Innenlagen das Pad zusätzlich mit WIRE-Segmenten erweitert werden. Dadurch kann der DRC Konflikte "
"mit dem Längsschlitz überprüfen bzw. ein Polygon mit fremden Signalnamen entsprechend freirechnen.
"
"Es gibt allerdings ein Problem bei Thermalstegen, da über das ULP nicht ohne weiteres erkannt werden kann, "
"ob das Pad in diesem Layer an eine Kupferfläche über Thermalstege angeschlossen ist. "
"Diese Pads werden durch die Paderweiterung teilweise vollflächig angebunden.
"
"Bei Angabe eines (einer Liste von) Bauteilnamen werden nur für dieses (diese) Bauteil(e) die "
"Paderweiterung erzeugt. Ohne Angabe von Bauteilnamen wird bei allen Bauteilen, die LONG-Pads enthalten, die "
"Paderweiterung erzeugt.
Es muß also mindestens ein WIRE oder ein POLYGON "
"in der Innenlage vorhanden sein.
First conect unconected Pins/Pads in schematic, please cancel.";
}
dlgDialog("ERROR " + filename(argv[0])) {
dlgHBoxLayout dlgSpacing(400);
dlgHBoxLayout {
dlgVBoxLayout dlgSpacing(400);
dlgTextView(error);
}
dlgLabel("Can not place Signal-Wires on Pads with Signal-Name.
"+
"Please draw a NET on this PIN in Schematic to connect this PAD with an signal!"
);
dlgLabel(Message);
dlgHBoxLayout {
dlgPushButton("Ignore") dlgAccept();
dlgPushButton("Cancel") { dlgReject(); exit(-1); }
dlgStretch(1);
}
};
}
cmd += "MARK;\nGRID LAST;\nRATSNEST;";
// dlgMessageBox(cmd, "OK"); // show generated script
exit(cmd);
}
else dlgMessageBox("Start this ULP in Board", "OK");