← Back to team overview

kicad-developers team mailing list archive

Re: patch to fix bug in DXF plot

 

On 12/19/2013 3:09 AM, jp charras wrote:
> 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.
> 

JP,

I just tested your latest commits and it solved the problem.  I also
check some other boards with arcs and they also plot correctly so it
appears that you fix resolves the DXF arc plotting issue.  Hopefully
there are no other corner cases.  Now if we could only get the arcs with
thickness issue resolved. :)  Thank you and JP and Cirilo for fixing this.

Wayne




References