Author Topic: ULP:: any scritp to design copper pcb resistors?  (Read 4265 times)

0 Members and 1 Guest are viewing this topic.

Offline 0dbTopic starter

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: zm
ULP:: any scritp to design copper pcb resistors?
« on: June 12, 2020, 03:22:22 pm »


I'd like to place some copper PCB resistors.
Is there any ULP parametric script?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: ULP:: any scritp to design copper pcb resistors?
« Reply #1 on: August 08, 2020, 04:40:36 am »
You could try starting with this:
Code: [Select]
/* Set mark before running. */
/* Make sure your grid has the right units ! */
/* Make sure layer is set as desired. */

real height = 25;   /* Height of bounding box. */
real width = 25;    /* width of bounding box. */
real trace = 0.2;   /* Trace width */
real extraSep = 0;  /* extra separation between traces */

/* ------------------------------------- */
real epsilon = trace;

string cmd, s;
sprintf (cmd, "set wire_bend 0; wire %f (r 0 0)", trace);

real y = 0;
real x = width;
while (y < height) {
    sprintf(s, " (r %f %f)", x, y);
    cmd += s;
    y += 2*trace + extraSep;
    sprintf(s, " (r %f %f)", x, y);
    cmd += s;
    if (x <= epsilon) {
    x = width;
    } else {
    x = 0;
    }
}
cmd += ";\n";
// dlgMessageBox(cmd);
exit(cmd);
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf