← Back to team overview

kicad-developers team mailing list archive

Re: patch to fix bug in DXF plot

 




----- Original Message -----
> From: jp charras <jp.charras@xxxxxxxxxx>
> To: kicad-developers@xxxxxxxxxxxxxxxxxxx
> Cc: 
> Sent: Thursday, December 19, 2013 7:09 PM
> Subject: Re: [Kicad-developers] patch to fix bug in DXF plot
> 
> Le 18/12/2013 22:52, Wayne Stambaugh a écrit :
>>  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
> 
> Can you try this very basic patch ?
> 
> Thanks.
> 
> 
> -- 
> Jean-Pierre CHARRAS
> 
> 



Yes, that works on all the test cases I have and it's much better than what I proposed. I got trapped in my thinking that I needed to know the included angle, which isn't true.

- Cirilo



References