[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Has anyone used SSOP28.fp?



> That would be useful.  Care to share it?

Attached.

> > 
> > But yeah, at some point we need to modify the footprint data structure
> > to have independent paste/mask control.
> 
> What are the barriers to that happening? I presume that a file format 
> change for footprints is a Big Deal.

It needs to be (1) designed, both the file format and the internal
data structures, (2) implemented in the core, and (3) the GUI needs to
be able to edit them.

> In the end, All I look for are lines and arcs.  So just about any 
> sensible format for pad outlines expressed as lines and arcs with X,Y 
> coordinates should be usable.  I looked briefly at trying to interpret 
> the Gerber, but decided I had better things to do.

You need cutting arcs, not stroking arcs, right?  So each pad needs to
be outlines, offset by half the kerf?  Should be easy enough to write
an exporter for that.



#!/usr/bin/perl
# -*- perl -*-

while (<>) {

    if (/^\s*\)\s*$/) {
	$flag = 0;
    }

    if (/Element\[\"[^\"]*\" \"([^\"]*)\" \"([^\"]*)\" \"([^\"]*)\"/) {
	$element = $1;
	$refdes = $2;
	$value = $3;
	$element = "$element $refdes $value";
#	printf STDERR "Element: $element\n";
    }

    if (/Element\[.* "" "" "" /) {
	while (! /^\s*\)\s*$/) {
	    $_ = <>;
	}
	next;
    }

    if (($x1, $y1, $x2, $y2, $thick, $rest) =
	/Pad\[([\d-]+) ([\d-]+) ([\d-]+) ([\d-]+) ([\d-]+) (.*)\]/) {

	$cx = ($x1 + $x2) / 2;
	$cy = ($y1 + $y2) / 2;
	$w = &abs($x1 - $x2);
	$h = &abs($y1 - $y2);

	if ($element =~ /tqfp32/i) {
	    if ($x1 == $x2) {
		$cy += ($y1 < 0) ? 2000 : -2000;
	    } else {
		$cx += ($x1 < 0) ? 2000 : -2000;
	    }
	}


	if ($element =~ /gumstix/i) {
	    #$thick = 330;
	    $thick = 1180 - 300*2;
	    if ($x1 < 0) {
		$x1 = -6500 - $thick/2;
		$x2 = -9500 + $thick/2;
	    } else {
		$x1 = 6500 + $thick/2;
		$x2 = 9500 - $thick/2;
	    }
	} else {
	    #$thick *= 0.5;
	    $thick *= 0.75;
	    $x1 = $cx - $w/4;
	    $x2 = $cx + $w/4;
	    $y1 = $cy - $h/4;
	    $y2 = $cy + $h/4;
	}

	printf "\tPad[%d %d %d %d %d %s]\n", $x1, $y1, $x2, $y2, $thick, $rest;

    } else {
	print;
    }
}

sub abs {
    my ($v) = @_;
    return $v < 0 ? -$v : $v;
}


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user