Coder Social home page Coder Social logo

yaqwsx / pinion Goto Github PK

View Code? Open in Web Editor NEW
416.0 10.0 19.0 8.28 MB

Generate interactive and nice-looking diagrams for your PCBs!

Home Page: https://yaqwsx.github.io/Pinion/

License: MIT License

JavaScript 20.30% HTML 1.05% CSS 0.76% Python 76.77% Makefile 0.30% Shell 0.82%
kicad pcb eda

pinion's Introduction

Pinion — Nice-looking interactive diagrams for KiCAD PCBs

Pinion is a simple tool that allows you to make a nice-looking pinout diagrams for your PCBs like this:

Screenshot

Live demo

The diagrams are static HTML & Javascript files that you can easily include in your documentation. You do not need any backend, so you can easily serve them on your web page or Github pages. It is really simple!

Documentation

The documentation is available at https://yaqwsx.github.io/Pinion.

Do you enjoy Pinion or does it save your time?

Then definitely consider supporting me on GitHub Sponsors or buy me a coffee:

ko-fi

Your support will allow me to allocate time to properly maintain my projects like this.

PS: Be sure to check out my other KiCAD & PCB related projects:

Pinion is broken. What can I do about it?

If something is not working as expected, please open an issue on GitHub. Please, provide as many resources as possible and clear instructions on reproduction of the bug.

If you have a proposal for a new feature or you are just unsure about Pinion usage, you can start a discussion on GitHub.

pinion's People

Contributors

dzarda avatar yaqwsx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinion's Issues

ruamel_yaml error

Hi,
The following command:

pinion generate -b sample.kicad_pcb ./

fails with error:

File "_ruamel_yaml.pyx", line 302, in _ruamel_yaml.CParser.__init__
TypeError: a string or stream input is required

Traceback:

