Closed FFY00 closed 3 years ago
Nice board! Did you try with this: https://github.com/yaqwsx/PcbDraw-Lib/blob/master/scrips/resize_canvas.sh
It is! I did not design it :sweat_smile:.
I haven't tried that, I will have a look tomorrow. It would still be cool to have it automatically done, would simplify populate and such.
Currently, PcbDraw uses a board bounding box reported by KiCAD. This bounding box includes all items in the drawing (even the ones not used by PcbDraw). Cropping to only visible items makes sense. There are three ways to implement it:
I will think about it and try to implement it. Meanwhile, feel free to use the script above.
I will think about it and try to implement it. Meanwhile, feel free to use the script above.
Please try to avoid the Inkscape dependency, is 172 MiB, is ok for my desktop, but an overkill for a docker image.
I already avoided it for SVG conversions (is the default for convert
tool).
I am not really aware of the API pcbnew exposes, but if you can iterate through the items and get the origin and size, it should be fairly straight forward to calculate the min and max x and y.
If this is difficult to do with the available API, you could pull inkscape as an optional dependency, disabling the functionality when it is missing.
Don't worry, I do not plan to use Inkscape as it is a heavy dependency.
Today I accidentally found svgelements. From the brief look, it looks exactly like what I need. It would also allow for dropping the SvgPathItem
and replacing it with something more robust.
Just to mention: that inkscape script doesn't work here, I had to use:
inkscape -D --export-filename=out.svg --verb=FileQuit in.svg
And yeah, inkscape is a big dependency...
This was addressed in 27dafbc6acb31fb294cf749b3d06ee73f185ea6a
Hey, currently pcbdraw only crops out at the vertical bottom limit of the board. Would it be possible to do the same in the other 3 side?
Example: