-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export to gEDA PCB format for gerber/etc... processing #132
Comments
Hi @erichVK5, src/net/sourceforge/fidocadj/export/ExportInterface.java There are also some minor changes to do in the ExportGraphic class and elsewhere (I can do that if you want to). There is a mechanism so that the splines (complex curves) can be automatically exported as polygons. However, this is not available for ovals and for Béziers, that should be handled by your code. I would like to release version 0.24.7 at the beginning of April. It should be nice if such a feature can be tested a bit with the preliminary versions by our beta testers, therefore towards the end of February. However, do not be afraid to propose some pull requests of some small amount of code we can discuss about. Just, please do not leave the thing half done once you started working on it... There may also be the need of a little bit of support in the future if a bug is found or if something needs to be improved. BTW, please follow the coding rules described in the README file. If you need any information, just ask and I will be happy to help if I can! In the meanwhile, I will be working on issue #99 Kind regards and thanks again, D. |
Yes, I have had a look at the interface. I will get started and see how it goes. We are keen to implement export of PCB design elements from pcb-rnd as well in due course, into FidoCadJ format, to allow a reasonably lossless two way interchange to occur, subject to caveats re: non circular arcs. This would allow tricks like importation of converted gerbers from pcb-rnd into FidoCadJ for rework or modification. Now that I think of it, there is a gerber parser in the wild in Java that I used in my translate2geda converter, which may be of interest as an import option for FidoCadJ. Regards, Erich. |
That's fine, @erichVK5 BTW, concerning a two-way lossles conversion, one of the limitations may be the low resolution employed by FidoCadJ, which may be limiting in some situations. Kind regards, |
Export from FidoCadJ of all graphical elements (minus footprints) to a pcb-rnd (.pcb) layout is now working. Here are some preliminary screenshots: Footprint (macro) export should be done in the next few days. The lower image/screenshot is the result of exporting a design from FidoCadJ->pcb-rnd and back to FidoCadJ Text inevitably loses a bit of its original nature, and the circuit layer is ignored. This export from pcb-rnd to FidoCadJ was achieved with a newly implemented export_fidocadj module in the gEDA PCB fork pcb-rnd. Export from pcb-rnd to FidoCadJ also suffers the expected loss of resolution going from a centimil to a 5mil grid, seen best with the beziers and cubic splines. pcb-rnd also support arcs that are less than a full circle, making lossless export to FidoCadJ of these difficult. Nevertheless, a viable pathway for exporting FidoCadJ design to gerber and a number of other formats, including g-code, via pcb-rnd, is nearly complete. Regards, Erich. |
Hi @erichVK5 I will probably be able to do a code review at the very end of February/beginning of March so that we can work on your pull requests starting from that date. For the macros (footprints) you can ask to FidoCadJ to split them automatically, using the primitives. Moreover, there are some automatic tests that I usually employ to see if I have broken something in the export phase: https://github.com/DarwinNE/FidoCadJ/tree/master/test/export There is really not much but a bunch of quite simple scripts. Kind regards and thanks again a lot, D. P.S. you can post pictures directly here on GitHub, with a drag&drop, it works very well. If it can be useful, here is the test pattern I employ for testing the export facilities:
|
I'm fairly happy with the degree of support for primitives and footprint elements now. I will start cleaning up the code, and try your export pattern, as suggested, and perhaps sort out a test file. gEDA footprints do not support text within them, so text is not exported in them. Ellipses are not well supported, and these have been converted into either polylines or polygons within the layout Ellipse (other than circle) support has not been provided for exported footprints. FidoCadJ SMD footprints quote layer 1 for the copper pads, but the exporter assumes layer 2 is actually intended, and proceeds accordingly . They can always be shifted in gEDA PCB if needed. Text on the layout is exported, but needs to be a reasonable size to render properly on a PCB exported to gerber, i.e. 50mil high or larger. The exporter currently substitutes rectangular pads for RoundRect pads. Rotation of elements (i.e. text, footprints) other than 0,90,180,270 is not yet supported. I will also generate a test board and export to gerber as a proof of concept. Cheers, Erich. |
I've sent a git diff and the new export module. Here are some gerbers being viewed in gerbv, the gEDA gerber viewer, that were exported from pcb-rnd after being exported from FidoCadj to gEDA PCB/pcb-rnd (.pcb) format: Incidentally, pcb-rnd also provides a pathway for g-code export, for milling or conceivably eggbot use. I have not had a chance to provide test outputs yet. The round trip is now quite functional, with a few caveats: Steps:
In the absence of an explicit outline layer in FidoCadJ, any of the inner copper layers, or the silk or circuit layer, can be used as the outline layer, which then needs to be manually renamed to "outline" in the exported .pcb file before loading into pcb-rnd or gEDA PCB.
Things that are still worth implementing: on the FidoCadJ side: automatic rotation of footprints on export to pcb-rnd possibilities on the pcb-rnd side: a library of FidoCadJ standard lib parts to allow parts to be placed that retain their positions on export to FidoCadJ. This should allow design rules checks (DRC) and such like, for more complicated designs, if pin numbering and naming can be retained during the round trip for netlisting/DRC purposes in pcb-rnd. |
Hi @erichVK5 Now, let us proceed to integrate your code. You said you sent a git diff, but it would be probably more convenient to fork the FidoCadJ repository on your Github account (if you have not done it already), then apply the differences there and finally open a pull request. Cheers, D. |
Done. Let me know if I have neglected to include anything that stops it from building. |
#132 Implementation of export to gEDA pcb-rnd/PCB
Hi @erichVK5 BTW, I know what kind of effort is required to implement what you did, so in behalf of the FidoCadJ community, I really would like to thank you for your work! D. |
My pleasure! Your modular and well thought out code, plus the Eagle export module framework, made it much easier to implement. Test suites aren't my forte. I could devise a layout which exercises the key supported features currently to serve as a reference; would this help? Cheers, Erich. |
Hi again,
It is presently contained in the test_export.sh script (in the test directory).
It is a very basic test where a line with the comment (that may vary if the version of FidoCadJ changes) is ignored. BTW, is there a specific library for gEDA available? One of the problem we had with the Eagle export is that the original library was provided once and never completed or supported, so it is now quite outdated. Cheers, EDIT: I forgot! Your code compiles perfectly and I could export a test drawing, however I do not use gEDA and I could not yet test it. |
The gEDA PCB fork, pcb-rnd, is the one with the FidoCadJ export module http://repo.hu/projects/pcb-rnd/ svn checkout svn://repo.hu/pcb-rnd/trunk will get you up and running pretty quickly. For extra points there are headless batch processing CLI arguments that will load and export a layout in whatever other format, i.e. gerber. I will try and do an export test script tonight. I will have a look at the documentation and see if there is anything I can do to add value. I still intend to implement footprint rotation in the exporter to gEDA pcb-rnd/PCB. There is a bit of extraneous code that can be trimmed too. There's no gEDA PCB library as such in Java, but the format is very simple and text based, and the project's commitment to adhering to stable formats which remain backwards compatible means that the FidoCadJ export module should continue to work for years. We can still load layouts generated in the 1990s! The only residual issue is conversion of the standard lib footprints to gEDA compatible .fp files. The pad descriptions in the macros are not listed in the usual pin number order, i.e. for DIL sockets. If there is no desire to alter the standard library footprints such that pads are described in pin order, to allow automated numbering of pins on conversion/export, I will need to implement a lookup table or similar. The advantage of correct pin numbering is the ability to easily apply netlists for design rule checks in PCB. Cheers, Erich. |
Quite impressive! Cheers, D. |
Hi @erichVK5 Great stuff! |
Hi @erichVK5 https://github.com/DarwinNE/FidoCadJ/releases/tag/v0.24.7beta Thanks again for the work you did. |
Great project! I am very happy that everything worked fine! Do you think you can implement an automatic test? BTW, I can do that, it is not a problem for me. |
It might save reinventing the wheel if you have a template you can use. It is not something I am terribly familiar with and my learning curve might delay your code tidying. My time would probably be best applied to getting elements to rotate if required on export. |
Hi @erichVK5, If there is anything that is not clear, feel free to ask. Cheers, D. P.S. in any case, I agree with you about the priority on the element rotation! |
I am closing this Issue now, do not hesitate to re-open it if there is something to be done to complete it. |
If the developers are amenable, I would like to write a plugin for exporting to gEDA PCB/pcb-rnd format.
This will make artistic, freeform board design, and importantly, gerber generation, much easier for FidoCadJ users. gEDA PCB/pcb-rnd also allows export in a variety of other formats.
The plugin would export copper layers into respective gEDA design layers, and silkscreen layers, embedding the necessary footprints, and would duplicate lines, boxes, arcs and pads.
Boxes would become four lines.
Design rules, rendering and clearance calculations are challenging with ellipses, so non circular arcs would be exported broken up into line segments.
Similarly, beziers and splines would be exported as line segments too.
Standard library footprints would be exported as footprints that reproduce the silk elements subject to the bezier/spline/ellpise constraints mentioned above, and would approximate the rounded rectangular pin shapes as closely as possible. The SMD rectangular pad shapes would be identical.
Sane soldermask clearances would be exported as a default.
gEDA pcb-rnd, and its progenitor, PCB, can be run headless, allowing simple script driven batch processing to gerbers by users as well.
I will proceed accordingly if there are no objections or other suggestions!
The text was updated successfully, but these errors were encountered: