Bert Timmerman wrote:
> Hi Steve,
> 
> If there is some sort of importer HID template available ;-)

parse_y.y I guess sort of is.  It has the calls that create all of the 
pcb entities while parsing a .pcb file.  Thats where I'd start if it 
were me adding a new importer.

> Methinks I know enough of the DXF fileformat to write such an importer.
> 
> OTOH, I do not know enough of pcb how to do the import of entities
> "directly" (on the fly).

If you had it clear in your mind the translation between what you find 
in a dxf file and what you'd find in a .pcb file, then you can use 
parse_y.y to see how pcb turns whats in a .pcb file into a real layout.

For example

Line [X1 Y1 X2 Y2 Thickness Clearance SFlags]

in a .pcb file ends up hitting this part of parse_y.y:

line_hi_format
                         /* x1, y1, x2, y2, thickness, clearance, flags */
                 : T_LINE '[' NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER 
flags ']'
                         {
                                 CreateNewLineOnLayer(Layer, $3, $4, $5, 
$6, $7, $8, $9);
                         }

so if you need to add a line on the current layer, you'd do:

CreateNewLineOnLayer(Layer, x1, y2, x2, y2, thickness, clearance, flags);


> Maybe an intermediate solution would be to write a stand alone (CLI?)
> translator and after translation add the entities with "File/Load layout
> data to paste-buffer".
> 
> One question that comes to mind is: what do we want to import ?
> 
> Would that be traces, outlines, keepouts, artwork, ... or all sorts of
> other (2D) stuff.

Does dxf have the concept of something like a footprint?  In other 
words, could you export to dxf and then losslessly load it back in or 
have you lost information about footprints being an entity along the way?

I think a big use would be mounting hole locations, board outlines, keep 
out areas.

> First, I want to make some more advance with the DXF exporter, it still
> has a series of bugs to be squashed before it behaves stable.

This is pretty cool.  Even if the import of dxf never happens, I can 
imagine a lot of users being able to export their boards and lay it on a 
mechanical drawing of a package to check that mounting holes line up, 
that the boards fits, etc.  I've also heard rumors of some specialized 
manufacturers who for some reason only take dxf (!) for board layouts. 
I've not confirmed that.

-Dan





_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to