Hi Gabriel,
I don't know if you use tickets for developing this great tool, so I try to make some. Three days ago I spot this tool and I'm happy to see that it is not dead project. So let me share my notice about my use case.
I try to do some radial PCB layout and because I did not realise how to properly do exact radial line alignment in gEDA PCB I do that in LibreCAD. It is much more easy to me to do some geometrical stuff in CAD instead of PCB. I draw some radial guides in CAD and split them off to several pieces. They look like they are one line segment but they actually are not. Then I save my file as DXF version 2007 and convert it to PCB using dxf2pcb tool. It works pretty well except that some of the guides were during conversion process combined to one line instead of a line splitted into several pieces that are aligned so that looks like one line. I don't know if it a bug or feature but I hope it is a bug not a feature because I use line and circle crossing to positioning elements in PCB.
There is also problem with one circle that it was not converted to PCB format. It originally has diameter of 27 mm and is placed as the second one out the circles center direction.
I use dxf2pcb 1.5.0, python version 2.7.9, LibreCAD 2.0.4, 64-bit Debian GNU/Linux Jessie and terminal command to do the conversion was:
$ python dxf2pcb.py -in guides.dxf -out guides.pcb -dmo -scl 0.03937 -lw 10 -xl pad,paprskystred15st,paprskystred7.5st
In attachment there are a source DXF file and converted PCB file for the reference.
Cheers, Jiri
Here are screenshots of both DXF and converted PCB example. It can be seen that there were multiple line pieces combined to one long and that there is one circle missing.
Jiri,
Thanks for your interest in my little utility. I appreciate the feedback.
Unfortunately, the combination of lines you are experiencing is a “feature” of PCB Designer. (My tool makes no attempt to optimize or simplify the drawing.) I ran the conversion using your command line exactly and generated my own guides.pcb. Then, I loaded the pcb file as though it were a stand-alone pcb design using a command like “pcb guides.pcb &”. The vertical spoke (radial line) on the bottom was made up of several short line segments. Of course, because of the location of the drawing relative to the origin, loading the file like that puts the center in the upper left corner. Consequently, the vertical spoke was at the left edge of the drawing space. I did a “select all” operation and dragged the drawing into the middle of the space. After the drag operation, the line segments had joined into one. This happens to some lines and not others. If you load guides.pcb from within PCB Designer using the “load layout to buffer” option, the combining of segments happens as you place the new layout elements.
I’m not sure how to prevent PCB Designer from doing this. Try removing the -dmo switch so that guides.pcb can be loaded as a layout without having to be moved. Then load it as I did with just “pcb guides.pcb”. If you don’t change it, it might stay fragmented as you want it. If it helps, I can add a switch to allow the origin to be set to any X-Y coordinates.
I hope that helps,
GABRIEL DENK
Senior Design Consultant
+1 214 460 5965 mobile
840 F Avenue Ste 103
Plano Texas 75074-6864
Related
Tickets:
#1Thanks for your interest in my little utility. I appreciate the feedback.
Unfortunately, the combination of lines you are experiencing is a “feature” of PCB Designer. (My tool makes no attempt to optimize or simplify the drawing.) I ran the conversion using your command line exactly and generated my own guides.pcb. Then, I loaded the pcb file as though it were a stand-alone pcb design using a command like “pcb guides.pcb &”. The vertical spoke (radial line) on the bottom was made up of several short line segments. Of course, because of the location of the drawing relative to the origin, loading the file like that puts the center in the upper left corner. Consequently, the vertical spoke was at the left edge of the drawing space. I did a “select all” operation and dragged the drawing into the middle of the space. After the drag operation, the line segments had joined into one. This happens to some lines and not others. If you load guides.pcb from within PCB Designer using the “load layout to buffer” option, the combining of segments happens as you place the new layout elements.
I’m not sure how to prevent PCB Designer from doing this. Try removing the -dmo switch so that guides.pcb can be loaded as a layout without having to be moved. Then load it as I did with just “pcb guides.pcb”. If you don’t change it, it might stay fragmented as you want it. If it helps, I can add a switch to allow the origin to be set to any X-Y coordinates.
I'm waiting for this utility for years. It moves gEDA closer to real life development workflow enabling closer cooperation with CAD world. Thanks for your effort.
YES! You are right. The some of the lines are joined into one right after I move them from upper left corner like you mentioned when I load the PCB file as new file into PCB Designer as far as they joins during import.
When I removed -dmo switch the result when opening generated PCB file as new file in PCB Designer is as expected, all lines splitted. Thank you for your advice. But because I automatically generate the PCB using gsch2pcb from schematic file that is not perfect for desired import feature. Of course this line simplification is a "feature" of PCB Designer not related to your tool and it's behavior is weird.
That X-Y switch will be helpful.
This is not a perfect solution but with CAD and this useful tool gEDA is going to be able to do radial positioning of components. Awesome!
I've asked gEDA user community at mailing list if there is a way to switch off the automatic merging of lines. The DJ Delorie said, that automatic merging is intentional.