Hi everyone, I've been using PCB for a while now, and it's a really nice piece of work. I'd love to contribute to this awesome piece of software, and the thing that bugs me the most is the internal board representation; specifically, the way elements are handled. There is an awful lot of redundancy, since each instance of a given footprint replicates all of its elements. Of course, this makes it impossible to easily replace a given footprint with an updated library version, and presents difficulties with things like detecting rotation. These problems are already documented in doc/ideas/database.txt.
>From a user's standpoint, this is a pretty nasty problem. Components may have manufacturing/solderability problems, and it is often necessary to modify a footprint after a board has been laid out. Granted, for a small board, it's not much of a problem, and you can generally do some magic with search and replace. However, boards are getting more complicated, and replacing footprints for 200 resistor instances manually is quite painful and risks screwing up the board in the process. I want to help fix this issue and submit some patches; unfortunately, it is not simple and will most likely require significant changes to the file format and architecture. The ideas document has a few potential fixes, and it would be great to see some discussion and hopefully reach a consensus on what really needs to be changed and how to proceed about it. This is one proposal from the ideas document: --------------------------------- proposal: store a board side and rotation flag for the element as a whole. The internal contents of the element will show top layer and 0 rotation. harry: comment The internal contents should remain rotated and on the layer they are on. This avoids constantly re-computing these values for every re-draw for example. The flags can inform the system how to transform the component back (or transform a replacement version forward) to the "standard" format. Presumably this would be an uncommon operation in which the computations take place. end-comment harry --------------------------------- My opinion: This proposal would certainly be a step in the right direction. We should copy each library footprint into the document once, and then reference it by name with an appropriate transformation matrix to map the component coordinates to the board coordinates. A mirror flag could indicate that the component should be flipped layer-wise. I slightly disagree with Harry on the topic of storing the rotated elements. It would be OK to store a pre-computed representation internally, but it should be strictly a cache feature, and should not ever make it to the .pcb file. A rotation or layer change command should be performed by modifying the rotation matrix and invalidating the cached representation. This yields several useful features: it will be possible to display and change any component's rotation angle to an exact value with arbitrary precision; it makes the .pcb file more compact and less redundant; it makes it much easier to reconcile the embedded components with the parts library. The second proposal in the file entails maintaining a list of changes to the library footprint for each instance. This begs the question: is this even necessary? The vast majority of commercial PCB layout packages do not permit footprint modification on the board level. Permitting an individual instance of a footprint to be modified would let the PCB designer essentially change the netlist and component specifications at will, which seems pretty dangerous and semantically wrong. In almost all cases where a footprint needs to be changed, the safest and most appropriate way to do it would be to create a different version of it. I would love to hear everyone's thoughts and opinions on this. Is there something I am not seeing here? Thanks, Igor _______________________________________________ geda-dev mailing list [email protected] http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
