Menu

#1 Line segments combined after conversion

1.0
closed
None
2016-07-06
2016-06-30
No

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

2 Attachments

Related

Tickets: #1

Discussion

  • Jiří Čejka

    Jiří Čejka - 2016-06-30

    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.

     
    • Jiří Čejka

      Jiří Čejka - 2016-06-30
      I've just found, that this line is wrong in generated PCB file according to problem that one circle is missing in PCB.
      
      Arc[0 0 53150 53150 1000 1400 15.0 0.0 0x00000020]
      
      It looks that dxf2pcb does not evaluate the angle of this particullar arc. It as the others has to be 360 degrees. If I edit this line in generated PCB file by hand the circle appears in PCB. Is that a bug or did I any mistake in DXF drawing?
      
       
    • Gabriel Denk

      Gabriel Denk - 2016-06-30

      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

      On Jun 29, 2016, at 7:44 PM, Jiří Čejka cejka@users.sf.net wrote:

      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.

      Attachments:

      PCB same line but combined to one long and one short segments.png https://sourceforge.net/p/dxf2pcb/tickets/_discuss/thread/77d089dc/ae79/attachment/PCB%20same%20line%20but%20combined%20to%20one%20long%20and%20one%20short%20segments.png (35.3 kB; image/png)
      DXF red line segments, some of them selected.png https://sourceforge.net/p/dxf2pcb/tickets/_discuss/thread/77d089dc/ae79/attachment/DXF%20red%20line%20segments%2C%20some%20of%20them%20selected.png (22.4 kB; image/png)
      [tickets:#1] https://sourceforge.net/p/dxf2pcb/tickets/1/ Line segments combined after conversion

      Status: open
      Milestone: 1.0
      Created: Thu Jun 30, 2016 12:32 AM UTC by Jiří Čejka
      Last Updated: Thu Jun 30, 2016 12:32 AM UTC
      Owner: Gabriel Denk
      Attachments:

      guides.dxf https://sourceforge.net/p/dxf2pcb/tickets/1/attachment/guides.dxf (54.3 kB; image/vnd.dxf)
      guides.pcb https://sourceforge.net/p/dxf2pcb/tickets/1/attachment/guides.pcb (15.5 kB; application/x-pcb)
      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

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dxf2pcb/tickets/1/ https://sourceforge.net/p/dxf2pcb/tickets/1/
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

       

      Related

      Tickets: #1

  • Gabriel Denk

    Gabriel Denk - 2016-06-30

    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.

     
    • Jiří Čejka

      Jiří Čejka - 2016-06-30

      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!

       
    • Jiří Čejka

      Jiří Čejka - 2016-07-01

      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.

       
  • Gabriel Denk

    Gabriel Denk - 2016-07-06
    • status: open --> closed
     

Log in to post a comment.