Traceback (most recent call last):
File "/home/test/envs/pinion/bin/pinion", line 8, in <module>
sys.exit(cli())
File "/home/test/envs/pinion/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/test/envs/pinion/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/test/envs/pinion/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/test/envs/pinion/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/test/envs/pinion/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/test/envs/pinion/lib/python3.9/site-packages/pinion/ui.py", line 83, in generate
generate(specification=yaml.load(specification),
File "/home/test/envs/pinion/lib/python3.9/site-packages/ruamel/yaml/main.py", line 432, in load
constructor, parser = self.get_constructor_parser(stream)
File "/home/test/envs/pinion/lib/python3.9/site-packages/ruamel/yaml/main.py", line 514, in get_constructor_parser
loader = XLoader(stream)
File "/home/test/envs/pinion/lib/python3.9/site-packages/ruamel/yaml/main.py", line 507, in __init__
CParser.__init__(selfx, stream)
File "_ruamel_yaml.pyx", line 302, in _ruamel_yaml.CParser.__init__
TypeError: a string or stream input is required

Environment:

KiCad   5.1.10

PcbDraw          0.8.0
pcbnewTransition 0.1.0
Pinion           0.2.0
PyYAML           5.4.1
ruamel.yaml      0.17.16
ruamel.yaml.clib 0.2.6

Any fix or workaround?

Thanks!

Signal as default pin name

The template command uses the signal name only as a comment. A better solution would be to apply it directly as the pin name. This maximizes the usability even without human interaction.

👍

            '3':
                name: STM-I2C-SCL
                description: ''
                groups: []

👎

            '3': # Connected to STM-I2C-SCL
                name: IM4.3
                description: ''
                groups: []

Fetch API cannot load

Chrome console output:

Fetch API cannot load file:///home/XXXXXX/Desktop/Proyecto%20Final/proyecto-final-hardware/demo/spec.json. URL scheme "file" is not supported.

I think you use the spec.json file as a file structure it's great but recently when I try this library the browsers (firefox and chrome) have the same problem, it is a normal beahviur or maybe I wrong?.

That's my template.html script configuration:

  <script>
      pinion.setup(document.getElementById("root"), {
          source: "."
      });
  </script>

Thanks and nice library :D.

Suggestion and question

Hi -- I just used Pinion for the first time and really like it. A suggestion about the documentation -- I had trouble figuring out what the "source" option in the javascript call needed to point to. The docs say "Currently, the only option is source that has to contain a location to the source directory". I didn't know whether "source" meant the location of the kicad files, and it took some experimenting to find out it was just where the pinion files lived. It might be easier for newbies if that were made more clear, and even better, show what the contents of the "resources" directory might look like. (I put everything, including the .js and .css in a "tools" directory under my project, and that worked well.)

Now the question -- you reference putting pinion on a github page. How is that done? Can the README.md file include javascript, or is some other approach required?

Thanks very much for a really cool program!

"TypeError: 'NoneType' object is not iterable " when trying to generate plotted

Hi, I tried to generate my PCB but was unable because of the error. I was able to generate an image with PCBDraw.

Traceback (most recent call last):
File "C:\Program Files\KiCad\7.0\bin\Lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\KiCad\7.0\bin\Lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\KiCad\7.0\bin\Scripts\pinion.exe_main
.py", line 7, in
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pinion\ui.py", line 72, in wrapper
return func(*args, **kwargs)
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pinion\ui.py", line 105, in generatePlotted
generate(specification=yaml.load(specification),
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pinion\generate.py", line 327, in generate
fSource, bSource = imageGenerator(board, outputdir)
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pinion\ui.py", line 98, in generateImages
return generateDrawnImages(board, outputdir, dpi, {
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pinion\generate.py", line 261, in generateDrawnImages
fSource = generateImage(board.GetFileName(), outputdir / "front.png",
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pinion\generate.py", line 192, in generateImage
image = plotter.plot()
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pcbdraw\plot.py", line 1051, in plot
self._build_libs_path()
File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pcbdraw\plot.py", line 1156, in _build_libs_path
for l in self.libs:
TypeError: 'NoneType' object is not iterable

Even if I'm not sure if it's necessary, I leave the whole project + the YALM file.
PinionProject.zip

New release required

Hi,

I try to use Pinion because I was impress by the tool. And I do like it, since I take the time to write an article about it (in French).
I lost a lot of time renaming all pin to have the same name for the same signal.
Now, I see that the code doing that is in commit ef2fcbf. It is a pity that this is not include yet in the release, now that you tool have been presented on some major web site.

I think that this modification alone deserve a new release. Can you make it ?

Highlight from URL

A single link should be sufficient to open the generated page and highlight stuff in one go.

https://blabladocs/pinion-generated.html#leds -> obrazek

We wanna be able to highlight mainly a specific group. More complex highlights are up for consideration but not crucial.

Also being able to specify the board side to select would be useful.

Crash on demo during the build with KiCad-7

I have tested building demo pages with KiCad 7, but the process crashed:

Returns error:

➜  Pinion git:(main) ✗ pinion generate rendered \
    -b docs/resources/ArduinoLearningKitStarter.kicad_pcb \
    -s docs/resources/alksSpec.yml \
    --transparent \
    docs/resources/alksDemo-rendered

Traceback (most recent call last):
  File "/home/parallels/.local/bin/pinion", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/parallels/.local/lib/python3.10/site-packages/pinion/ui.py", line 72, in wrapper
    return func(*args, **kwargs)
  File "/home/parallels/.local/lib/python3.10/site-packages/pinion/ui.py", line 142, in generateRendered
    generate(specification=yaml.load(specification),
  File "/home/parallels/.local/lib/python3.10/site-packages/pinion/generate.py", line 327, in generate
    fSource, bSource = imageGenerator(board, outputdir)
  File "/home/parallels/.local/lib/python3.10/site-packages/pinion/ui.py", line 135, in generateImages
    return generateRenderedImages(board, outputdir,
  File "/home/parallels/.local/lib/python3.10/site-packages/pinion/generate.py", line 270, in generateRenderedImages
    from pcbdraw.renderer import (RenderAction, renderBoard, Side, postProcessCrop,
  File "/home/parallels/.local/lib/python3.10/site-packages/pcbdraw/renderer.py", line 180
    raise RuntimeError("File Open Error")
IndentationError: unexpected indent

In same case it generates this image:
error

MacBook Pro M1 - Parallels Ubuntu 22

➜  Pinion git:(main) ✗ python3 -V
Python 3.10.6
➜  Pinion git:(main) ✗ pip show pcbdraw
Name: PcbDraw
Version: 1.1.2
Summary: Utility to produce nice looking drawings of KiCAD boards
Home-page: https://github.com/yaqwsx/PcbDraw
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/parallels/.local/lib/python3.10/site-packages
Requires: click, lxml, mistune, numpy, pcbnewTransition, Pillow, pybars3, pyVirtualDisplay, pyyaml, svgpathtools
Required-by: Pinion
➜  Pinion git:(main) ✗ pip show pinion 
Name: Pinion
Version: 0.3.0
Summary: Create interactive pinout diagrams for KiCAD PCBs
Home-page: https://github.com/yaqwsx/Pinion
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/parallels/.local/lib/python3.10/site-packages
Requires: click, pcbdraw, pcbnewTransition, ruamel.yaml
Required-by: 

Search pins in diagram

The diagrams Pinion creates are really useful. Sometimes you want to search for a specific pin, if you could enter part of the pin's name or function it would allow for finding a pin really fast.
This way you have a similar option to the classical diagrams which show all pins at once, but with less information overload.

pinion generate throws error: pcbdraw returned non-zero exit status

Hi,

I have Ubuntu 20.04 through WSL on my Windows 10 Pro, pip installed Pinion, installed Kicad 6, installed imagemagick. (in that order, if that is important)
Running the template command worked fine (then). When running the generate command, I encountered an issue I cannot resolve myself:

$ pinion generate -b ../ATMega4809_Breakout.kicad_pcb --specification diagram.yaml publish

Warning: component 'PinHeader_2x03_P2.54mm_Vertical' for footprint 'J2' from library 'Connector_PinHeader_2.54mm' was not found
Warning: component 'SW_Push_1P1T_NO_CK_KMR2' for footprint 'SW1' from library 'Button_Switch_SMD' was not found
Warning: component 'QFN-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm' for footprint 'U1' from library 'Package_DFN_QFN' was not foundWarning: component 'PinHeader_1x05_P2.54mm_Horizontal' for footprint 'J1' from library 'Connector_PinHeader_2.54mm' was not found
Warning: component 'LED_RGB_5050-6' for footprint 'D1' from library 'LED_SMD' was not found
Warning: component 'PinHeader_2x02_P2.54mm_Vertical' for footprint 'J3' from library 'Connector_PinHeader_2.54mm' was not found
Warning: component 'Crystal_DS26_D2.0mm_L6.0mm_Horizontal.back' for footprint 'Y1' from library 'Crystal' was not found
Traceback (most recent call last):
  File "/home/marius/.local/bin/pcbdraw", line 8, in <module>
    sys.exit(main())
  File "/home/marius/.local/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 953, in main
    postprocess_svg(args.output, args.shrink)
  File "/home/marius/.local/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 815, in postprocess_svg
    shrink_svg(svgfilepath, shrinkBorder)
  File "/home/marius/.local/lib/python3.8/site-packages/pcbdraw/pcbdraw.py", line 769, in shrink_svg
    paths = document.paths()
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/document.py", line 261, in paths
    return flattened_paths(self.tree.getroot(), group_filter,
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/document.py", line 143, in flattened_paths
    path = transform(parse_path(converter(path_elem)), path_tf)
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 309, in transform
    return transform_segments_together(curve, transformation)
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 191, in transform_segments_together
    transformed_segs = [transformation(seg) for seg in path]
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 191, in <listcomp>
    transformed_segs = [transformation(seg) for seg in path]
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 308, in <lambda>
    transformation = lambda seg: transform(seg, tf)
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 339, in transform
    return Arc(new_start, radius=new_radius, rotation=curve.rotation + rot,
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 1448, in __init__
    self._parameterize()
  File "/home/marius/.local/lib/python3.8/site-packages/svgpathtools/path.py", line 1503, in _parameterize
    raise ValueError("No such elliptic arc exists.")
ValueError: No such elliptic arc exists.
Traceback (most recent call last):
  File "/home/marius/.local/bin/pinion", line 8, in <module>
    sys.exit(cli())
  File "/home/marius/.local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/marius/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/marius/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/marius/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/marius/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/marius/.local/lib/python3.8/site-packages/pinion/ui.py", line 83, in generate
    generate(specification=yaml.load(specification),
  File "/home/marius/.local/lib/python3.8/site-packages/pinion/generate.py", line 213, in generate
    fSource = generateImage(board.GetFileName(), outputdir / "front.png",
  File "/home/marius/.local/lib/python3.8/site-packages/pinion/generate.py", line 140, in generateImage
    subprocess.run(command, check=True)
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pcbdraw', '--shrink', '0', '../ATMega4809_Breakout.kicad_pcb', '/tmp/tmppa6it2b7/img.svg']' returned non-zero exit status 1.

Is it an issue, that it does not find the libraries? I made the board under Windows, but would like to try out your tool.

What can I do?

Cheers, Marius

edt: When generated the template, I did not apply any changes to that. I don't know if that is important.

Templated libs sometimes rotated

Going through the create_template.py -> --libs routine I obtain the footprint images. But in some instances they are incorrectly rotated. Don't know if that's due to create_template.py or the import.

Also some footprints are visible from both sides while others are not. I suppose that depends on what layers are used.

obrazek

obrazek

Unknown layer ID -1 error when trying to generate pinion diagram

Hi, I get this error when trying following steps:

  1. pinion template --board keypad.kicad_pcb --output keypad_pinion_spec.yaml
  2. pinion generate rendered --board keypad.kicad_pcb --specification keypad_pinion_spec.yaml

tried 2 different projects and both rendered and plotted options.

Full error

/builddir/build/BUILD/kicad-6.0.10/common/layer_id.cpp(180): assert ""false"" failed in LayerName(): Unknown layer ID -1
Traceback (most recent call last):
  File "/home/mj/.local/bin/pcbdraw", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/mj/.local/lib/python3.11/site-packages/pcbdraw/pcbdraw.py", line 938, in main
    walk_components(board, args.back, lambda lib, name, val, ref, pos:
  File "/home/mj/.local/lib/python3.11/site-packages/pcbdraw/pcbdraw.py", line 515, in walk_components
    orient = math.radians(module.GetOrientation() / 10)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: must be real number, not EDA_ANGLE
Traceback (most recent call last):
  File "/home/mj/.local/bin/pinion", line 33, in <module>
    sys.exit(load_entry_point('Pinion==0.2.0', 'console_scripts', 'pinion')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mj/.local/lib/python3.11/site-packages/pinion/ui.py", line 83, in generate
    generate(specification=yaml.load(specification),
  File "/home/mj/.local/lib/python3.11/site-packages/pinion/generate.py", line 213, in generate
    fSource = generateImage(board.GetFileName(), outputdir / "front.png",
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mj/.local/lib/python3.11/site-packages/pinion/generate.py", line 140, in generateImage
    subprocess.run(command, check=True)
  File "/usr/lib64/python3.11/subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pcbdraw', '--shrink', '0', 'keypad.kicad_pcb', '/tmp/tmpylq492qm/img.svg']' returned non-zero exit status

Versions:
OS: Fedora 37
KiCAD Platform: Linux 6.0.12-300.fc37.x86_64 x86_64, 64 bit, Little endian, wxGTK, gnome-xorg, x11
Python 3.11.0
pinion, version 0.2.0
PcbDraw 0.9.0

Bottom sliver not clickable

There's an unhappy DIV at the bottom of the page that apparently eats click and hover events, therefore not allowing interaction with the items hidden behind it:
obrazek

PCB image blank

Hi and congrats on this concept!
I'm trying to generate the diagram but it comes back as blank pngs..
What I did was to install pinion via pip3 and WSL (ubuntu20.04) in Windows 10, at first some libraries were missing (imagemagick and Wand) which I installed as well. Then I had to install kicad in WSL as well because it couldn't locate the pcbnew module.
Then I ran :
pinion template --board bench-PSU.kicad_pcb --output bpsu.yaml
and a yaml was generated, and then I ran:
pinion generate --board bench-PSU.kicad_pcb --specification bpsu.yaml .
which only generated some warnings like the one below:
Warning: component 'PinHeader_1x02_P2.54mm_Vertical.back' for footprint 'SW5' from library 'Connector_PinHeader_2.54mm' was not found

And finally I ran:
pinion serve -b --directory .

And the page opened had the pins working hovering the mouse and clicking them but the PCB was a blank image. I tried the pngs directly with paint and indeed they were blanks....

What can I see to make it work?

Crash with `pinion generate plotted `

I just install the v3.0 and git it a try!
I was able to generate the template, but not the output. I tried with two boards:

$ pinion generate plotted --board carte.kicad_pcb --specification carte_config.yml output
Traceback (most recent call last):
  File "/home/samuel/.local/bin/pinion", line 8, in <module>
    sys.exit(cli())
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/ui.py", line 72, in wrapper
    return func(*args, **kwargs)
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/ui.py", line 105, in generatePlotted
    generate(specification=yaml.load(specification),
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/generate.py", line 327, in generate
    fSource, bSource = imageGenerator(board, outputdir)
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/ui.py", line 98, in generateImages
    return generateDrawnImages(board, outputdir, dpi, {
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/generate.py", line 261, in generateDrawnImages
    fSource = generateImage(board.GetFileName(), outputdir / "front.png",
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/generate.py", line 192, in generateImage
    image = plotter.plot()
  File "/home/samuel/.local/lib/python3.9/site-packages/pcbdraw/plot.py", line 1051, in plot
    self._build_libs_path()
  File "/home/samuel/.local/lib/python3.9/site-packages/pcbdraw/plot.py", line 1156, in _build_libs_path
    for l in self.libs:
TypeError: 'NoneType' object is not iterable

For more information, I played a bit with the version of the package previously, I don't know if it is related...

$ pip show pinion
Name: Pinion
Version: 0.3.0
Summary: Create interactive pinout diagrams for KiCAD PCBs
Home-page: https://github.com/yaqwsx/Pinion
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/samuel/.local/lib/python3.9/site-packages
Requires: pcbdraw, pcbnewTransition, ruamel.yaml, click
Required-by: 
$ pip show pcbdraw
Name: PcbDraw
Version: 1.1.1
Summary: Utility to produce nice looking drawings of KiCAD boards
Home-page: https://github.com/yaqwsx/PcbDraw
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/samuel/.local/lib/python3.9/site-packages
Requires: Pillow, pybars3, lxml, click, svgpathtools, pyyaml, numpy, pcbnewTransition, pyVirtualDisplay, mistune
Required-by: Pinion

I am available if you need more info !

Wildcard component match

template command would benefit from allowing wildcards to match components for inclusion.

Ex.: template -b board.kicad_pcb -o pinion.yaml -c JP*

pcbdraw: no such option: --shrink

Getting an error when attempting to generate. I am running it on Ubuntu 20.04 Kicad 6.0.5.
The following is the command I ran, and the output.

pinion generate --style rendered -b grover_system_ctlr_hw/grover_system_ctlr_hw.kicad_pcb -s pinion_template.yaml pinion_diagram.html
Usage: pcbdraw [OPTIONS] COMMAND [ARGS]...
Try 'pcbdraw --help' for help.

Error: No such option: --shrink
Traceback (most recent call last):
  File "/home/keshav/.local/bin/pinion", line 8, in <module>
    sys.exit(cli())
  File "/home/keshav/.local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/keshav/.local/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/keshav/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/keshav/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/keshav/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/keshav/.local/lib/python3.8/site-packages/pinion/ui.py", line 83, in generate
    generate(specification=yaml.load(specification),
  File "/home/keshav/.local/lib/python3.8/site-packages/pinion/generate.py", line 213, in generate
    fSource = generateImage(board.GetFileName(), outputdir / "front.png",
  File "/home/keshav/.local/lib/python3.8/site-packages/pinion/generate.py", line 140, in generateImage
    subprocess.run(command, check=True)
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pcbdraw', '--shrink', '0', '--style', 'rendered', 'grover_system_ctlr_hw/grover_system_ctlr_hw.kicad_pcb', '/tmp/tmpp85ab36o/img.svg']' returned non-zero exit status 2.

I am wondering whether the correct version of pcbdraw has been installed.

pip show pcbdraw
Name: PcbDraw
Version: 1.0.0
Summary: Utility to produce nice looking drawings of KiCAD boards
Home-page: https://github.com/yaqwsx/PcbDraw
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/keshav/.local/lib/python3.8/site-packages
Requires: pyyaml, numpy, Pillow, click, pybars3, pcbnewTransition, lxml, pyVirtualDisplay, mistune, svgpathtools
Required-by: Pinion

Pinion version:

pip show pinion
Name: Pinion
Version: 0.2.0
Summary: Create interactive pinout diagrams for KiCAD PCBs
Home-page: https://github.com/yaqwsx/Pinion
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/keshav/.local/lib/python3.8/site-packages
Requires: ruamel.yaml, pcbnewTransition, pcbdraw, click
Required-by: 

Cheers

PCB image not correctly cropped

I've come accross an issue where the PCB wasn't properly cropped. There was a lot of white space on the left and underneath the PCB. On the lower left there was also an axis arrow visible.

It turns out that this axis arrow was the culprit. Disabling it in the KiCad default settings in /usr/lib/python3.10/site-packages/pcbdraw/resources/defaultKiCadSettings/3d_viewer.json by setting "show_axis": false helped.

Template component ordering

After template invocation the components seem to be randomly ordered. Having them ordered alphabetically would be a nice touch.

Node 18 returns error: `digital envelope routines::unsupported` on build

When I call:

releng/buildWidgetReleases.sh

Node returns error: opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ]

To fix it:

Better will be upgrade packages

Console error

MacBook Pro M1 - Parallels Ubuntu 22

➜  Pinion git:(main) ✗ ./releng/buildWidgetReleases.sh 

> [email protected] build
> craco build

craco:  *** Cannot find ESLint loader (eslint-loader). ***
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Creating an optimized production build...
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:471:10)
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:503:5
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:358:12
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:417:16)
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:452:10
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/webpack/lib/NormalModule.js:323:13
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /media/psf/Home/Documents/git/yaqwsx/Pinion/pinion-widget/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.0

MacBook Pro M1 - Parallels Ubuntu 22

➜  Pinion git:(main) ✗ python3 -V
Python 3.10.6
➜  Pinion git:(main) ✗ pip show pcbdraw
Name: PcbDraw
Version: 1.1.2
Summary: Utility to produce nice looking drawings of KiCAD boards
Home-page: https://github.com/yaqwsx/PcbDraw
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/parallels/.local/lib/python3.10/site-packages
Requires: click, lxml, mistune, numpy, pcbnewTransition, Pillow, pybars3, pyVirtualDisplay, pyyaml, svgpathtools
Required-by: Pinion
➜  Pinion git:(main) ✗ pip show pinion 
Name: Pinion
Version: 0.3.0
Summary: Create interactive pinout diagrams for KiCAD PCBs
Home-page: https://github.com/yaqwsx/Pinion
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/parallels/.local/lib/python3.10/site-packages
Requires: click, pcbdraw, pcbnewTransition, ruamel.yaml
Required-by: 

Pinion not compatible with latest version of PcbDraw

With latest pip version of Pinion and PcbDraw I got this error:

n310-drive@n310 /r/n/harry-kicad> pinion generate --style rendered --board harry-kicad.kicad_pcb --specification pinout/test.yaml ./pinout
Traceback (most recent call last):
  File "/home/n310-drive/.local/bin/pinion", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/n310-drive/.local/lib/python3.10/site-packages/pinion/ui.py", line 77, in generate
    from pinion.generate import generate
  File "/home/n310-drive/.local/lib/python3.10/site-packages/pinion/generate.py", line 14, in <module>
    from pcbdraw.pcbdraw import svg2ki
ModuleNotFoundError: No module named 'pcbdraw.pcbdraw'

But if I install PcbDraw from commit yaqwsx/PcbDraw@1071f3b and latest Pinion there's no more ModuleNotFoundError

EDIT: this commit: yaqwsx/PcbDraw@fead173#diff-5e0ba9a3dd07d0b08ab5328458d98bd2b5bff2246b5be75cc4ce9f205ad6f206 deleted pcbdraw.pcbdraw module

TH component not clickable from other side

I feel like we should allow having a throughhole component clickable (highlight visible) from both sides.

Suggested logic for driving the clickableness from both sides:

isSMD = are all pads SMD
clickableFromBothSides = !isSMD

Current behaviour with a Stepdown component:

Yes (highlighted):
obrazek

No (after switching sides):
obrazek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.