Gasman2014 / KiCad-Diff

Scripts for performing image diffs between pcbnew layout revisions
MIT License
248 stars 42 forks source link

1. SVG-Related Improvements. #77

Closed leoheck closed 2 years ago

leoheck commented 2 years ago

This improves SVG generation for Kicad 6 on macOS and tweaks the overall usability of the tool.

So. this PR evolved a bit further from the initial idea that was just to improve the generated SVG files for Kicad 6.

It was tested on my Linux box, and on a Macbook too. Well, here are the changes.

Kicad 6

Python improvements

HTML improvements

JavaScript

Style improvements

New flags

New shortcuts (in the Triptych window)

A taste of the new buttons image

A taste of the fixed highlighted selected tab image

Triptych overview. image

leoheck commented 2 years ago

Hey, @Gasman2014 @edahlseng I invite you guys to check these new changes.

Gasman2014 commented 2 years ago

This looks good. I'm migrating to a new computer so will check when I'm all up to date.

One thing I have struggled with is the large diff that happens if the board is moved. I did come across this code snippet which I think might be worth testing. What do you think?

        # Save auxillary origin
        aux_origin_save = self.brd.GetAuxOrigin ()

        # Set new aux origin to upper left side of board
        self.brd.SetAuxOrigin (wxPoint (FromMM(self.origin[0]), FromMM(self.origin[1])))

... Plot routine here ...

        # Restore origin
        self.brd.SetAuxOrigin (aux_origin_save)
leoheck commented 2 years ago

The user will have to set this auxiliary origin by himself, I think. An then the boards already versioned may not have this feature.

I am not sure how this works when the user did not set this in the first place. If it defaults to the original axis it seems ok. If the user changes this origin during the design process it is ok too, but those commits are not going to match in the diff view. This is a problem but it happens that time only.

I think the current solution may work better, actually. The current solution is to generate the SVG of the whole layout sheet. And then the board is going to be as the user put it. Even if the user moves the board, we are going to track this well. So the good approach is always to move or change the board shape in a single commit and then work on different things.

Now, since the SVG shows the whole page (which was not possible on Kicad 5, since the generated image is not good, at least without having to optimize the created SVG) then diff becomes good.

The improvement I did was to save the pan-and-zoom settings of the current layer view, to the next one. Since the whole view is pretty big for that small image view.

So for instance, you start by entering the triptych view, and then. Double click the board to zoom in it, and move it to the side to focus an area, and once you move to the next layer, the current view continues with the same zoom level and placement.

leoheck commented 2 years ago

This is the first PR that has to be approved/reviewed. If this one is merged, then I will change other PRs to remove duplicate commits, since the others were built on top of this one.

Gasman2014 commented 2 years ago

OK, I think I have WX python installed on my new laptop (via brew as suggested but also have tried via pip). I hit this problem

This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

Any clues? I have tried changing the shebang to pythonw but that’s not going to wash.

John

On 19 Jan 2022, at 14:31, Leandro Heck @.***> wrote:

This is the first PR that has to be approved/reviewed. If this one is merged, then I will change other PRs to remove duplicate commits, since the others were built on top of this one.

— Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/pull/77#issuecomment-1016522521, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACADFOL2DSBSFG2JCEERKT3UW3DNDANCNFSM5MC64N3A. You are receiving this because you were mentioned.

leoheck commented 2 years ago

This PR uses the TKinter. Then please, ignore it for now, since it is going to be added in the next PR.

But since you mentioned it. It was a bit tricky to install it. I could not track pretty well this time, since I just wanted to check if the kidiff made on Linux would work on macOs.

But I tried this, in this other...

# this fails but may have changed something
brew install wxwidgets

# then, try this
pip install wxpython
# or this
pip3 install wxpython

# then in the end, this
brew install wxpython

This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

Well, I did not see this message above. Are you using virtualenv? I was not using it.

Gasman2014 commented 2 years ago

When run without any cli parameters, this is trying to make the diffs in the script directory, not the project directory.

base  10:09:53  johnpateman  ~  Documents  …  KiCad-Diff   leoheck-improve-svg  ⎘ 
 %  git pull https://github.com/leoheck/KiCad-Diff.git improve-svg
From https://github.com/leoheck/KiCad-Diff
 * branch            improve-svg -> FETCH_HEAD
Already up to date.
 base  10:09:59  johnpateman  ~  Documents  …  KiCad-Diff   leoheck-improve-svg  ⎘ 
 %  ./kidiff

      SCM Selected: fossil
  Kicad Board Path: /Users/johnpateman/EDA_Workspace/Projects/Tiny85Spark/Tiny85Spark.kicad_pcb
Kicad Project Path: /Users/johnpateman/EDA_Workspace/Projects/Tiny85Spark
         REPO Path: /Users/johnpateman/EDA_Workspace/Projects/Tiny85Spark/
 Kicad Project Dir: .
   Board File Name: Tiny85Spark.kicad_pcb
        Output Dir: /Users/johnpateman/Documents/Code/KiCad-Diff/kidiff

Commit 1 (a): a4c52e1dd4 | 2022-01-15 | johnpate | tiny_pro | Added documentation and new renders for
Commit 2 (b): 27696367ce | 2021-11-11 | johnpate | tiny_pro | Rerouted board in order to align LEDs.
Traceback (most recent call last):
  File "./kidiff", line 814, in <module>
    commit1, commit2, commit_datetimes = scm.get_boards(kicad_pcb_path, repo_path, kicad_project_dir, board_filename, commit1, commit2)
  File "/Users/johnpateman/Documents/Code/KiCad-Diff/scms/fossil.py", line 46, in get_boards
    os.makedirs(outputDir1)
  File "/Users/johnpateman/opt/miniconda3/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
NotADirectoryError: [Errno 20] Not a directory: '/Users/johnpateman/Documents/Code/KiCad-Diff/kidiff/a4c52e'
Gasman2014 commented 2 years ago

Also, when passing the filenames and path via the CLI but without commit references, the GUI is not destroyed before the web page is opened.

More significantly, the svg plots don't seem right - some of them are working but most are not - I've tried a couple of repos and am getting two overlapping boxes top left in all views an occasional, full board views.

Screenshot 2022-01-20 at 10 42 11 Screenshot 2022-01-20 at 10 44 36
Gasman2014 commented 2 years ago

The svgs WILL open ok in Inkscape - which is odd! Tried with two different browsers and preview - all show wrong image.

leoheck commented 2 years ago

When run without any cli parameters, this is trying to make the diffs in the script directory, not the project directory.

Yeh, I will have to investigate what is wrong. I also saw that running inside Kicad-Diff folder from the PATH (with kidiff) and locally (with ./kidiff) are not the same. I have to remove Tk everywhere too.

the GUI is not destroyed before the web page is opened.

Yeh, saw this last night. It just doesn't do like this on Linux but could now fix this yet.

More significantly, the svg plots don't seem right

Interesting. Do a second test for me, please. Try to remove the kidiff folder before running it to see if it improves it by generating images for all the layers. Hit f to fit the view too.

Does your board have all these layers?

I could not fix/remove the squares on top yet. This looks like a bug with SVG and HTML but I can apply a workaround to change its size to the page size, so we can have the page border working better.

leoheck commented 2 years ago

Google Chrome shows the layers for me, but the border is somehow wrong image

Firefox shows just the border of the page image

Inkscape shows it as it should be, as you said. image

Gasman2014 commented 2 years ago

Can confirm your results - Chrome works ok but there is an overlapping box artefact top left and the page border is wrong. Firefox and Safari only show blank pages. Inkscape and Afinity are ok. I ran it through an svg validation which says it’s valid. If you save (unedited) back to an svg, the header is rewritten in terms of percentages rather than as cm (of an A4 sheet) and the viewport is expressed in pixels rather than nanometers.

There also seems to be a problem with how the vias are rendering.

John Pateman

Sent from my iPhone

On 21 Jan 2022, at 08:00, Leandro Heck @.***> wrote:

 Google Chrome shows the layers for me, but the border is somehow wrong

Firefox shows just the border of the page

Inkscape shows it as it should be, as you said.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

leoheck commented 2 years ago

This is the current header of the generated svg. I am thinking that cm is not being rendered well on browsers. But I tried to change these things and they don't do much unless it changes completely the size of the elements, and the blank page I am seeing has something pretty small and of the screen.

