Re: gEDA-user: Re: dxf?
Igor2 wrote: I'll need to find some way in the HID API to provide interface for the user to run scripts (like tiling scripts). For exporting it's easy, the export dialog is extensible. I think there should be a similar Import interfce and a 3rd one, which I can't find a good name for, to run plugin functions that would not import/export but would change the PCB itself. Of course. I tested some of the first efforts you made. You have a hook in the source code now so you can use the GPMI library, right? To me it seems the import interface is just the idea of the outward acting HID API functions. Once we get the inward acting ones done, they would not have to be just one way... We could call it the external in out interface or some such language. You are wanting a no compile way to hook in -- that's great! Perhaps a c coded plugin could do the interfacing to GPMI? It would not be a very specific plugin, just a presenting of the internal function names so external scripts could use them by name and parameter list as in a subroutine call. Does GPMI convert all the many ways in scripts to define a subroutine call to one form? If so, that one form could be what the scriptio plugin transforms into a HID API function call. I will help some more with testing. I gave DJ's plugin code examples a look, ( * RenumberBlock * Teardrops ), and they are maybe obvious to him, but the c language without comments was opaque to me... I will welcome a script interface. John Griessen ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
I will help some more with testing. I gave DJ's plugin code examples a look, ( * RenumberBlock * Teardrops ), and they are maybe obvious to him, but the c language without comments was opaque to me... I will welcome a script interface. The only thing you really need to understand is the very last bit: static HID_Action teardrops_action_list[] = { {Teardrops, NULL, teardrops, NULL, NULL} }; REGISTER_ACTIONS (teardrops_action_list) void pcb_plugin_init() { register_teardrops_action_list(); } If you read src/hid.h in pcb's source tree, it tells you all about how these work. The net result of the above, is to add an action called Teardrops() to the master action list in pcb. Once you've done that, it is available to the :command window and the action-script command line options, and with the lesstif hid, you can bind it to a menu entry or hotkey. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
On Thu, 8 Feb 2007 [EMAIL PROTECTED] wrote: Igor2 wrote: I'll need to find some way in the HID API to provide interface for the user to run scripts (like tiling scripts). For exporting it's easy, the export dialog is extensible. I think there should be a similar Import interfce and a 3rd one, which I can't find a good name for, to run plugin functions that would not import/export but would change the PCB itself. Of course. I tested some of the first efforts you made. Yeah, I remember (thanx again), that was the pre-plugin ages. Now we have a proper way doing all this. You have a hook in the source code now so you can use the GPMI library, right? To me it seems the import interface is just the idea of the outward acting HID API functions. Once we get the inward acting ones done, they would not have to be just one way... We could call it the external in out interface or some such language. You are wanting a no compile way to hook in -- that's great! Perhaps a c coded plugin could do the interfacing to GPMI? It would not be a very specific plugin, just a presenting of the internal function names so external scripts could use them by name and parameter list as in a subroutine call. Yes, but actually it can be written more in a more elegant way. The plugin needs to be only a thin wrapper that loads GPMI and the specific module for the language you have your script in, then the script itself could load small packges to access internal functions. I planned to have about 6-8 such packages, like one for manipulating the drawing, another related to hid-registering and so on. This means a script doesn't need to load tons of bloat it will never use. Does GPMI convert all the many ways in scripts to define a subroutine call to one form? If so, that one form could be what the scriptio plugin transforms into a HID API function call. GPMI has an unified interface towards the scripts which covers calling package functions from the script (which then can directly call pcb internals) and delivering events to the script(s) (which actually may result in function calls in the script, depending on hwo the script bound the events). All this doesn't need any modification in the host app, if we have the plugin support which we already have. The only thing that needs modifications in PCB itself is the GUI: currently I see no proper solution for displaying simple dialog boxes similar to the exporter. Of course when I write a script for tiling I could pretend that it's an exporter, register an exporting hid but then instead of writing a file just call PCB interlans trough the interfacing packages to modify the layout data, but it would just be an ugly hack :) I will help some more with testing. I gave DJ's plugin code examples a look, ( * RenumberBlock * Teardrops ), and they are maybe obvious to him, but the c language without comments was opaque to me... I will welcome a script interface. Ok, if we can meet on irc this weekend, and we could work out some way to share the tasks. I think togehter we could make it all work in less time. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
gEDA-user: Re: dxf?
El mar, 06-02-2007 a las 16:31 -0800, Dave N6NZ escribió: Let me be clear about my motivation: I wrote a 2D DXF processor for another project, so I have become familiar with a particular DXF library that is very robust for 2D information. Importing board outlines and mounting hole placement seems like useful functionality, and is a limited goal that I could probably accomplish. If other people would find that functionality useful, I will look into it. If it is not useful enough in that form to interest other users, I won't bother. Of course it is useful! Please go ahead! Carlos ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
RE: gEDA-user: Re: dxf?
Hi all gEDA users, As of last december I'm trying to write a DXF exporter for pcb. Currently exporting straight traces, filled rectangles and circles (drill holes) goes well, polygons and curved traces and a round end cap style are a bit more difficult to implement. So it's still experimental (it does create dxf files with entities and doesn't segfault every time the HID is started). I guess it will take the better part of Q1/2007 to finish this 0.0.1 release of this exporter. Now for the original poster. As I understand this one has to do with an importer for DXF entities. I can see a possible usability of both exporter and importer if we want to improve the development of Printed Circuit Assembly (PCA). PCA != PCB , so for now we develop pcb's with pcb by the electronics oriented people and PCA by the mechanical oriented people with a mechanical CAD application. Speaking for myself, as a mechanical oriented person, the entities I would like to have in DXF-files for PCA are: 1) Outline contour as a polyline (and extrude this to board thickness). 2) List of XY-coordinates and top/bottom for all footprints (packages) exported as a list of XREF's. 3) Trace segments of top/bottom/inside ?? layers as info. Basically 3) would be eye-candy because of the limitations of what mechanical oriented people could/would like to do with it. OTOH for physical engineers this could be used for FEA in RF simulations, heat transfer, EMC and whatnot as long as your FEA software knows what to do with DXF files. YMMV ;-) With these files a mechanical 3D model could be made to see wether the PCA would fit in the virtual product. If changes would be neccesary, a DXF importer for pcb would be handy for changed outlines or XY-coordinates or top/bottom information of the packages involved. As I recall a pcb importer is a concept not yet implemented in the HID way of doing things, for it is not a printer and is not an exporter. Printer and exporter HID's are driven by a GUI or batch HID. So for importing stuff we would need some kind of (batch) UI, either GUI or TUI or CLI to drive the DXF importer. Just my EUR 0.01 Kind regards, Bert Timmerman. -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Carlos Nieves Ónega Verzonden: woensdag 7 februari 2007 19:12 Aan: [EMAIL PROTECTED]; geda-user Onderwerp: gEDA-user: Re: dxf? El mar, 06-02-2007 a las 16:31 -0800, Dave N6NZ escribió: Let me be clear about my motivation: I wrote a 2D DXF processor for another project, so I have become familiar with a particular DXF library that is very robust for 2D information. Importing board outlines and mounting hole placement seems like useful functionality, and is a limited goal that I could probably accomplish. If other people would find that functionality useful, I will look into it. If it is not useful enough in that form to interest other users, I won't bother. Of course it is useful! Please go ahead! Carlos ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
Hello, Well for one thing, you certainly understand DXF much better than I, and have more experience with it. Also, you have mechanical design experience that I lack. How are you writing the DXF? I am using dxflib to read DXF files in my other project. dxflib is a GPL's C++ DXF library that is used in QCAD. http://www.ribbonsoft.com/ dxflib is pretty easy to use for reading DXF, but requires knowledge of DXF file structure to correctly output a DXF file. -dave Bert Timmerman wrote: Hi all gEDA users, As of last december I'm trying to write a DXF exporter for pcb. Currently exporting straight traces, filled rectangles and circles (drill holes) goes well, polygons and curved traces and a round end cap style are a bit more difficult to implement. So it's still experimental (it does create dxf files with entities and doesn't segfault every time the HID is started). I guess it will take the better part of Q1/2007 to finish this 0.0.1 release of this exporter. Now for the original poster. As I understand this one has to do with an importer for DXF entities. I can see a possible usability of both exporter and importer if we want to improve the development of Printed Circuit Assembly (PCA). PCA != PCB , so for now we develop pcb's with pcb by the electronics oriented people and PCA by the mechanical oriented people with a mechanical CAD application. Speaking for myself, as a mechanical oriented person, the entities I would like to have in DXF-files for PCA are: 1) Outline contour as a polyline (and extrude this to board thickness). 2) List of XY-coordinates and top/bottom for all footprints (packages) exported as a list of XREF's. 3) Trace segments of top/bottom/inside ?? layers as info. Basically 3) would be eye-candy because of the limitations of what mechanical oriented people could/would like to do with it. OTOH for physical engineers this could be used for FEA in RF simulations, heat transfer, EMC and whatnot as long as your FEA software knows what to do with DXF files. YMMV ;-) With these files a mechanical 3D model could be made to see wether the PCA would fit in the virtual product. If changes would be neccesary, a DXF importer for pcb would be handy for changed outlines or XY-coordinates or top/bottom information of the packages involved. As I recall a pcb importer is a concept not yet implemented in the HID way of doing things, for it is not a printer and is not an exporter. Printer and exporter HID's are driven by a GUI or batch HID. So for importing stuff we would need some kind of (batch) UI, either GUI or TUI or CLI to drive the DXF importer. Just my EUR 0.01 Kind regards, Bert Timmerman. -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Carlos Nieves Ónega Verzonden: woensdag 7 februari 2007 19:12 Aan: [EMAIL PROTECTED]; geda-user Onderwerp: gEDA-user: Re: dxf? El mar, 06-02-2007 a las 16:31 -0800, Dave N6NZ escribió: Let me be clear about my motivation: I wrote a 2D DXF processor for another project, so I have become familiar with a particular DXF library that is very robust for 2D information. Importing board outlines and mounting hole placement seems like useful functionality, and is a limited goal that I could probably accomplish. If other people would find that functionality useful, I will look into it. If it is not useful enough in that form to interest other users, I won't bother. Of course it is useful! Please go ahead! Carlos ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
Carlos Nieves Ónega wrote: El mar, 06-02-2007 a las 16:31 -0800, Dave N6NZ escribió: Importing board outlines and mounting hole placement seems like useful functionality, and is a limited goal that I could probably accomplish. If other people would find that functionality useful, I will look into it. Yes. The case I can think of is a box. DXF is somewhat available for enclosure drawings, things like hinges, handles, standoffs -- things that have function in an electrical enclosure. I've never seen a DXF for a transformer or even a terminal block... they seem to be documented with .pdf (postscript). But I would like to be able to use a detailed 2D DXF drawing of a view of a dust proof enclosure, for instance. John Griessen ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
As I recall a pcb importer is a concept not yet implemented in the HID way of doing things, for it is not a printer and is not an exporter. . Bert Timmerman. There's the plugin way of implementing. It lets your code use the PCB API. DJ has examples of c coded plugins. I wonder if we could make a plugin with python somehow -- with or without a SWIG or other c wrapper? John Griessen ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
On 2/7/07, Kai-Martin Knaak [EMAIL PROTECTED] wrote: On Mon, 05 Feb 2007 20:47:34 -0800, Dave N6NZ wrote: Can you point me at some code to follow? Like perhaps a working plug-in that I could gut and use for a skeleton? You may look at the source of pstoedit. This tool can convert postscript to pcb. I wrote that converter. I don't think it will be too useful as a reference, except maybe for the pcb file format. But there is good documentation for that already, so the pstoedit source is still of limited usefulness. Regards, Mark [EMAIL PROTECTED] -- You think that it is a secret, but it never has been one. - fortune cookie ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
On Wed, 7 Feb 2007 [EMAIL PROTECTED] wrote: As I recall a pcb importer is a concept not yet implemented in the HID way of doing things, for it is not a printer and is not an exporter. . Bert Timmerman. There's the plugin way of implementing. It lets your code use the PCB API. DJ has examples of c coded plugins. I wonder if we could make a plugin with python somehow -- with or without a SWIG or other c wrapper? John Griessen I'm working on one, but with a lib (so no direct python). Currently I don't have any time on that project but I hope I can start working on it again in a few months. It'll support all scripting languages GPMI supports (tcl, php, python, ruby, lua, ghli (pascal), stutter (lisp)). It's a plugin. Before I can get it all work, I'll need to find some way in the HID API to provide interface for the user to run scripts (like tiling scripts). For exporting it's easy, the export dialog is extensible. I think there should be a similar Import interfce and a 3rd one, which I can't find a good name for, to run plugin functions that would not import/export but would change the PCB itself. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
Dave N6NZ wrote: If other people would find that functionality useful, I will look into it. It would seem handy to be able to import dxf files for certain hardware modules, assemblies that mount onto a pcb and for some connectors. Phil ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: Re: dxf?
[EMAIL PROTECTED] wrote: Dave N6NZ wrote: If other people would find that functionality useful, I will look into it. It would seem handy to be able to import dxf files for certain hardware modules, assemblies that mount onto a pcb and for some connectors. What does import mean in this case? Are you talking about creating a footprint from DXF? And/or silk screen? Or creating a drill list for mounting holes for the modules? Can you clarify your needs a little bit more? -dave Phil ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
gEDA-user: Re: dxf?
Can you point me at some code to follow? Like perhaps a working plug-in that I could gut and use for a skeleton? -dave DJ Delorie wrote: Write a plug-in that reads the dxf and adds the items to the existing outline layer. It's far easier to just call the internal API than to create a .pcb file and try to merge it. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user