Skip to content

Classify Eagle, OrCAD/Allegro, EasyEDA and Protel filenames - #471

Open
Cimos wants to merge 2 commits into
mainfrom
cimos-eda-filename-schemes-426
Open

Cimos wants to merge 2 commits into
mainfrom
cimos-eda-filename-schemes-426

Conversation

@Cimos

@Cimos Cimos commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Fixes #426

IN-6 now covers the default output names of more EDA tools. The new classifier pass (other_eda_scheme in etchy-core/src/naming.rs) runs before the stem heuristics. It only matches extensions and stems that the tools document as defaults.

Scheme Names added
Eagle legacy CAM .cmp .sol .stc .sts .plc .pls .crc .crs
Eagle 9 templates copper_top[_l1], copper_inner_l<n> (physical position → ordinal), copper_bottom[_l<n>], soldermask_*, solderpaste_*, silkscreen_*, profile.gbr
OrCAD Layout .top .bot .smt .smb .sst .ssb, .ast → documentation
Allegro TOP.art, BOTTOM.art, SOLDERMASK_*, SILKSCREEN_*, PASTEMASK_*; DRILL.art → documentation (previously read as the drill layer)
EasyEDA Gerber_InnerLayer<n> (any ext, incl. plane .GP<n>), .GTA/.GBA → documentation
Protel same extensions as Altium; pinned by its own corpus list, no new rules

These names stay Other on purpose, and the tests pin that: .drd (Eagle Excellon vs OrCAD drill drawing; content sniff still loads Excellon as drill), plane .gp<n> without the EasyEDA stem, Eagle .ly<n>, OrCAD .gnd/.pwr/.fab, Allegro user-named inner films, malformed copper_inner_l1.

Tests

  • corpus/naming/<scheme>.txt lists <filename> => <kind> with source citations. tests/naming_corpus.rs checks every file.
  • The altium.txt and kicad.txt baselines passed against the code before this change, so the existing classifications are unchanged.
  • Per-scheme unit tests are in naming.rs.
  • cargo fmt, clippy -D warnings, and cargo test --workspace --exclude etchy-gui all pass.

Docs: IN-6 is marked ✅, plus a CHANGELOG [Unreleased] entry and a note in corpus/README.md.

Add default output names for Eagle (legacy CAM and Eagle 9 templates), OrCAD Layout, Allegro artwork and EasyEDA to the filename classifier. Protel shares Altium's extensions and is pinned by its own corpus list. Ambiguous names (.drd, plane .gp<n>, Eagle .ly<n>, OrCAD .gnd/.pwr/.fab) stay Other. Per-scheme corpus lists live under corpus/naming/ and are checked by tests/naming_corpus.rs; the Altium and KiCad baselines are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 10:43
Review finding: Gerber_InnerLayer<n> was trusted with any extension. Now only .G<n>/.GP<n> with the same number classify as inner copper; anything else stays Other.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Layer detection still misclassifies files because the new scheme pass follows conflicting inner-copper heuristics and the DRILL substring check matches board-name prefixes, breaking rename-tolerant pairing.

2 open issues
What changed in this PR

Extends etchy’s shared filename classifier with additional EDA output schemes, supporting layer identification and cross-scheme pairing for IN-6.

Changes:

  • Adds Eagle, OrCAD Layout, Allegro and EasyEDA naming rules, including documentation classification for DRILL.art.
  • Adds per-scheme corpus tests, with Altium/KiCad baselines and Protel compatibility cases.
  • Updates requirements, corpus documentation and release notes.
File Description
docs/​REQUIREMENTS.md Marks IN-6 complete and documents supported schemes.
crates/​etchy-core/​tests/​naming_corpus.rs Checks expected classifications across all corpus lists.
crates/​etchy-core/​src/​naming.rs Adds scheme-specific classification rules and unit tests.
corpus/​README.md Links to the filename-classification corpus.
corpus/​naming/​README.md Explains corpus format and ambiguous-name handling.
corpus/​naming/​protel.txt Pins Protel’s shared Altium extension mappings.
corpus/​naming/​orcad-allegro.txt Covers OrCAD and Allegro default names.
corpus/​naming/​kicad.txt Records existing KiCad classifications.
corpus/​naming/​easyeda.txt Covers EasyEDA layer and drawing names.
corpus/​naming/​eagle.txt Covers legacy CAM and Eagle 9 names.
corpus/​naming/​altium.txt Records existing Altium classifications.
CHANGELOG.md Announces expanded naming support and drill-film reclassification.

Review effort: Balanced

Comment on lines +60 to +62
if let Some(kind) = other_eda_scheme(&s, &e) {
return kind;
}
return None;
}
// Allegro's drill / ident film is a drawing, not the NC drill.
if e == "art" && s.contains("DRILL") {
Copilot AI balanced review requested due to automatic review settings November 6, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Layer-classification precedence and overly broad stem matching misclassify exports and accept conflicting copper-layer identifiers, breaking cross-scheme pairing and mask-layer gating.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Validate EasyEDA stem before generic numeric extensions

crates/​etchy-core/​src/​naming.rs:135

The extension-agreement check is bypassed for .G<n>: classify("Gerber_InnerLayer2", "G3") returns InnerCopper(3) through the earlier generic extension branch, while the equivalent .GP3 mismatch returns Other. This can pair a conflicting EasyEDA export with the wrong copper layer. Validate recognized EasyEDA stems before the generic numeric-extension branch, explicitly return Other on disagreement, and add a mismatched .G3 regression case.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classify Eagle, OrCAD/Allegro, EasyEDA and Protel filenames

2 participants