translate2geda icon indicating copy to clipboard operation
translate2geda copied to clipboard

Gerber Circular Interpolation not handled correctly

Open ldoolitt opened this issue 5 years ago • 1 comments

I have a Gerber file that originated in PADS. I can run it through translate2geda and read the resulting .fp file with pcb-rnd freshly built from subversion (2020-02-01, r29589). The straight lines look perfect, the arcs are definitely not.

One such case: G01X235154Y850183D02* G03X235154I-2061J0D01*

pretty clear circle according to Gerber spec:

  • G01 linear interp
  • X Y coordinates
  • D02 move
  • G03 circular counterclockwise
  • X coordinate, same as before
  • I center offset
  • D01 draw

Note that the Gerber spec is clear about the possible ambiguity of 0 vs. 360 degrees. In Multi quadrant (G75) mode, "If the start point of the arc is equal to the end point, the arc is a full circle of 360deg". And yes, this Gerber file sets G75.

The output from translate2geda seems to be four flashed apertures scattered around the circumference.

ldoolitt avatar Feb 02 '20 17:02 ldoolitt

I will need to ponder lines 1707 to 1776 in Plotter.java some more.

The code I repurposed for this is a bit opaque.

If you have a test file, with examples of right and wrong parsing, it would help.

erichVK5 avatar Apr 21 '22 09:04 erichVK5