← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Fix to closing polylines in DXF imports

 

Hi Nick,

I just make the opposite diff :)
thanks!
please find attached the right one...

this small attached patch that could improve the DXF
importing understanding...
I add to the DXF import menu the info (R12 fully supported, units mm)
so users will have this info immediately...
[ documentation is not always read by users :) ]
may be it can be useful

On 19/06/2015 08.56, Nick Østergaard wrote:
Hi Maurice

It seems like you made an inverse patch of what you really intend to
do.   A tip is to use bzr diff or git diff in case of the git mirror
to make a patch.

2015-06-18 17:12 GMT+02:00 easyw@xxxxxxxxxxxx <easyw@xxxxxxxxxxxx>:
Hi Marco, Nick and all,

this definitely fix that import problem!

I would suggest to ask committing this patch, and may be also the other
patch that Marco did
https://lists.launchpad.net/kicad-developers/msg18633.html

I also suggest to add the small attached patch that could improve the DXF
importing understanding...
I add to the DXF import menu the info (R12 fully supported, units mm)
so users will have this info immediately...
[ documentation is not always read by users :) ]

thanks again Marco!

Maurice


On 6/18/15 4:52 PM, Nick Østergaard wrote:

I can not try the patch here now, but maybe this can fix the issue
mentioned in this thread:

https://forum.kicad.info/t/gerber-to-footprint/435

DXF file linked in https://forum.kicad.info/t/gerber-to-footprint/435/13


2015-06-18 16:29 GMT+02:00 Marco Hess <marco.hess@xxxxxxxxxxxxxx>:

Following up on recent previous discussions and patches re. DXF import,
here
is a patch that fixes the problem of imported ellipses remaining an open
shape.

The DXF format polylines and lwpolylines have a 'flags' field of which
bit 0
indicates if the polyline/lwpolyline is to be closed or open. This flags
field is correctly read during the import but in the conversion to board
segments, was previously not used.

This patch remembers the start of the polyline and then after processing
all
segments it check bit 0
of the flags field. If the bit is set to 1, an extra closing segment is
generated between the last segment endpoint and the remembered polyline
start point.

Also attached a ellipses DXF in R12 format exported from LibreCAD that I
used to test this patch. It clearly shows the open segment when imported.
With the patch in place the DXF imports correctly shows as a closed
polyline.

Regards,

Marco

--
Marco Hess


_______________________________________________
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


--- menubar_pcbframe-std.cpp	2015-05-19 19:25:00.684999000 +0200
+++ menubar_pcbframe.cpp	2015-06-18 16:58:21.193840900 +0200
@@ -192,7 +192,7 @@
                  KiBitmap( import_xpm ) );

     AddMenuItem( submenuImport, ID_GEN_IMPORT_DXF_FILE,
-                 _( "&DXF File" ),
+                 _( "&DXF File (R12 fully supported, units mm)" ),
                  _( "Import a 2D Drawing DXF file to Pcbnew on the Drawings layer" ),
                  KiBitmap( import_xpm ) );


References