<svg
  xmlns:svg="http://www.w3.org/2000/svg"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  version="1.1"
  width="29.700220cm" height="21.000720cm" viewBox="0 0 297002200 210007200">
Gasman2014 commented 2 years ago

The size of the svg units seems to be tripping browsers up. See this issue on the bugtracker. https://gitlab.com/kicad/code/kicad/-/issues/9976

leoheck commented 2 years ago

I tried to scale manually some .svg files from Kicad and every time I change these things I get a blank image on each browser. I would like to know if we can get a file that Kicad generates, and manually change it to work. If we can make that, then we could release a fix in the plotpcb itself to solve this.

leoheck commented 2 years ago

I could fix vias by trying to fix svg dimensions using this rsvg-convert

rsvg-convert -a -w 500 -f svg board-00-F_Cu.svg -o lala.svg

There are no more 2 small circles on the top-right corner. This running manually.

image

But if I put this inside the plotpcb.py, I see some issues that I am not seeing running manually. Maybe the SVG is still being written at that time. Even waiting for 5s for each image it is showing this message. image

leoheck commented 2 years ago

Ah, this somehow fixes vias on google-chomre. On firefox I am still seeing a blank image. Nothing seems to fix images there.

leoheck commented 2 years ago

I could find a file that was generated with Kicad 5 that loads on Firefox, this is on the left, here. The one that is not working on Firefox is the one on the right. image

leoheck commented 2 years ago

Interesting that there is not a single way to fix these images for Firefox.

It is pretty hard to workaround this. If I could find a validator or linter or anything for firefox, it would be awesome.

Gasman2014 commented 2 years ago

I have been fiddling around with these svg files too and am finding it very frustrating!. I thought that the svg format supported single precision fp values up to 10^32 but there do seem to be some problems.

https://oreillymedia.github.io/Using_SVG/extras/ch08-precision.html

Is this really a bug in the svg generation? It seemed to work ok with KiCad 5 and I don’t recall seeing any of these problems. Has there been a codebase change in the svg generation?

Pragmatically, the svgs are defective if they cannot be displayed in several major browsers!

Should the browsers fix their defective rendering or KiCad generate more browser friendly svgs?

I have been trying with this tool ’svgcheck’ which you can install with pip.

https://pypi.org/project/svgcheck/

This will let you validate and repair .svg files - I’m working on a few now.

I found this svg validator at validator.nu and ran an empty (User1) svg through it.

Error: The character encoding was not declared. Proceeding using windows-1252. Error: Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.) At line 1, column 2 https://validator.nu/?showimagereport=yes&showsource=yes&showoutline=yes#cl1c2 <?xml version="1 Error: Quirky doctype. Expected <!DOCTYPE html>. From line 1, column 38; to line 3, column 52 https://validator.nu/?showimagereport=yes&showsource=yes&showoutline=yes#l3c52 one="no"?>↩ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ↩ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> ↩<svg Error: Element head https://html.spec.whatwg.org/multipage/#the-head-element is missing a required instance of child element title. From line 3, column 53; to line 9, column 77 https://validator.nu/?showimagereport=yes&showsource=yes&showoutline=yes#l9c77 vg11.dtd"> ↩<svg↩ xmlns:svg="http://www.w3.org/2000/svg"↩ xmlns="http://www.w3.org/2000/svg"↩ xmlns:xlink="http://www.w3.org/1999/xlink"↩ version="1.1"↩ width="29.700220cm" height="21.000720cm" viewBox="0 0 297002200 210007200">↩<titl Content model for element head https://html.spec.whatwg.org/multipage/#the-head-element: If the document is an iframe srcdoc document https://html.spec.whatwg.org/multipage/#an-iframe-srcdoc-document or if title information is available from a higher-level protocol: Zero or more elements of metadata content https://html.spec.whatwg.org/multipage/#metadata-content-2, of which no more than one is a title https://html.spec.whatwg.org/multipage/#the-title-element element and no more than one is a base https://html.spec.whatwg.org/multipage/#the-base-element element. Otherwise: One or more elements of metadata content https://html.spec.whatwg.org/multipage/#metadata-content-2, of which exactly one is a title https://html.spec.whatwg.org/multipage/#the-title-element element and no more than one is a base https://html.spec.whatwg.org/multipage/#the-base-element element. Error: Attribute xmlns:svg not allowed here. From line 3, column 53; to line 9, column 77 https://validator.nu/?showimagereport=yes&showsource=yes&showoutline=yes#l9c77 vg11.dtd"> ↩<svg↩ xmlns:svg="http://www.w3.org/2000/svg"↩ xmlns="http://www.w3.org/2000/svg"↩ xmlns:xlink="http://www.w3.org/1999/xlink"↩ version="1.1"↩ width="29.700220cm" height="21.000720cm" viewBox="0 0 297002200 210007200">↩<titl Warning: Attribute with the local name xmlns:svg is not serializable as XML 1.0. From line 3, column 53; to line 9, column 77 https://validator.nu/?showimagereport=yes&showsource=yes&showoutline=yes#l9c77 vg11.dtd"> ↩<svg↩ xmlns:svg="http://www.w3.org/2000/svg"↩ xmlns="http://www.w3.org/2000/svg"↩ xmlns:xlink="http://www.w3.org/1999/xlink"↩ version="1.1"↩ width="29.700220cm" height="21.000720cm" viewBox="0 0 297002200 210007200">↩<titl There were errors. Image report

