1
0
mirror of git://projects.qi-hardware.com/f32xbase.git synced 2024-11-27 20:06:16 +02:00
f32xbase/c2ben/cam/pcb.pl
Werner Almesberger 8325a06f61 Small board adjustments, mainly to improve room for isolation.
- c2ben/c2ben.sch: rename VDD net on the header board to VBUS, to prevent
  KiCad from considering it to be the same as VDD(nPD02)
- c2ben/c2ben.brd: make board 40 mil wider to have more room for applying
  isolation (silicone paste)
- c2ben/c2ben.brd: reduce distance from header pad to board edge by 5 mil
  to 40 mil, to increase overlap of pins and pads
- c2ben/cam/pcb.pl: adjusted board size and spacing between boards for
  above changes
2010-10-22 04:40:03 -03:00

76 lines
1.2 KiB
Raku
Executable File

#!/usr/bin/perl
$d = 25.4/1000*35;
$r = $d/2-0.1; # compensate deflection of board
sub orig
{
$x0 = $_[0];
$y0 = $_[1];
}
sub mil
{
return $_[0]/1000*25.4;
}
sub cut
{
if (defined $x) {
if ($x == $_[0]+$x0 && $y == $_[1]+$y0) {
shift @_;
shift @_;
} else {
print "\n";
}
}
while (@_) {
$x = shift @_;
$y = shift @_;
# ($x, $y) = (-$y, $x);
$x += $x0;
$y += $y0;
print "$x $y $z\n";
}
}
sub card
{
&cut(
&mil( 0)-$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 570)+$r,
&mil( 30)-$r, &mil( 600)+$r,
&mil( 30)-$r, &mil( 650)-$r,
&mil( 0)-$r, &mil( 650)-$r,
&mil( 0)-$r, &mil( 705)+$r,
&mil( 55)-$r, &mil( 760)+$r,
&mil( 55)-$r, &mil( 960)+$r,
&mil( 435)+$r, &mil( 960)+$r,
&mil( 435)+$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 0)-$r);
}
sub conn
{
&cut(
&mil( 0)-$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 500)+$r,
&mil( 490)+$r, &mil( 500)+$r,
&mil( 490)+$r, &mil( 0)-$r,
&mil( 0)-$r, &mil( 0)-$r);
}
$z = -0.8; # full thickness of board
# x: corner offset, compensation for rotation, array position
# y: corner offet
&orig(13.5*4, 0)
&card;
&orig($x0, $y0+26)
&conn;