← Back to team overview

kicad-developers team mailing list archive

Re: Plotting/fabricating in nanometers

 

Le 28/04/2012 08:08, Lorenzo Marcantonio a écrit :
On Fri, Apr 27, 2012 at 09:14:45PM +0200, jean-pierre charras wrote:
Thanks for your patch.
Postscript and Gerber work fine.

I did some light testing on HPGL but I'm pretty confident stuff didn't broke...

There is an issue with DXF:
tracks are lines and some shapes look ugly.
Are you volunteer to fix it?

Please elaborate on this... I did tracks as lines because polylines with width in DXF are strictly butt-ended (not rounded). We *could* approximate it with SOLID and DONUT but these are really rarely used primitives and I doubt that they'll be imported by something different than acad...

Anyway tell your suggestions and I'll see what can be done. Another interesting thing to do would be exporting text as text (as an option) instead of segments and make use of layers: for example a silk plot with references and values on another layer would be wonderful for assembly diagrams (taken to an extreme: export components as block instances with attributes and you'll have the pick and place and bom directly from autocad...).


Lorenzo,

In fact, I found what happens.
If DXF coordinates are in decimils, the plot is OK.
If DXF coordinates are in mm, the plot is bad.

The reason is device coordinates are integer values,
and the positions are truncated to the near mm
for instance in DXF_PLOTTER::pen_to(), we have:

    user_to_device_coordinates( pos );

    if( pen_lastpos != pos && plume == 'D' )
    {
        /* DXF LINE */
        wxString cname = ColorRefs[current_color].m_Name;
        fprintf( output_file, "0\nLINE\n8\n%s\n10\n%d.0\n20\n%d.0\n11\n%d.0\n21\n%d.0\n",
                 TO_UTF8( cname ),
                 pen_lastpos.x, pen_lastpos.y, pos.x, pos.y );
    }
therefore
 pos.x is an integer coordinate in mm.

My suggestion is: use mm in file, and use double for device coordinates,
and angles because in plot arc, the arc value is also truncated.

Thanks.


I'm open to suggestion (also I'm somewhat surprised that someone else actually use the dxf exporterXD)

There are some other users...


--
Jean-Pierre CHARRAS



Follow ups

References