Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to extract component footprint to use it in Altium? #210

Open
exander77 opened this issue Apr 15, 2021 · 6 comments
Open

How to extract component footprint to use it in Altium? #210

exander77 opened this issue Apr 15, 2021 · 6 comments

Comments

@exander77
Copy link

I am kind of lost how to extract components or at least their footprint to use them to design PCB, such as Altium.

@piernov
Copy link
Member

piernov commented Apr 15, 2021

It is not possible, OpenBoardView is not designed for this kind of usage, it is only designed to display the boardview files.
Additionally, most boardview files don't embed footprint information, what you see on the screen is just a rendered outline according to the position of the pins and the type of part. Even if the file format embeds footprint information, OpenBoardView cannot use them at this point.

@exander77
Copy link
Author

@piernov I opened a few boards and at connectors, pins and their labels were there. If I were to experiment with the code to see what I can get, would you point to in the right direction codewise?

@swiftgeek
Copy link
Contributor

swiftgeek commented Aug 23, 2022

While there isn't enough data with many formats, I guess SVG/DXF export option should be possible, to provide some aid/guide points. But wouldn't work well for components, more for creating custom daughterboards/modboards.

Could even help with automatically checking for regressions in OBV since SVG could be compared between versions, or hooking up to thumbnailer so boardview files can have thumbnails like videos do

As for connectors you can identify most by measuring pitch and abusing google images, and you will very extremely rarely see completely custom connectors.

@exander77
Copy link
Author

@swiftgeek Anything is better than nothing. Exporting the whole MB outline would be nice as well. I wanted to extract the docking connector for example to make a mini pcb over its pins.

@swiftgeek
Copy link
Contributor

swiftgeek commented Aug 23, 2022

Docking connectors are also possible to identify, with some significant effort (most often they come from reference boards anyway). I guess #kicad or #openboardview irc channel on libera would be better for that?

Wistron Mocha/Caramel/Pecan (ThinkPad X200/X201 series) example:
x200-dock

Bit more modern Thinkpads use JAE WD3M148UQ/Foxconn QL0074L-D28552-4H, and X260 had Tyco 2129525-2 AFAIR

@Michael-Lloyd
Copy link

Michael-Lloyd commented Oct 3, 2022

I think people shouldn't be too quick to state that it is not possible, the standard BRD file format is parsable, this repo contains a program that does exactly that -- but not for the purpose that you intend.

I have successfully parsed the BRD file grammar for use with KiCAD schematics, but KiCAD 6 uses s-expressions that are easy to generate (I used Haskell).

Your request for a footprint is strange, because footprints are often standardized (to a T), all you need to know is what the component is, and if there are multiple revisions or variants, that too. Then just download the footprint from your EDA software common library. More general to your question though, regarding BRD to EDA:

To make the files useful, depending on the specific format, you need to implement a parser that produces at a minimum:

  • Symbols
  • Placement of symbols in schematic files (And, for this to be readable in any way, you can't dump them all at coordinate (0,0), you need to use a graphical network arrangement algorithm)
  • Footprints (Non-trivial for production use-cases, but for review purposes, the BRD file tells you exactly what the pins are and where they are placed, this can be trivial if you can generate an output in the correct grammar)
  • Placement of footprints in a PCB layout design file
  • Linking of reference designators and pin nets between both the schematic and the layout file

For example, a "PART" expression may look something like:

The part in OPV's GUI:
U2

// ... 
name p1.x    p1.y    p2.x    p2.y   end_of_pins part_type side
U2   11585   5822    11817   6054    32         1         2
// ...

And, in the implementation:

// ...
case 3: { // PARTS
            ENSURE(parts.size() < num_parts, error_msg);
            BRDPart part;

            part.name        = READ_STR();
            part.p1.x        = READ_INT();
            part.p1.y        = READ_INT();
            part.p2.x        = READ_INT();
            part.p2.y        = READ_INT();
            part.end_of_pins = READ_UINT(); // Warning: not end but beginning in this format
            part.part_type   = BRDPartType::SMD;
            int side         = READ_UINT();
            if (side == 1)
                part.mounting_side = BRDPartMountingSide::Top; // SMD part on top
            else if (side == 2)
                part.mounting_side = BRDPartMountingSide::Bottom; // SMD part on bottom

            parts.push_back(part);
        } break;
// ...

So, from this we can infer:

  • The part is U2,
  • it represents the rectangle {{11585,5822},{11817,6054}},
  • Pins can be found starting at index 32 (Read the implementation, it is not the count), of type 1 (Assigned to SMD automatically, BRDFileBase.h),
  • on the bottom of the PCB.

Thankfully, in KiCAD, so long as you can generate the PCB layout file correctly, it can produce a terse and unfriendly schematic, which you can then clean up yourself.

From memory, there are KiCAD to Altium exporters and importers (as well as the reverse). It is achievable.

To echo the original reply though, you should be aware that this is not something you can just go and use to get a PCB printed. You will need to clean a lot of things up.

Some useful parts of openboardview to review:
BRD File parsing implementation (BRDFile.cpp)
BRD2 File parsing implementation (BRD2File.cpp), commonly .brd files ard BRD2 Formats

Additional note:
Openboardview generates and SQL database that contains all of the board information, instead of parsing the raw BRD files, you could also just some database access methods and go from there (Honestly, the easier approach).

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

No branches or pull requests

4 participants