Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Gerber X2 %TF, %TA etc. attributes dropped during pcb-tools round-trip #178

Open
jaseg opened this issue Oct 20, 2020 · 0 comments
Open

Comments

@jaseg
Copy link
Contributor

jaseg commented Oct 20, 2020

Hi,

when reading a gerber file with pcb-tools, then re-exporting to gerber all Gerber X2 attributes (%TF, %TA etc.) get dropped. It should probably either raise a warning when reading Gerber X2 attributes that it cannot parse or correctly preserve them.

Reproduction

test.py:

#!/usr/bin/env python3
import gerber
from gerber.render import rs274x_backend
import sys

target = gerber.loads(sys.stdin.read())
ctx = rs274x_backend.Rs274xContext(target.settings)
target.render(ctx)
print(ctx.dump().getvalue())

test.gbr:

%TF.GenerationSoftware,KiCad,Pcbnew,(5.99.0-4013-gfd874d834)*%
%TF.CreationDate,2020-10-20T12:10:51+02:00*%
%TF.ProjectId,pcbway_gerbolyze_demo_tests,70636277-6179-45f6-9765-72626f6c797a,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Copper,L2,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.99.0-4013-gfd874d834)) date 2020-10-20 12:10:51*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

output

~/t/gerbolyze <3 cat test.gbr | python3 test.py
%FSLAX46Y46*%
%MOMM*%
M02*
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant