Slow performance when working with graphics converted to polygons

Interesting. I have a core duo PC with Windows 10 pro. I used Kicad 8 and upgraded to 8.01 rc1 (x64).
In my last three PCB projects, while learning to use Kicad, I had no trouble with speed but yesterday I started a new project and find at every operation it takes 9 seconds to recover. Everything freezes while those 9 seconds pass.

This is the same PC, same OS and same version of Kicad, yet suddenly it does not respond for that time while an operation executes. Maybe a Windows Update has affected it?

I am doing the same type of unusual work; I am taking a retro copper design from an image, converting it to a Gerber file, importing it from Kicadā€™s GerberViewer, exporting to PCB designer, then selecting and removing points along the edges of the traces. (The image conversion creates hundreds of points wherever there is a curved or angled edge.)

Before now, say February to March, I could repeatedly right-click a point, choose ā€˜Remove Cornerā€™ and go to the next one; no delay at all.
Now, suddenly, I select a point, click ā€˜Remove Cornerā€™ and the programme freezes for 9 seconds. The cpu steps up in several increments to 50% while the operation is running, then drops.
I found the same freezing happens if I move a ā€˜cornerā€™, to straighten out a slanting line/edge of a copper trace.

So this is very odd. Anybody else noticed this? Has anybody tracked down a Windows update that may be connected?
Nothing else on my PC seems to be affected, so I donā€™t want to change anything at this stage.

SteveT,

Yes, I agree. In what I am experiencing, the mouse pointer still moves. It is the crosshairs icon of Kicad that freezes, along with any response in Kicad.

Well! Suddenly, it fixed itself just now. I was crawling along, as described, and it just removed a corner and moved the crosshairs immediately.
Itā€™s back to normal.
I checked windows updates; none have just gone in today, or yesterday. (It occurred to me that an update may have been delaying the operation; but then it would have affected everything, whereas this was only Kicad that was freezing.)

A puzzle then.

You might want to consider changing the Accelerated Graphics Setting (it can make a significant difference depending on the Computer/Systemā€¦). On a few occasions after updating Kicad, my setting was automatically reset and I needed to re-set it)

Preferences>Common

Yes, in my case I checked it was set to Accelerated Graphics.
It just began freezing again. Maybe it is the track I am working on. I just worked on a shorter, narrower track and it was fine.
Then I moved to a much larger area of copper that goes across half the PCB. That freezes when I move it or remove a corner.

I just changed to Fallback Graphics; no improvement; changed back to Accelerated Graphics.

Understand what Aliasing/etc does and how it works (Google it). Youā€™ll learn the ā€˜Speedā€™ depends on the obvious hardware/system capability and the Pixels and graphic content.

This is especially True/Important if having Mixed graphic items (such as WRL and how/what Kicad (other)) does with them.

Kicad (on my system) has No ā€˜Fallbackā€™ selectionā€¦

This points even more strongly to a bug in KiCAD.

@Wellington : try updating to the most recent testing version for windows. There was a (already fixed) bug on gitlab with similar symptoms. Most probably caused by ratsnest/copper zone calculation.

latest testing versions: Downloads | KiCad EDA
Take the ā€œliteā€ version and simply install. It will overwrite your recent v8.0.1 version, but leaves all settings/libraries in their current state.

additional note: your issue is completely different from the issue in the original opening post (different editor, different behaviour). In such cases itā€™s better to open a new thread instead of just adding on the end of a existing thread.

Hi,

Sorry about the wrong thread; I thought it was so similar to be the same.
I see now, itā€™s better to put a new thread for it then if a developer later finds itā€™s the same, they can join them somehow. :slight_smile:

Iā€™m downloading that 8.0.2 rc1.5 right now, thank you.

EDIT: Ok I just tried it = a marked improvement. It freezes for only 6 seconds now, rather than 9. I can live with this right now, as some tracks are faster. So the fixes in this version definitely speed it up towards normal,even if not fully yet.

I really appreciate the fast response you gave and the tip on trying the new RC1.5.
Itā€™s like the kind of response I used to give to clients in the tech support area I headed a few years ago.
Thanks again.

1 Like

Is this a very complex board with many zones?

It freezes for only 6 seconds now

waiting 6 seconds is better than waiting 9 seconds, but this is still not a real solution. Either the bug is fixed only partly (for all my boards the bug is gone) or itā€™s a different bug. If possible please attach a zipped project archive, so that a reproduction on a different computer/user is possible.
Or you open a gitlab bugreport yourself. (only useful with a example project).

RC-TX-PCB.rar (374.9 KB)

OK here is the PCB project I am working on. I am smoothing out the zones/traces after converting the original old image to a Gerber.

The largest zone, from left hand side and wrapping around to top and bottom is the slow one.
I have done other PCBs with zones like that, but is it possible that this one has so many corners that it slows down the progress? The thinner traces are almost instantaneous.

I noticed that if I toggle this zone between filled and unfilled, it takes a while to process that too.

@Wellington

I seprated your topic from my own thread because the cause of your slowdown is very different from the topic I created myself.

Iā€™m looking now at your PCB:

And I see a few issues.
First, doing what you are doing now in KiCad is a horrible workflow. Apparently you imported some bitmap image, and then converted it into graphical polygons in KiCad. (Or maybe you used some other program to vectorize the bitmap). The problem with this approach is that everything are still graphical entities. When this was one of my own projects, I would only use PCB Editor / Place / Add Reference Image to import a graphical representation of your PCB, and I would re-create everything else with native KiCad items. Doing this (once you are though the learning curve of working efficiently with KiCad) is quicker and much more versatile then attempting to work with graphics objects. I assume you also have a schematic of this project (even a .pdf version or bitmap is just fine). Making this a real KiCad project would require entering the schematic too. This is important because it creates the netlist, and that is what tells KiCad how to separate different nets from each other. For example, for your big zone. I usually draw a pentagon around the PCB, tell it to connect to the GND net, and KiCad does all the rest. It creates a clearance from the outline of the PCB, and it also calculates all internal geometry for you. Using native KiCad items such as footprints, also creates solder mask, solder stencil, silkscreen and other layers with practically no extra effort. Those are all a result from using parts from KiCadā€™s libraries. If you are interested in this approach, then create a new topic for it, to keep this topic with the performance issues you are experiencing.

The other issue, and the topic of this topic is the slow performance of deleting corners from your graphical polygons. I am also experiencing a huge performance hit when deleting corners from the big (presumably GND) polygon. I am guessing that it is a caching problem, but that is a wild guess.

I could delete 21 corners in one minute (after assigning a hotkey to the ā€œdelete cornerā€ function. So my Ryzen 5600G is not much quicker then your old core duo.

Hi paulvdh,

Thanks for looking at my files. So it seems the performance hit is linked to the huge number of points in the graphics, eh? Thatā€™s understandable then. If it is unavoidable with this type of work then Iā€™ll accept it.

By the way, I realise this is not the efficient way to develop a new PCB with Kicad. I have done some nice jobs like a UAV relay control board by placing the footprints etc. and the 3D view of the finished PCB is extremely useful too.
What I am doing with this current project is a historic recreation, like a couple of other projects I have done. They started in a magazine in the 1970s or 1980s, when only an image of the copper traces was available.
Retro RC electronics are very popular now and keeping to the original copper trace design is an important part of recreating the PCB. Itā€™s a bit like comparing building a brand new house, using modern materials and techniques, with restoring an old cottage that is 300 years old, using original materials and design etc.

So the object is to use the original, historic copper design and convert it to a useable, practical set of files that allow production of a PCB in todayā€™s world. I found a programme called ImageToGerber that converts images to a Gerber file and that started me off in converting these.
I know itā€™s a lot of work because the images are rough with lots of corners, but after my clean-up work it is a nice clean copper pattern, just like the original historic design.
I have had a few boards produced of another project similar to this one and they are just like the original historic designs; great.

Thanks again for looking into the issue. If there is nothing that can be done to speed it up then thatā€™s ok.
Kicad is still a great programme and well conceived and produced. Well done.

KiCad is a bad choice for generic image manipulation. This part is a dangling open end, because many PCB related features are also competing for implementation, and that is where the focus of KiCad is.

How do you intend to create solder masks and such for your footprints? I guess that doing most of the work in a generic image manipulation program is a better choice. I think it is possible to:

  1. Do vectorization in Inkscape, clean up the curves there.
  2. Import the generated SVG into KiCad.

And still, even first creating a ā€œnormalā€ KiCad project (including footprints, which have solder mask cutouts, etc) and then adding some curves to make the PCB look more like the old version may also be an option. Have you seen the ā€œMelting KiCadā€ video from Mitxela?

Ah, a solder mask is unnecessary for these old style PCBs. The components were all through-hole type and inserted by hand then soldered by hand. Thatā€™s where part of the enjoyment lies for the original electronic project people.
Solder masks only became necessary for machine assembly and soldering.

Your suggestions are interesting though. I will look at this melting video to learn.
I have certainly done a mixed approach, where I added footprints and then adapted the traces a bit to match.
Cheers.


(Edit: Nice video! I loved it; and it gives me food for thought! Thanks for this).

I donā€™t want to interrupt your talk with paul too much, but I think itā€™s possible that your attached project really exposes a kicad bug. Iā€™m able to reproduce the ā€œsome secondsā€ freezing during deleting a corner point of that big polygone. The same happens if you move that polygone.
The freezing does not happen if you simply copy the polygon into a different, fresh new board. This indicates that itā€™s not only the big number of corner points, but multiple reasons together.

If the project is free I would open a new gitlab issue (with the project attached).

1 Like

My workflow would be to place the components in the exact original positions and place straight tracks with the same connectivity as the original. Once I had a functional PCB, I would then use the Round Track plugin for the curved traces to look right.

2 Likes

Yes, OK, since you think there just may be a bug here, I created a Gitlab case as you recommended.

 kicad/code/kicad#17820         and I attached the project, as you said.

Paul, Iā€™m sure you donā€™t mind. I think we have got as far as we can right now and it may be beneficial for someone to look into it, since he has recommended it.

Cheers.

1 Like

A direct link to the gitlab issue:

I donā€™t know why I could have any objection. Itā€™s more the other way around. I just un-bookmarked this thread, because intended to make a bug report myself if you would not respond.