No images in the document. Source

<?xml version="1.0" standalone="no"?>↩ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ↩ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> ↩ <svg↩ xmlns:svg="http://www.w3.org/2000/svg"↩ xmlns="http://www.w3.org/2000/svg"↩ xmlns:xlink="http://www.w3.org/1999/xlink"↩ version="1.1"↩ width="29.700220cm" height="21.000720cm" viewBox="0 0 297002200 210007200">↩

SVG Picture created as Tiny85Spark-51-User_2.svg date 2022/01/21 13:52:17 Picture generated by PCBNEW
leoheck commented 2 years ago

Thanks for sharing this. svgcheck gives the same (literally) output running svg generated on both versions (5 and 6) of Kicad.

Then this big numbers issue may be the actual problem since my files (Kicad 6 on the right) differ on the scale of the numbers.

image

leoheck commented 2 years ago

Do you know any tool that can scale each one of these numbers? This would be a good test and workaround.

leoheck commented 2 years ago

Alternatively, we could use a png to make the diffs. I think we can embed and inside an SVG template to use the diff and the pan-zoom. This would work everywhere, I think.

Gasman2014 commented 2 years ago

I am sure you should be able to do this with ’sed’ or ‘awk’. The numbers are all

I have just played around with these and they seem to work. Easiest to put them all in script. Im no sed guru so I’m sure they could be better!

The first one strips out the excessive 6dp precision of the line width. The second inserts a decimal point four digits from the end of a number that is followed by a space and the last one does the same for a number followed by a new line. Try piping them all together. Might need a bit more fiddling but I need to go and pick up my daughter.

sed 's/.000000/.0/' Tiny85Spark-58-User_9.svg > OUT.svg

sed 's/[0-9][0-9][0-9][0-9] /.& /' Tiny85Spark-58-User_9.svg > OUT.svg

sed 's/[0-9][0-9][0-9][0-9]$/.& /' Tiny85Spark-58-User_9.svg > OUT.svg

On 24 Jan 2022, at 14:19, Leandro Heck @.***> wrote:

Do you know any tool that can scale each one of these numbers? This would be a good test and workaround.

— Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/pull/77#issuecomment-1020148996, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACADFONICWUHEUZCFKZOO2TUXVNWRANCNFSM5MC64N3A. You are receiving this because you were mentioned.

leoheck commented 2 years ago

I was testing exactly that. But no luck at all. Did you got any positive results?

Ah, yesterday I got positive results by playing with the d= properties on path tag.

By default it uses letters like M m L l C A z h If you put spaces between these single character commands you start to visualize things on firefox.

I also changed the case from m to M sometimes. But then I saw later that both are different kind of parameters.

sometimes these single character commands accept comma sometimes they don't.

Firefox said it should not use commas at all.

So I could not track exactly what is going on.

On Mon, Jan 24, 2022, 13:51 John @.***> wrote:

I am sure you should be able to do this with ’sed’ or ‘awk’. The numbers are all

I have just played around with these and they seem to work. Easiest to put them all in script. Im no sed guru so I’m sure they could be better!

