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

Problem parsing $SHAPES section when opening a GenCAD file #298

Open
cyrozap opened this issue Feb 17, 2024 · 3 comments
Open

Problem parsing $SHAPES section when opening a GenCAD file #298

cyrozap opened this issue Feb 17, 2024 · 3 comments

Comments

@cyrozap
Copy link

cyrozap commented Feb 17, 2024

I get the following error when I try to open a certain .cad file:

Failed to parse GenCAD file: the $SHAPES section was not parsed properly

The file in question can be found here:
ASUS TUF GAMING B650-PLUS WIFI 1.04 BoardView File.zip

OpenBoardView version is latest from git (8528b80).

@swiftgeek
Copy link
Contributor

swiftgeek commented Feb 18, 2024

That file is crashing CAMCAD (4.14.312.6), so something went horribly wrong there

Removing contents of $SHAPES, naming unnamed signal WTF and adding missing sections makes it parse in my build of OBV (it's quite a bit behind), so I suspect some crazy thing to be contained in that section alone.

In $SHAPES section we can see that every pin is referring to bogus padstack XXX
INSERT SMD appears before instead of after shape.

So when instead of removing $SHAPES contents, I moved starting INSERT SMD to end of that section and inserted XXX padstack definition (copying first one with no changes but name) I got working (in OBV) GenCAD file.

2024-02-18_10-34

Original file is so corrupt/mangled it cannot be used even to create stencils for chips.
I don't believe that CAMCAD could provide such botched $SHAPES section, so I would guess it also went through some another tool to create such result.

@OpenBoardView OpenBoardView deleted a comment from Elextrixman Feb 19, 2024
@OpenBoardView OpenBoardView deleted a comment from Elextrixman Feb 19, 2024
@OpenBoardView OpenBoardView deleted a comment from Elextrixman Feb 19, 2024
@piernov
Copy link
Member

piernov commented Feb 26, 2024

Similar issue with this one where the $SHAPES section does not start with SHAPE but instead INSERT. Not sure what to do here, seems like a bogus file but if there's a tool that actually produces these maybe we should try to take it into account (but that's a pain).
Asus_X1403ZA_BV.zip

@swiftgeek
Copy link
Contributor

swiftgeek commented Feb 27, 2024

I think a conversion/repair script would be more feasible here, since those files are so deeply broken (and thus most of the contents those files can be discarded since it cannot be correlated back). A script would also give opportunity to the end user to use dummy padstack that is most suitable for the board (basically smallest pad size on board - which would be different on mobile devices if asus still makes those)

Since GenCAD is a standard widely used in industry, it wouldn't be so great to taint the interpreter in OBV, which would definitely impact its maintainability in the future.

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

3 participants