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

gEDA-user: centroid data generated by pcb-20050315



As of pcb-20050315, it appears that the algorithm for generating the
centroid data file is to average the positions of all of the pins.

Screaming Circuits told me that they want the xy file to give the
center coordinate of the component.  I was playing around with the
attempt at a definition of the Kycon ST-3100-5C that I've pasted into
the end of this message (feel free to do whatever you like with it,
but I don't promise or warrant that it is at all correct), and I
noticed that the coordinates produced do not represent the center
point that you would get if you took the pin with the smallest x
coordinate and averaged it with the pin with the largest x coordinate,
and then did the same sort of thing thing to get the y coordinate.

On the other hand, I'm not sure if the average of the min and max is
the right algorithm, because, being a connector, the pins of this
particular part probably are not centered on the overall connector
body, and perhaps all non-connector, non-trimpot parts are
sufficiently symetrical in their pin configuration for the current
algorithm to correctly find the center.

Because all of the connectors I'm dealing with are thru-hole, and
Screaming Circuits tends to hand-solder those anyway, I can probably
deal with this sanely by simply removing the xy data for the
connectors; and the same goes for the trimpots.  So the status quo
probably happens to be sufficient for me for the moment.  (I did
almost decide to use some surface mount connectors, though, except
that then I found that they took up more board space than the
thru-hole equivalents, something which happens to be undesireable for
what I'm doing.)

I guess what I think would be useful is:

1) better documentation of all how the xy placement file is
   calculated.  also, the source code mentions that unnumbered pins
   are left out of the calculation, which should be clearly documented
   (if it's in the manual right now, it's not as loudly stated as it
   probably should be, because I don't remember coming across it).

2) possibly a mechanism for dealing with connectors whose centers is
   not centered above their pins, which is probably useful regardless
   of what algorithm you want to use to calculate the center of the pins.


Element[0x00000000 "" "" "" 0 0 0 0 0 100 0x00000000]
(
	Pin[11800 3900 7900 2000 7300 5900 "" "1" 0x00000001]
	Pin[31500 3900 7100 2000 6500 5100 "" "middle" 0x00000001]
	Pin[11800 23600 7100 2000 6500 5100 "" "ground" 0x00000001]
	Pin[31500 23600 7900 2000 7300 5900 "" "2" 0x00000001]
	Pin[11800 43500 7900 2000 7300 5900 "" "3" 0x00000001]
	Pin[31500 43500 7100 2000 6500 5100 "" "tip" 0x00000001]
	Pin[31500 13800 7100 2000 6500 5100 "" "switch1" 0x00000001]
	Pin[31500 33500 7100 2000 6500 5100 "" "switch2" 0x00000001]
	ElementLine [2500 47200 2500 500 1000]
	ElementLine [4000 47200 2500 47200 1000]
	ElementLine [2500 500 4000 500 1000]
	ElementLine [41700 47200 39000 47200 1000]
	ElementLine [41700 44000 41700 47200 1000]
	ElementLine [41700 500 41700 3000 1000]
	ElementLine [39000 500 41700 500 1000]

	)