juulsA / exportJson

Skill script for Allegro PCB designer, which generates a JSON representation of the board.
MIT License
17 stars 8 forks source link

Customizable output layer mapping #12

Closed karlsonrwa closed 4 months ago

karlsonrwa commented 11 months ago

Hello @juulsA !

Is it possible to process and output to json not only lines but also shapes that are drawn at silkscreen layers?

Is it possible to include BOARD GEOMETRY/SILKSCREEN_TOP BOARD GEOMETRY/SILKSCREEN_BOTTOM to export?

juulsA commented 11 months ago

Hi, it's possible, but I'm not aware that the ibom does support it ...

karlsonrwa commented 11 months ago

Hi, it's possible, but I'm not aware that the ibom does support it ...

It supports shapes, you can see it at https://openscopeproject.org/InteractiveHtmlBomDemo/html/hp34401a_oled.html and https://github.com/openscopeproject/HP34401a-OLED-HW

OSHW logo is a polygon.

juulsA commented 11 months ago

I had to think about it for a moment ... I think this should work ... but I thought about another thing ... maybe it would be nice if we had a config file or something similar to determine which layer is mapped to the possible output layers?! What do you think?

karlsonrwa commented 11 months ago

maybe it would be nice if we had a config file or something similar to determine which layer is mapped to the possible output layers?! What do you think?

It would be great to have such file. It is more convenient to determine which layer to include into export because different users can have different inhouse rules and they may have their custom layers.

juulsA commented 11 months ago

It would be great to have such file. It is more convenient to determine which layer to include into export because different users can have different inhouse rules and they may have their custom layers.

Yes, that's what I thought! I'm sorry to say that you'll have to be patient again ... This will be a lot more work, but I think it'll be worth it.

juulsA commented 11 months ago

This could be a possible config file: any desired layer could be added (or removed). Do you miss something?

{
    "silkscreen": {
        "F": [
            "Board Geometry/Silkscreen_Top",
            "Package Geometry/Silkscreen_Top"
        ],
        "B": [
            "Board Geometry/Silkscreen_Bottom",
            "Package Geometry/Silkscreen_Bottom"
        ]
    },
    "fabrication": {
        "F": [
            "Board Geometry/Assembly_Top",
            "Package Geometry/Assembly_Top"
        ],
        "B": [
            "Board Geometry/Assembly_Bottom",
            "Package Geometry/Assembly_Bottom"
        ]
    },
    "settings": {
        "exportInnerLayer": "nil",
        "renderViaHoles": "nil",
        "textAsSvgPaths": "t",
        "excludeDNP": "nil",
        "pcbLineWidth": 0.1,
        "fabricationLayerLineWidth": 0.1,
        "marginTop": 10,
        "marginRight": 10,
        "marginBottom": 10,
        "marginLeft": 10
    }
}
karlsonrwa commented 11 months ago

This could be a possible config file: any desired layer could be added (or removed). Do you miss something?

I think layers should include by default Ref Des / Silkscreen_Top Ref Des / Silkscreen_Bottom.

Regarding settings. Is it possible to render non-plated holes also? As I see now they are not shown at all and it looks not as good as it could be.

juulsA commented 11 months ago

You're right, I was thinking more about the structure. Are you referring to the example? Usually non-plated holes are included, and my designs they are, but these holes have to belong to a symbol or be a symbol.

karlsonrwa commented 11 months ago

Are you referring to the example? Usually non-plated holes are included, and my designs they are, but these holes have to belong to a symbol or be a symbol.

image

image

image

juulsA commented 11 months ago

Yes, that's what I meant ... sorry, of course these are symbols, but they have no refdes, and therefore they are not exported.

karlsonrwa commented 11 months ago

Yes, that's what I meant ... sorry, of course these are symbols, but they have no refdes, and therefore they are not exported.

image

image

I added a non-plated hole from my library. Should it be present at the netlist?

I have a design with a non-plated hole which has a pad inside drilling, so it is not a mechanical part but it is an actual electrical symbol. It has a no connect property at the netlist. And this hole is not exported. Can't provide you the actual brd, sorry.

juulsA commented 11 months ago

I have a design with a non-plated hole which has a pad inside drilling, so it is not a mechanical part but it is an actual electrical symbol. It has a no connect property at the netlist. And this hole is not exported. Can't provide you the actual brd, sorry.

Did you added it from the pcb editor otherwise it is not working. You have to add the Symbol in your schematic and then sync it to your pcb ... I don't know if there is another way ?! The netlist is not evaluated (by my script).

juulsA commented 9 months ago

You could have a look at this branch; I'm not sure, if it's fully working ... but for me it does.

Please take a look at this, I hope this explains how to use the config file.