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

Support for padstacks (from kicad nightly) #471

Open
arturo182 opened this issue Oct 12, 2024 · 13 comments
Open

Support for padstacks (from kicad nightly) #471

arturo182 opened this issue Oct 12, 2024 · 13 comments

Comments

@arturo182
Copy link

KiCad Version: 8.99.0-2584-g661ed81e6f, release build
Plugin: latest master (5915a24)

Traceback (most recent call last):

  File "E:\Documents\KiCad\8.99\3rdparty\plugins\org_openscopeproject_InteractiveHtmlBom\ecad\kicad.py", line 864, in Run
    ibom.run_with_dialog(parser, config, logger)

  File "E:\Documents\KiCad\8.99\3rdparty\plugins\org_openscopeproject_InteractiveHtmlBom\core\ibom.py", line 363, in run_with_dialog
    main(parser, config, logger)

  File "E:\Documents\KiCad\8.99\3rdparty\plugins\org_openscopeproject_InteractiveHtmlBom\core\ibom.py", line 327, in main
    pcbdata, components = parser.parse()
                          ^^^^^^^^^^^^^^

  File "E:\Documents\KiCad\8.99\3rdparty\plugins\org_openscopeproject_InteractiveHtmlBom\ecad\kicad.py", line 781, in parse
    "footprints": self.parse_footprints(),
                  ^^^^^^^^^^^^^^^^^^^^^^^

  File "E:\Documents\KiCad\8.99\3rdparty\plugins\org_openscopeproject_InteractiveHtmlBom\ecad\kicad.py", line 564, in parse_footprints
    pad_dict = self.parse_pad(p)
               ^^^^^^^^^^^^^^^^^

  File "E:\Documents\KiCad\8.99\3rdparty\plugins\org_openscopeproject_InteractiveHtmlBom\ecad\kicad.py", line 490, in parse_pad
    pad_dict["radius"] = pad.GetRoundRectCornerRadius() * 1e-6
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: PAD.GetRoundRectCornerRadius() missing 1 required positional argument: 'aLayer'

Fixed locally by changing:

--- a/ecad/kicad.py
+++ b/ecad/kicad.py
@@ -487,7 +487,7 @@ class PcbnewParser(EcadParser):
             ]]

         if shape in ["roundrect", "chamfrect"]:
-            pad_dict["radius"] = pad.GetRoundRectCornerRadius() * 1e-6
+            pad_dict["radius"] = pad.GetRoundRectCornerRadius(layers_set[0]) * 1e-6
         if shape == "chamfrect":
             pad_dict["chamfpos"] = pad.GetChamferPositions()
             pad_dict["chamfratio"] = pad.GetChamferRectRatio()

But not sure if that's the right way to do it.

@qu1ck
Copy link
Member

qu1ck commented Oct 12, 2024

It's a decent workaround for now but proper fix needs padstack support. But kicad's own implementation is not yet complete so I'll wait on this.

@Bowlsnapper
Copy link

Bowlsnapper commented Oct 12, 2024

Yeah, I have the same issue. Definitely a bummer, but I hope a fix can be found! :)
I tried the above fix with no result, unfortunately.

@qu1ck
Copy link
Member

qu1ck commented Oct 12, 2024

You need to reload kicad after you change the plugin (or do plugin refresh from the pcbnew menu). If you still have an issue it should not be exact same one, show me your error message.

@Bowlsnapper
Copy link

Bowlsnapper commented Oct 13, 2024

htmlbomerror

Coulda sworn I changed the py file correctly...

@qu1ck
Copy link
Member

qu1ck commented Oct 13, 2024

I suspect your nightly is old, I fixed that on kicad side a while ago.

@Bowlsnapper
Copy link

Hmmm, lemmie update and see.

@Bowlsnapper
Copy link

Yes, you are correct. Installing the latest nightly fixed the issue. You are a god. I love your work.

@qu1ck qu1ck changed the title Another nightly error Support for padstacks (from kicad nightly) Oct 14, 2024
@robomechs
Copy link

for me it didn't help.
Application: KiCad x64 on x64
Version: 8.99.0-2659-gf7f86174a0, release build
Screenshot

@qu1ck
Copy link
Member

qu1ck commented Oct 14, 2024

You either did not apply the modification correctly or did not reload the plugin or restart kicad. Your screenshot shows current code, not modified one.

@robomechs
Copy link

Seems like I didn't apply modification correctly, becayse I installed last KiCad version and reload the computer just in case.

@robomechs
Copy link

robomechs commented Oct 14, 2024

from box (from plugin manager) I've got this error:
image
after that I download last ibom from github and put it instead of the one from "box", reload KiCad, and
Screenshot

@qu1ck
Copy link
Member

qu1ck commented Oct 14, 2024

Yeah and to fix that last error you need to change the code like the first post shows.
Change this line in kicad.py
pad_dict["radius"] = pad.GetRoundRectCornerRadius() * 1e-6
to
pad_dict["radius"] = pad.GetRoundRectCornerRadius(layers_set[0]) * 1e-6

@robomechs
Copy link

Yeah and to fix that last error you need to change the code like the first post shows. Change this line in kicad.py pad_dict["radius"] = pad.GetRoundRectCornerRadius() * 1e-6 to pad_dict["radius"] = pad.GetRoundRectCornerRadius(layers_set[0]) * 1e-6

Ahaha, I'm sorry, I was inattentive.
Now this great tool works properly. Thank you!

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