Skip to content

No size is changing #1

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

Open
tormyvancool opened this issue Apr 15, 2023 · 43 comments
Open

No size is changing #1

tormyvancool opened this issue Apr 15, 2023 · 43 comments

Comments

@tormyvancool
Copy link

KiCAD 7.0.1

i import any SVG.
Once imported: 2 clicks on it
then I click on the button.

I change the size, I click ok: no size is changing

@qu1ck
Copy link
Member

qu1ck commented Apr 15, 2023

I see KiCad imports svg as a group, which makes sense. You have to enter the group and select the polygons, make sure you see that polygons are selected in the statusbar of the pcb editor, not the group. Then the plugin works.

I'll see what I can do to make group selection work too.

@tormyvancool
Copy link
Author

I see KiCad imports svg as a group, which makes sense. You have to enter the group and select the polygons, make sure you see that polygons are selected in the statusbar of the pcb editor, not the group. Then the plugin works.

I'll see what I can do to make group selection work too.

I tried right now what you suggested. It doesn't work :-(

It'a pity because to import Logos and graphics in general, your tool was way helpful than the no-help from KiCAD.
I remember in the recent past (as soon as you have made it) it was working fine. I tried on one of my Logo.
But now it doesn't resize it any longer

@qu1ck
Copy link
Member

qu1ck commented Apr 15, 2023

Can you attach the svg file you tried? Because it works fine for me on a random svg file from the internet with multiple polygons.

@tormyvancool
Copy link
Author

Can you attach the svg file you tried? Because it works fine for me on a random svg file from the internet with multiple polygons.
ELETTRONICI-ENTUSIASTI-F

This is one, but all of them are behaving in the same way

Sure

@tormyvancool
Copy link
Author

Can you attach the svg file you tried? Because it works fine for me on a random svg file from the internet with multiple polygons.

I attached it in my previous comment.

@qu1ck
Copy link
Member

qu1ck commented Apr 16, 2023

Works for me, I rescaled some letters:

image

Make sure you select polygons after you've entered the group (double click on it).

@tormyvancool
Copy link
Author

Works for me, I rescaled some letters:

Make sure you select polygons after you've entered the group (double click on it).

it doesn't.
Please check this video ... I clicked 1 time, then clicked 2 times than double clicked ... nothing ...

OBS.16.April.2023.10.37.39.NV12.mp4

@qu1ck
Copy link
Member

qu1ck commented Apr 16, 2023

Hm... I do exactly what you do and it works for me.

Can you try manually drawing a single polygon on silkscreen and using the plugin on that?

Also post full kicad version info.

@qu1ck
Copy link
Member

qu1ck commented Apr 16, 2023

Also can you please provide these 2 things: the original svg zipped up (to eliminate the chance that github optimizes it when you upload it directly) and an empty board file with this svg already imported.

@tormyvancool
Copy link
Author

Single Polygon (a square): not working

.SVG in zip file: attached
ELETTRONICI-ENTUSIASTI-F.zip

.kicad_pcb file: attached
TESTforSVG.zip

Full KiCAD Info:
Application: KiCad x64 on x64

Version: 7.0.1, release build

Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 5.0.1
FontConfig 2.14.1
libcurl/7.83.1-DEV Schannel zlib/1.2.13

Platform: Windows 11 (build 22000), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Mar 11 2023 03:41:46
wxWidgets: 3.2.2 (wchar_t,wx containers)
Boost: 1.80.0
OCC: 7.6.2
Curl: 7.83.1-DEV
ngspice: 39
Compiler: Visual C++ 1934 without C++ ABI

Build settings:
KICAD_SPICE=ON

@qu1ck
Copy link
Member

qu1ck commented Apr 16, 2023

Thanks.

If it doesn't work even for a single manually drawn polygon then it doesn't work at all.
How do you have it installed, manually or through plugin manager? Does reinstalling it help?

If not I'll make a special debug version that generates a log file with details.

@tormyvancool
Copy link
Author

tormyvancool commented Apr 17, 2023

Thanks.

If it doesn't work even for a single manually drawn polygon then it doesn't work at all. How do you have it installed, manually or through plugin manager? Does reinstalling it help?

If not I'll make a special debug version that generates a log file with details.

I install all plugins through the plugin manager.
I also tried to uninstall it and reinstall it. But it still not working :-/

@qu1ck
Copy link
Member

qu1ck commented Apr 17, 2023

Please uninstall the plugin, install this file instead, enable debug logging in plugin and try to run it on a simple polygon.

TransformIt_v1.1-1-g5c614e6_pcm.zip

It should generate transformit.log in the project folder, post it here.

@tormyvancool
Copy link
Author

tormyvancool commented Apr 17, 2023

Please uninstall the plugin, install this file instead, enable debug logging in plugin and try to run it on a simple polygon.

TransformIt_v1.1-1-g5c614e6_pcm.zip

It should generate transformit.log in the project folder, post it here.

I installed as you suggested. But I don't see any transformmit.log in my project folder ... something is wrong.
I mean: i try to modify the graphics, but not any log file is generated

@qu1ck
Copy link
Member

qu1ck commented Apr 17, 2023

Did you enable debug log? If you don't see that checkbox that means you didn't install the plugin correctly.

image

@tormyvancool
Copy link
Author

Did you enable debug log? If you don't see that checkbox that means you didn't install the plugin correctly.

image

no because I'm dumb! Sorry I didn't notice that checkbox.
Now I used it: please here the log
transformit.log

@qu1ck
Copy link
Member

qu1ck commented Apr 17, 2023

For whatever reason the plugin does not recognize the item you have selected as something it can transform. There should be entry like this in the log:
2023-04-17 14:32:53,113 DEBUG: Transforminig shape type Polygon

Can you change the line 183 in plugin.py from this

        self.logger.debug(
            "Transforming drawing at %s", drawing.GetPosition())

to this (exact number of leading spaces is important):

        self.logger.debug(
            "Transforming drawing type %s (%s) at %s",
            drawing.Type(), drawing.GetTypeDesc(), drawing.GetPosition())

Then restart kicad and try the plugin again after selecting a polygon.

@tormyvancool
Copy link
Author

For whatever reason the plugin does not recognize the item you have selected as something it can transform. There should be entry like this in the log: 2023-04-17 14:32:53,113 DEBUG: Transforminig shape type Polygon

Can you change the line 183 in plugin.py from this

        self.logger.debug(
            "Transforming drawing at %s", drawing.GetPosition())

to this (exact number of leading spaces is important):

        self.logger.debug(
            "Transforming drawing type %s (%s) at %s",
            drawing.Type(), drawing.GetTypeDesc(), drawing.GetPosition())

Then restart kicad and try the plugin again after selecting a polygon.

I found the way. Bu it doesn't work. Please here the log
transformit.log

@qu1ck
Copy link
Member

qu1ck commented Apr 18, 2023

Well this time log is very different, you have obviously made different selection.

Can you make exactly same selection as for the last log, then open scripting console and type in following commands:

import pcbnew
list(pcbnew.GetCurrentSelection())

What does that print?

@tormyvancool
Copy link
Author

tormyvancool commented Apr 18, 2023

list(pcbnew.GetCurrentSelection())

This is the report form the Console. I just did the same I did before: double click on the imported SVG

C__Users_Tormy VanCool_Downloads_Report.pdf

@qu1ck
Copy link
Member

qu1ck commented Apr 18, 2023

This makes no sense. Everything seems right yet the log makes no sense.

Last try: I've added even more logging and am attaching a board with simple polygon and your svg. Please uninstall the plugin, install this version:
TransformIt_v1.1-2-g6730574_pcm.zip
Then restart kicad completely, open this board:
7.0_tests2.kicad_pcb.zip
And try to run the plugin first on the simple polygon above the logo, upload debug log for that and then on the logo after double clicking it and upload log for that (file gets overwritten every time you run the plugin so make sure to copy it somewhere between runs).

