centroid file top and bottom orientation differ by 90 degrees

Bug #756972 reported by Robert Jenssen on 2011-04-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I am using PCB version 1.99z. I have attached a small double sided example pcb with one component on each side. The file->export->bom xy-file is:
# RefDes, Description, Value, X, Y, rotation, top/bottom
# X,Y in mils. rotation in degrees.
# --------------------------------------------

The locations are correct but the top is rotated 90 degrees wrt the

I think the "heuristic" approach to determining the device orientation in the gEDA pcb code is mistaken (see src/hid/bom/bom.c and pcb.pdf section "E.3 Computation of Centroid and Rotation"). The orientation is assumed to be that between pins 1 and 2. Unfortunately, IC manufacturers are not consistent in the orientation of these pins. For example in one of my designs I have DIL pin-outs like:

1 2
3 4
5 6


1 6
2 5
3 4

and 4-sided SMT packages like:

  3 2 1 20 19


    144 143 142

ScreamingCircuits gives a guide to its expectations of device orientation in a centroid file in "http://i.screamingcircuits.com/docs/Understanding%20the%20Centroid%20file.pdf"

To do centroid output reliably, gEDA pcb should maintain an internal record of the rotation that has been applied to each footprint.

Bert Timmerman (bert-timmerman) wrote :


You might want to have a look at:


AFAICT, this one follows the IPC rules and "defacto standards" of the industry.

Kind regards, Bert Timmerman

Robert Jenssen (r-jenssen) wrote :


Assuming only 0,90,180 and 270 degree orientations are allowed, one way to record the orientation is to add 4 mutually exclusive flag bits to the element flags, possibly with symbolic names "Up","Down","Left" and "Right". src/rotate.c:RotateElementLowLevel() can update the element flags, src/hid/bom/bom.c:PrintBOM() can echo the element orientation to an XY file and src/report.c:ReportDialog() can report the element orientation. Sound reasonable?

Regards, Rob Jenssen

Robert Jenssen (r-jenssen) wrote :

Here is a simple patch that adds three element flag bits for orientation right, left and down. Rotating the footprint modifies these flag bits in the corresponding pcb element. This patch assumes that the editor of the footprint library is responsible for producing footprints that have a centroid (mark) and orientation that suits the pick-and-place machine. The attached tgz file contains a simple example.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers