← Back to team overview

kicad-developers team mailing list archive

Question about gerber job file numeric format


Hi all,

The Gerber job file specification[1] says that the format follows the JSON
standard, and doesn't say much else about numeric value storage.

But, in the examples in that spec, decimal (floating-point) values are all
truncated with only a few digits after the decimal point.

The manual JSON generation code that exists today follows along these
examples, truncating floating-point numbers using formatting like %.3f and
so on.  Now I'm working on switching us over to using a library for this
JSON generation, but it will output floating-point values as doubles
without any such truncation.

For computer software reading these job files, I would guess this has no
impact.  But for humans opening up the file, they may find that the numbers
stored don't match their expectations.

What should we do about this?
(a) nothing, storing doubles in the file is fine
(b) find some way to manually truncate/round values to some precision, but
still write them to the file as "decimals" -- if so, what should the spec
be for this rounding / truncation?
(c) something else?



Follow ups