The first one strips out the excessive 6dp precision of the line width. The second inserts a decimal point four digits from the end of a number that is followed by a space and the last one does the same for a number followed by a new line. Try piping them all together. Might need a bit more fiddling but I need to go and pick up my daughter.

sed 's/.000000/.0/' Tiny85Spark-58-User_9.svg > OUT.svg

sed 's/[0-9][0-9][0-9][0-9] /.& /' Tiny85Spark-58-User_9.svg > OUT.svg

sed 's/[0-9][0-9][0-9][0-9]$/.& /' Tiny85Spark-58-User_9.svg > OUT.svg

On 24 Jan 2022, at 14:19, Leandro Heck @.***> wrote:

Do you know any tool that can scale each one of these numbers? This would be a good test and workaround.

— Reply to this email directly, view it on GitHub < https://github.com/Gasman2014/KiCad-Diff/pull/77#issuecomment-1020148996>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACADFONICWUHEUZCFKZOO2TUXVNWRANCNFSM5MC64N3A . You are receiving this because you were mentioned.

— Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/pull/77#issuecomment-1020309258, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJX7YGHCXYR7VOOVVD67KTUXV7QXANCNFSM5MC64N3A . You are receiving this because you authored the thread.Message ID: @.***>

leoheck commented 2 years ago

Hey john, Kicad guys closed the issue you shared here. No luck for us today.

leoheck commented 2 years ago

It worked. This divides numbers with more than 5 digits by 1000. This avoids messing with other numbers too.

perl -i -pe 's{(?<!\d)(\d{5,}(?:\.\d+)?)(?!\d)}{$1/1000}ge' kidiff/local/board-00-F_Cu.svg

Not perfect, but this is the first positive result. image

Now I can try applying other improvements.

leoheck commented 2 years ago

Yay! I just have to fix the missing border since it is missing here. This is firefox.

I am dividing numbers by 1000 (in a dumb way, I have to be smarter because some numbers smaller than 5 digits should be divided too.

image

leoheck commented 2 years ago

This is better

perl -i -pe 's{(?<![\d#])(\d{5,}(?:\.\d+)?)(?!\d)}{sprintf("%.1f", $1/1000);}ge' $svg

It avoids replacing colors #000000 to #0.0, then it is done. Board edges are working too. So, now having this with python would integrate it easily on pcbnew.

leoheck commented 2 years ago

I put this fix on my 3rd PR here https://github.com/Gasman2014/KiCad-Diff/pull/79 You can test it running kidiff with the flag -x It calls a script with that perl line. This is a fast workaround, so you can check if this fix works on Safari too. Then we can implement this directly on python somehow.

leoheck commented 2 years ago

There is an extra flag to enable plotting the whole page with (-f) the default is the board only.

Now I have to check those issues you found before. And also to check why the last image (or F_Fab) is not being fixed.

Chrome image

Firefox image

leoheck commented 2 years ago

Fixed this https://github.com/Gasman2014/KiCad-Diff/pull/77#issuecomment-1017319356 issue you were seeing. This happens because you were running ./kidiff inside the script folder, where and then it cannot create a folder with the same name. But it is better to generate inside the repo by default. So, it is fixed.

Gasman2014 commented 2 years ago

I'll merge this now. There is still an issue with running this from the bare command line but we can fix this downstream. Possibly this is already fixed in the other merge request but I won't bother trying to cherrypick it.

Gasman2014 commented 2 years ago

Ahaha!!! Think this might help us!!!

There is this new function 'SetSvgCoordinatesFormat' in KiCad 6.

pcbnew.PLOTTER.SetSvgCoordinatesFormat

Type: <class 'function'>

Value: <function PLOTTER.SetSvgCoordinatesFormat at 0x7fc230f9cc10>

Docstring:

"""SetSvgCoordinatesFormat(PLOTTER self, unsigned int aResolution, bool aUseInches=False)"""

Source Code:

    def SetSvgCoordinatesFormat(self, aResolution: "unsigned int", aUseInches: "bool"=False) -> "void":
        r"""SetSvgCoordinatesFormat(PLOTTER self, unsigned int aResolution, bool aUseInches=False)"""
        return _pcbnew.PLOTTER_SetSvgCoordinatesFormat(self, aResolution, aUseInches)

Here is the original, copied from the source.

void SVG_PLOTTER::SetSvgCoordinatesFormat( unsigned aResolution, bool aUseInches )
{
    m_useInch   = aUseInches;
    m_precision = aResolution;

    // gives now a default value to iuPerDeviceUnit (because the units of the caller is now known)
    double iusPerMM = m_IUsPerDecimil / 2.54 * 1000;
    m_iuPerDeviceUnit = pow( 10.0, m_precision ) / ( iusPerMM );

    if( m_useInch )
        m_iuPerDeviceUnit /= 25.4; // convert to inch
}
leoheck commented 2 years ago

This looks interesting. Does it work?

I tested this pretty quick here,

pn.PLOTTER.SetSvgCoordinatesFormat(1, 0)

And I am receiving this. But I am not sure it I am using it right.

Traceback (most recent call last):
  File "/home/lheck/Dropbox/Documents/kiri/submodules/KiCad-Diff/plot_kicad_pcb.py", line 226, in <module>
    processBoard(board_path, plot_dir, args.quiet, args.verbose, args.frame)
  File "/home/lheck/Dropbox/Documents/kiri/submodules/KiCad-Diff/plot_kicad_pcb.py", line 83, in processBoard
    pn.PLOTTER.SetSvgCoordinatesFormat(1, 1)
  File "/usr/lib/python3/dist-packages/pcbnew.py", line 8367, in SetSvgCoordinatesFormat
    return _pcbnew.PLOTTER_SetSvgCoordinatesFormat(self, aResolution, aUseInches)
NotImplementedError: Wrong number or type of arguments for overloaded function 'PLOTTER_SetSvgCoordinatesFormat'.
  Possible C/C++ prototypes are:
    PLOTTER::SetSvgCoordinatesFormat(unsigned int,bool)
    PLOTTER::SetSvgCoordinatesFormat(unsigned int)

There is another interesting function

SetViewport (self, 'wxPoint' aOffset, 'double' aIusPerDecimil, 'double' aScale, 'bool' aMirror)

I could not use this one too. Do you have a hint on how to use this?

Reference, PLOTTER functions here, https://docs.kicad.org/doxygen-python/classpcbnew_1_1PLOTTER.html

Gasman2014 commented 2 years ago

No, I have tried but can’t get it to work. I paged Jon Evans who is always helpful and John Pateman Charras who wrote the SVG Plot function. Hope one can help!

John

On 25 Jan 2022, at 12:22, Leandro Heck @.***> wrote:

This looks interesting. Does it work?

I tested this pretty quick here,

pn.PLOTTER.SetSvgCoordinatesFormat(1, 0) And I am receiving this. But I am not sure it I am using it right.

Traceback (most recent call last): File "/home/lheck/Dropbox/Documents/kiri/submodules/KiCad-Diff/plot_kicad_pcb.py", line 226, in processBoard(board_path, plot_dir, args.quiet, args.verbose, args.frame) File "/home/lheck/Dropbox/Documents/kiri/submodules/KiCad-Diff/plot_kicad_pcb.py", line 83, in processBoard pn.PLOTTER.SetSvgCoordinatesFormat(1, 1) File "/usr/lib/python3/dist-packages/pcbnew.py", line 8367, in SetSvgCoordinatesFormat return _pcbnew.PLOTTER_SetSvgCoordinatesFormat(self, aResolution, aUseInches) NotImplementedError: Wrong number or type of arguments for overloaded function 'PLOTTER_SetSvgCoordinatesFormat'. Possible C/C++ prototypes are: PLOTTER::SetSvgCoordinatesFormat(unsigned int,bool) PLOTTER::SetSvgCoordinatesFormat(unsigned int)

There is another interesting function

SetViewport (self, 'wxPoint' aOffset, 'double' aIusPerDecimil, 'double' aScale, 'bool' aMirror) I could not use this one too. Do you have a hint on how to use this?

Reference, PLOTTER functions here, https://docs.kicad.org/doxygen-python/classpcbnew_1_1PLOTTER.html https://docs.kicad.org/doxygen-python/classpcbnew_1_1PLOTTER.html — Reply to this email directly, view it on GitHub https://github.com/Gasman2014/KiCad-Diff/pull/77#issuecomment-1021131665, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACADFOOCEUQFG3CE2XM75QLUX2IX7ANCNFSM5MC64N3A. You are receiving this because you modified the open/close state.