← Back to team overview

kicad-developers team mailing list archive

Re: DXF import in pcbnew: asking for feature Ellipse entity

 

Hi Maurice,

That not closing of ellipse shapes seems to quite common. I have seen it in various CAD packages.

The code in my patch is after the DXF is already imported and traces the line segments to find the board shape. It currently requires 0.05mm to close the shape. This value was derived from DXF that I imported from FreeCAD that uses 0.05mm line lengths. I guess it could be made adjustable/configurable to allows different DXF files. If it becomes to big it might start to 'close' more than intended with other nearby line segments.

But even with the 0.05mm line length from FreeCAD, you can still see the gap when you know here to look and zoom in close enough. Not sure if LibreCAD can be configured to generate smaller segments lengths.

I also had a look at the DXF inporter to see where we can 'close' ellipsis gaps as part of the import, but as the importer is only seeing basic line segments, it has no sense of seeing an ellipsis. I am not familiar with the DXF format enough or the DXF import code to know if there is a way to 'trigger' on the fact that we are about to import a set of ellipsis line segments and that an additional segments needs to be generated to 'close'. I have seem some CAD packages that have a 'close' option in the import, but I have no idea as to how they do that. If somebody more familiar with DXF can give some pointers, I am happy to have a look.

So in summary:

* We can relax the board outline tracing gap requirements a bit. The board will render OK, but the gap remains visible on the board outline. So this is not really the 'right' solution.

* Somehow make the DXF importer 'close' gaps in ellipses. Give that we are just importing line segments, I am not sure of the algorithm on how to do this.

* In the worst case you can import a DXF, look where the gap is in pcbnew and then edit the PCB file and find the two end and create a new line segment that closes the ellipses?

Regards,

Marco

On 18-Jun-15 20:07, easyw@xxxxxxxxxxxx wrote:
Hi Marco!

that's great I can import the pcb-shape correctly and also it is closed in 3d-viewer! :)

I also tried with your patch and everything went fine.

Just to complete the 'circle' I tried a generic ellipse generate from librecad in R12, but importing it the shape has a little line missing and in 3d-viewer will not became closed...

could you please try it and see if it is patchable to import correctly the ellipse (dxf r12)?

That will improve the import DXF in pcbnew and may be it could be inserted in the stable release...
thank you for your great work!

Maurice


On 6/18/15 3:02 AM, Marco Hess wrote:
Hi Maurice,

If in LibreCAD you take your file and then do a 'Save As' in 'DXF R12'
Format (in the Save As dialog at the bottom "Save as type", it forces
LibreCAD to save in a older DXF format that does not support ellipses
and converts them to line segments.

The resulting file then imports fine in pcbnew and with the recent patch
that I submitted also shows up correctly in the 3D view as per the
attached images.

This just needs some documentation I guess that pcbnew supports R12
format DXF and how to generate that with say LibreCAD.

Regards,

Marco

On 18-Jun-15 07:57, easyw wrote:
Hi,
I'd like to know if it would be possible to add Ellipse support in DXF
import function in pcbnew...

I tried to import a pcb board shape from a DWG file:
http://www.tekoenclosures.com/multimedia/manuali/dwg/MOK1.dwg
then I exported the DWG to DXF ASCII 2013 with TeighaFileConverter (as
suggested by FreeCAD)
(TeighaFileConverter is free and available in win, Linux and OSX)
MOK1.dwg -> MOK1-ASCII-DXF-2013.dxf
I opened the file in Librecad and isolate the only pcb shape...
then I obtained the MOK1-ASCII-DXF-2013-PCB-only.dxf attached
Then I imported the shape in pcbnew and the curved parts of the shape
were missing...
I opened the dxf in FreeCAD and I noticed that they are Ellipse
entities...

referring to this post:
http://www.mail-archive.com/kicad-developers%40lists.launchpad.net/msg06714.html

only lines, arcs, circles and texts are imported ...
I think it would be a nice feature to add also Ellipse to the importer
(this entity is quite common in shapes) ...
Obviously only if this could be compatible with the rest of the pcb
structure

thank you
Maurice


_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


--
Marco Hess
Through IP Pty. Ltd. - AUSTRALIA
www.through-ip.com  | marco.hess@xxxxxxxxxxxxxx
p: +61 407 78 55 66 | f: +61 8 8121 6191



References