question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Collect board stats when processing gerber collection

See original GitHub issue

(@mcous has taken over this post to elevate comment below):

New package proposal: @tracespace/stats. It think it could have the same signature as pcb-stackup or be included in pcb-stackup by default.

As a user rendering boards, I often to collect other information about the board for manufacturing / quoting purposes. The following pieces of information should be “easy” to collect:

  • Number of layers of a given type
  • Minimum trace width
  • Number of drill hits
  • Drill sizes
  • Board size
  • Number of pads
    • At the moment, hard to distinguish between TH and SM pads

Both @kasbah and myself have received emails about this sort of functionality. Also see #139

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mcouscommented, Jul 31, 2020

@dontpanic there’s been some progress in the sense that the next major version of the tracespace project will be much more geared towards producing inspectable trees at various steps rather than streaming directly into an SVG string:

  1. Abstract syntax tree of each Gerber file
  2. Plot trees for each file <- this is what you’d inspect for stuff
  3. SVG syntax tree

You can try out (1): npm i @tracespace/parser@next. The rest are still in progress. It would, however, be a pretty tall order to glean any information from the syntax tree itself (though it’s certainly possible! At that point, you’re effectively starting work on a plot tree generator…).

For now, you could try to using the existing gerber-to-svg pipeline and hook into the plotter:

const converter = gerberToSvg(copperFileContents)
const plotter = converter.plotter

plotter.on('data', () => {
  // grab tool shapes, pad flashes, and trace strokes here
  // see https://github.com/tracespace/tracespace/blob/main/packages/gerber-plotter/API.md
})

From there, you could “naively” grab:

  • Trace width, by looking at the tool diameter used for stroke plotter objects
    • If your Gerber file uses strokes for copper fills, like Eagle often does, this could be misleading
  • Pad size, by looking at the tool shape + size params for pad plotter objects
    • Sometimes, CAD programs (still looking at Eagle) will use strokes for pads, so again, this is naive

Unfortunately, copper spacing is a much harder problem because it involves building up an actual geometric understanding of the shapes plotted rather than simply recording them

1reaction
ju5tcommented, Oct 14, 2021

@kasbah sorry, you’re right that there isn’t a great API for this yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gerber problem with Board without Schematic - Autodesk ...
I put the new library on my workstation, and updated the schematic with the new library - but board and schematic are still...
Read more >
Custom FAQ - Gerber Gear
Gerber Custom orders take 12-15 business days to create and process. Delivery times will vary depending on your chosen shipping method and location....
Read more >
What Are Gerber Files for Printed Circuit Boards, and Who ...
This net list is used by the printed circuit board or PCB designer in the process of designing the printed circuit board with...
Read more >
PRIVACY POLICY - Gerber Paper
This Privacy Policy provides the Company's policies and procedures of for collecting, using, processing and disclosing your information.
Read more >
Traveling Towards Disease: Transportation Barriers to Health ...
Traveling Towards Disease: Transportation Barriers to Health Care Access. Samina T. Syed, corresponding author Ben S. Gerber, and Lisa K. Sharp ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found