Author Topic: How is a PCB represented internally in CAD?  (Read 1395 times)

0 Members and 1 Guest are viewing this topic.

Offline Alex EisenhutTopic starter

  • Super Contributor
  • ***
  • Posts: 3728
  • Country: ca
  • Place text here.
How is a PCB represented internally in CAD?
« on: August 07, 2024, 09:22:34 pm »
I'm not a programmer, and therefore missing many fundamental notions I guess. So my question is very broad.

Ignoring the schematic, how exactly is a PCB stored in memory? Is it just the netlist with all the traces added as I route? (Also let's ignore undo/redo.)

Is it a linked list somehow for each node?
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline selcuk

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: tr
Re: How is a PCB represented internally in CAD?
« Reply #1 on: August 07, 2024, 10:36:32 pm »
I think it heavily depends on the CAD tool. Apart from the closed source ones, this one is a documentation about KiCAD PCB file format. It has some sort of vector graphics and includes the footprint definitions as well. For example start and stop coordinates, width and layer of each track are saved as a single block (line) on the file.

https://dev-docs.kicad.org/en/file-formats/sexpr-pcb/
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 9824
  • Country: nl
  • Current job: ATEX product design
Re: How is a PCB represented internally in CAD?
« Reply #2 on: August 08, 2024, 01:04:27 pm »
If you have Altium, and you open the PCB list tab, it will show something like this:
Thousands of objects, different types, with over a hundred different parameters. Pads, Text, Fill, Poly, Component body, 3D object, Via, even rule violations.
Example of few objects with only the first few parameters.
Pad      Top Layer      GND   C10   62.8   3.5
Pad      Top Layer      GND   C11   89.25   11.5
Pad      Top Layer      GND   C12   80.6   17.2
Pad      Top Layer      GND   C13   97.75   6

 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 15947
  • Country: ch
Re: How is a PCB represented internally in CAD?
« Reply #3 on: August 08, 2024, 01:49:24 pm »
I'm not a programmer, and therefore missing many fundamental notions I guess. So my question is very broad.

Ignoring the schematic, how exactly is a PCB stored in memory? Is it just the netlist with all the traces added as I route? (Also let's ignore undo/redo.)

Is it a linked list somehow for each node?
What makes you think the object model is the same for each EDA program? Each one will have its own. And the same object model could be represented in memory many different ways, I assume. (I’m also not a programmer, but did work in the software industry for a while.)
 
The following users thanked this post: gerber

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30237
  • Country: nl
    • NCT Developments
Re: How is a PCB represented internally in CAD?
« Reply #4 on: August 08, 2024, 03:22:21 pm »
I'm not a programmer, and therefore missing many fundamental notions I guess. So my question is very broad.

Ignoring the schematic, how exactly is a PCB stored in memory? Is it just the netlist with all the traces added as I route? (Also let's ignore undo/redo.)

Is it a linked list somehow for each node?
There are basically two approaches:
1) Traces, polygons, vias have a fixed association with to a net which either gets specified by setting a property or inherited from the items they originate from.
2) Traces, polygons, vias are bound to a net dynamically. Whatever component pad an item ultimately connects to, that will be the connected net.

From there you can have several approaches towards storing items that make up a PCB design. I'm under the impression most CAD programs use an in-memory database to store the items. Probably with some relational links between the items themselves and a variable number of properties in order to optimise memory use and speed.

Netlist checks are typically seperate processes with some crude realtime implementation in order not to slow the software down too much.
« Last Edit: August 08, 2024, 03:24:55 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->