@tormyvancool
Copy link
Author

Polygon after clicked (no size is changed)
Polygon transformit.log

.SVG double-clicked
SVG Double Clickedtransformit.log

Video that illustrates what I did
KiCAD_RESIZE

@qu1ck
Copy link
Member

qu1ck commented Apr 18, 2023

Ok, wild idea but I think some other plugin is interfering with native python api.
I have no other explanation for what's happening.

Can you try temporarily moving all other plugins out of the plugin manager folder? You can get to that by clicking "open package folder" in plugin manager.

You can also uninstall all other plugins but it's easier to move folders.
Restart kicad after you do that.

@qu1ck
Copy link
Member

qu1ck commented Apr 18, 2023

Also would be interesting to see what these commands return (select the small polygon from my test board before running them):

import pcbnew
import inspect
polygon = list(pcbnew.GetCurrentSelection())[0]
polygon.__class__
inspect.getfile(polygon.__class__)
inspect.getfile(pcbnew.PCB_SHAPE)

These last 3 lines should output this:

<class 'pcbnew.PCB_SHAPE'>
'D:\\Kicad\\7.0\\bin\\Lib\\site-packages\\pcbnew.py'
'D:\\Kicad\\7.0\\bin\\Lib\\site-packages\\pcbnew.py'

Path may be different in your case but should be from kicad installation directory on both 2nd and 3rd lines.

@tormyvancool
Copy link
Author

tormyvancool commented Apr 18, 2023

Ok, wild idea but I think some other plugin is interfering with native python api. I have no other explanation for what's happening.

Can you try temporarily moving all other plugins out of the plugin manager folder? You can get to that by clicking "open package folder" in plugin manager.

You can also uninstall all other plugins but it's easier to move folders. Restart kicad after you do that.

Bingo ... I temporarily moved all the plugins except our one and now our one worked.

Here the COnsole after have run the lines you suggested (after have reinstalled all the plugins):
image

@qu1ck
Copy link
Member

qu1ck commented Apr 18, 2023

Great. Probably some plugin is overwriting pcbnew module with it's own classes which is a big no-no.
Try the scripting console commands above, they should point to the offending plugin.

Reisntallign all the plugins, and now runing yoru one after have selcted the olygon, I get this screen

Probably need to restart kicad.

@qu1ck
Copy link
Member

qu1ck commented Apr 18, 2023

Here the COnsole after have run the lines you suggested (after have reinstalled all the plugins):

Did you restart kicad after installing plugins again?

If you did and scripting commands I suggested still show same output then the only way to find the bad plugin is to remove them one by one, restart kicad each time and check if plugin works.

@tormyvancool
Copy link
Author

tormyvancool commented Apr 19, 2023

Here the COnsole after have run the lines you suggested (after have reinstalled all the plugins):

Did you restart kicad after installing plugins again?

If you did and scripting commands I suggested still show same output then the only way to find the bad plugin is to remove them one by one, restart kicad each time and check if plugin works.

Of course I restarted it.

Yes this is what I was fearing. I remove all and I reinstall them one by one.
I will be back when I'm finished

BTW if any plugin is overwriting classes of KiCAD the issue is KiCAD itself. It must not permit this.

IMPORTANT ISSUE: When I double click on your .PCB file, KiCAD is opening etc. But when I exit KiCAD, processes till active on the process manager. I have always to kill them manually.
I have to determine if it's KiCAD or twomehting on that .PCB

@tormyvancool
Copy link
Author

Found the cuklprit:

image

@qu1ck
Copy link
Member

qu1ck commented Apr 19, 2023

BTW if any plugin is overwriting classes of KiCAD the issue is KiCAD itself. It must not permit this.

It's not physically overwriting it, just swapping them in memory. There is no way to prevent it, such is dynamic nature of python and current plugin architecture with shared environment.

When I double click on your .PCB file, KiCAD is opening etc. But when I exit KiCAD, processes till active on the process manager. I have always to kill them manually.

