Skip to content

Parse Gerber X2 attributes (TF, TA, TO, TD) #362

@rampageservices

Description

@rampageservices

Summary

gerbv currently skips Gerber X2 attributes (%TF%, %TA%, %TO%, %TD%) with a NOTE-level message. These are metadata extensions to RS-274X that don't affect rendering but carry useful information about what features represent.

X2 Attribute Types

  • %TF (File) — file-level metadata: generation date, project name, creator tool, layer function (e.g. copper top, solder mask bottom)
  • %TA (Aperture) — aperture properties: function (via pad, SMD pad, conductor), drill tolerance
  • %TO (Object) — object context: component refdes, pin number, net name
  • %TD (Delete) — clear a previously set attribute

Potential Uses

Parsing these would enable features like:

  • Display component refdes/pin/net on hover or click
  • Automatic layer identification (copper, mask, silk, paste) from %TF.FileFunction
  • Filter or highlight by net name
  • BOM cross-referencing from %TO.C (component) attributes
  • Export netlist or component placement data extracted from Gerber X2 metadata

Current Behavior

Attributes are detected and skipped gracefully — geometry renders correctly since X2 is backwards-compatible with RS-274X. The skip messages are at NOTE level, which is appropriate.

Scope

This would involve:

  1. Data model for attribute state (file attributes are global, aperture/object attributes follow a stack-like set/delete lifecycle)
  2. Parser updates in gerber.c to store rather than skip the attributes
  3. UI to surface the information (tooltips, info panel, layer properties)

Opening for discussion — interested to hear if others would find this useful and what subset of X2 would be most valuable to start with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions