Hi guys, this is the Kicad-Diff plotpcb.py script. Right now it works on Kicad v5. But it does not work quite the same in the new Kicad v6 (>5.99). The generated image looks off-center (towards the top-left corner), sometimes it is kind of cropped. And also a circle/dot, appears on the top-left portion of the design.
Maybe the issue is the Autoscale here. Setting it to True and removing the SetScale, it still gives me an empty file
Now this popt.SetLineWidth(pn.FromMM(0.15)) helps nothing, but it was giving warning/errors some versions before, I think. Then I tried to replace it with popt.SetWidthAdjust(pn.FromMM(0.15)) but now this produces this dot
Do you know a standard way to export the whole layout sheet without the page decorations? The goal is to export the layout in the same place, always. So I can compare different versions of the layout but overlapping images.
Image is not empty, it’s tiny to the point that it’s invisible. SVG is vector format, if you give a tiny image a big line width you will see a dot, which is what second image is, I think.
Play around with the aux origin (you glanced over that part of my comment) and different scale values.
This is the issue I mentioned with SetLineWidth. It was removed. Not sure if it was replaced with anything else.
Board version: 20211014
<pcbnew.PCB_PLOT_PARAMS; proxy of <Swig Object of type 'PCB_PLOT_PARAMS *' at 0x7fad2a258b40> >
Traceback (most recent call last):
File "/home/lheck/Dropbox/Documents/kiri/submodules/KiCad-Diff/plotPCB.py", line 212, in <module>
processBoard(board_path, plot_dir, args.quiet, args.verbose)
File "/home/lheck/Dropbox/Documents/kiri/submodules/KiCad-Diff/plotPCB.py", line 103, in processBoard
popt.SetLineWidth(FromMM(0.35))
File "/usr/lib/kicad-nightly/lib/python3/dist-packages/pcbnew.py", line 7354, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, PCB_PLOT_PARAMS, name)
File "/usr/lib/kicad-nightly/lib/python3/dist-packages/pcbnew.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'PCB_PLOT_PARAMS' object has no attribute 'SetLineWidth'
If I enable the SetPlotFrameRef, this is what I see. Something is pretty off here. There is no way to make 2 similar plots on v5 and v6. Everything I try on v6 is pretty bad. The best thing I can do is to use the scale=1 everything else gives results of the canvas
Also try opening svg files in browser, I would trust them rendering correctly more than a random linux viewer. SVGs have a viewport header and it’s possible that either kicad or your viewer is messing it up.
Yeah, looks like kicad bugs. Both scaling and viewport are not handled correctly.
You still should be able to work around it, reset the viewport of the svg to the bounding box of the board or something like that.
SVG is a vector picture format.
It can easily be post processed, for example with Inkscape.
SVG files are also directly understood by any decent web browser (that had taken a long time) and because of this, you can use .SVG files directly on web sites, which is nice if you want to show a schematic on a website you create.
You can also use the .SVG files as a part of other documentation you want to create.