That's again one of your plugins not cleaning up after itself.

Found the cuklprit:

Somehow I suspected it would be that one. Thanks for finding it, I'll research it on my end and file a bug with more details on their github.

@tormyvancool
Copy link
Author

When I double click on your .PCB file, KiCAD is opening etc. But when I exit KiCAD, processes till active on the process manager. I have always to kill them manually.

That's again one of your plugins not cleaning up after itself.

... that plugin always ...

@qu1ck
Copy link
Member

qu1ck commented Apr 19, 2023

Looks like kikit already fixed the pcbnew overwrite issue yaqwsx/pcbnewTransition@eb27d4b

Can you update your pcbnewTransition package to 0.3.4 ?
Run this in kicad command prompt: pip install -U pcbnewTransition

@tormyvancool
Copy link
Author

Looks like kikit already fixed the pcbnew overwrite issue yaqwsx/pcbnewTransition@eb27d4b

Can you update your pcbnewTransition package to 0.3.4 ? Run this in kicad command prompt: pip install -U pcbnewTransition

but there was not any update available... because to ANY update I do it.

@qu1ck
Copy link
Member

qu1ck commented Apr 19, 2023

That package is not part of plugin in kicad's plugin manager. It is managed by pip in python environment. Kikit instructions tell you to install kikit package with pip and that pulls in pcbnewTransition as a dependency. You have to manually update it witih pip command.

@tormyvancool
Copy link
Author

tormyvancool commented Apr 19, 2023

That package is not part of plugin in kicad's plugin manager. It is managed by pip in python environment. Kikit instructions tell you to install kikit package with pip and that pulls in pcbnewTransition as a dependency. You have to manually update it witih pip command.

ahem not really

image

it IS into the Package Manager :-)

EDIT I'm noticing it's not installing the very last version

@tormyvancool
Copy link
Author

and of course this link dosn't work

image

@tormyvancool
Copy link
Author

Ok I installed the version 1.3.0. No it's blocking your script

@qu1ck
Copy link
Member

qu1ck commented Apr 19, 2023

Please read what I wrote, I was talking about pcbnewTransition package. It's NOT in kicad's plugin manager. It's installed as a dependency of Kikit's pypi package which is ALSO NOT in kicad's plugin manager. There is a Kikit plugin package in plugin manager but it's a separate thing, updating it in kicad will not change any of your pypi packages.

So I repeat: run pip install -U pcbnewTransition in kicad command prompt to update that package to 0.3.4 where the bug with overwriting pcbnew module is fixed. Restart kicad after that.

and of course this link dosn't work

Report that on kikit's github.

@tormyvancool
Copy link
Author

pip install -U pcbnewTransition

Sorry for the misunderstanding.

I applied your suggestion: it doesn't work ...

So Fisrt:

I installed the KiKIT form the plugin manager
Then I gave pip3 install kikit from the console (as suggested on his page
Then I was back to the console pip install -U pcbnewTransition

I clsoed KiCAD, and reopened it.
I opened the PCB, double clicked on the SVG and tried to resize it. no way :-/

@qu1ck
Copy link
Member

qu1ck commented Apr 20, 2023

You are right, it's still broken

yaqwsx/pcbnewTransition#3

@tormyvancool
Copy link
Author

You are right, it's still broken

yaqwsx/pcbnewTransition#3

Please tell me when it will be sanitized ... so I can immediately test it and use it

@FrightRisk
Copy link

I am using version 7.0.5 of KiCad and have the same issue, Transformit doesn't work at all with any footprint. I also have KiKit installed, is that the issue? Right now I need Transformit more than I need KiKit. I uninstalled KiKit and Transformit works. Is there a fix yet? For now, I guess I can uninstall KiKit whenever I need Transformit. You can never thank someone enough for the effort to create tools like this, so thank you!

@qu1ck
Copy link
Member

qu1ck commented Jul 13, 2023

Yes, KiKit still breaks pcbnew api. I linked the bug above, if more people complain there maybe KiKit dev will respond :)

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

3 participants