← Back to team overview

kicad-developers team mailing list archive

Re: patch to fix bug in DXF plot

 

----- Original Message -----

> From: Wayne Stambaugh <stambaughw@xxxxxxxxxxx>
> To: kicad-developers@xxxxxxxxxxxxxxxxxxx
> Cc: 
> Sent: Thursday, December 19, 2013 8:52 AM
> Subject: Re: [Kicad-developers] patch to fix bug in DXF plot
> 
> On 12/17/2013 5:03 AM, Cirilo Bernardo wrote:
> 
>>  Hi folks,
>> 
>>   There is a bug in DXF plot which changes the included angle of arcs. To 
> demonstrate the bug:
>> 
>>  1. in the edge cutout layer, create a rectangle with rounded corners and 
> plot the layer to DXF. Since KiCad will write a PCB file with all angles = +90, 
> everything is OK.
>> 
>>  2. Delete the cutout layer and import the DXF. At this point everything 
> should look OK.
>> 
>>  3. Plot the dxf again; this time things go bad because the DXF importer 
> marked some angles as -90 in Step 2.
>> 
>>  4. Import the bad DXF (or view it with MCAD software).
>> 
>>  I have only fixed the bug in BRDITEMS_PLOTTER::PlotDrawSegment and only for 
> DXF plotting. I did not create tests to check if the problem exists with other 
> types of plotting routines (it is possible others are affected, but not 
> necessarily so) and I did not investigate problems with exporting an Arc in 
> BRDITEMS_PLOTTER::Plot_1_EdgeModule.
>> 
>>  Cheers,
>>  Cirilo
> 
> Your patch does not work for the attached board edge cuts layer so I am
> reluctant to commit it.  It may work for your case but it may have
> broken another corner case.  Don't feel bad, the current DXF plot does
> not plot this board correctly either.  I've known about this problem for
> a while but have been too lazy to fix it.  There is some oddness in the
> way the DXF defines arcs that I am not completely familiar with.  If you
> can get the attached board to plot correctly without breaking all of the
> other DXF arc plotting, you'll get a hardy pat on back and your patch
> committed. :)  Also, your editor is leaving trailing white space which
> is a violation of the coding policy.
> 
> What I really would like to see is converting our DXF plotting over to
> use the dxflib that JP recently added to the project.  It seems like a
> much more complete solution which could give us better results in terms
> of layer and color support.  Arcs with width would be nice too.  Maybe
> you could become the guru of DXF plotting.
> 
> Thanks,
> 
> Wayne
> 
> 


Thanks Wayne,  I'll look into it. My suspicion is that in the short term I can come up with something that fixes DXF_plot. Actually writing something with dxflib will take a bit more time; I've got to (re)read the DXF documentation.

- Cirilo


References