Italy
Joined: Nov 17, 2021
Post Count: 466
Status:
Offline
Re: Floor have huge size in svg (tens of Mb)
What follow is non a solution, just some considerations useful for further analysis.
It seems SH3D encodes the pattern for all the walls in a single PNG image when exporting to the SVG format (the PNG is embedded into the SVG). This means even if you have just 2 small walls, the farther they are, the larger the image will be. Now this shouldn't be a great problem, because PNG supports compression and the blank space between walls is prone to give high compression ratios.
The problem is the PNG image is produced without compression
In fact, I have achieved small file size even without resampling the PNG, just running an optimizer.
I will take a look to the code responsible for the exporting, but maybe Puybaret already know where and how to fix the issue.
Joined: May 18, 2021
Post Count: 255
Status:
Offline
Re: Floor have huge size in svg (tens of Mb)
Not sure why, Daniel, but it seems I'm your nemesis
I have an architects floorplan as a background image in a big SH3D file I've been working on. It seems that your SVG Tuner really doesn't like that image. It just never finishes exporting after many minutes. It works in a few seconds without the plugin. If I disable the background containing layer, it works OK with your plugin, so it seems specifically linked to that background image. Last symptom is if I cancel a stalled export, then try a second export, nothing happens after selecting the file name. It would suggest something went badly wrong, and the function is no longer callable somehow.
Nothing in the logs from your autologger plugin.
Amazing job of pumping out these plugins by the way.
Italy
Joined: Nov 17, 2021
Post Count: 466
Status:
Offline
Re: Floor have huge size in svg (tens of Mb)
Not sure why, Daniel, but it seems I'm your nemesis
AHAHAH Please check the cpu usage using the task manager while exporting to svg. I suspect that compressing that image could be too heavy for the compression algorithm. I was expecting there might be problems, so I figured out a way to change the default settings without rebuilding the plugin. You could try to decrease the compression level by starting sh3d with a java property named png.compression,it accepts integer values in range 0-9 (the default is 9).
Joined: May 18, 2021
Post Count: 255
Status:
Offline
Re: Floor have huge size in svg (tens of Mb)
I used:
.\SweetHome3D.exe -Dpng.compression=0
Which should be no compression as I understand it. Anyway, same issue. The export never completes, the same as without the parameter, and the process cpu usage sticks at betweeen 16 and 20%. (I have a 4C/8T mobile i7.) The svg file is created, but 0 KB still after >10 minutes. I'll leave it running a while, but I think it is borked still.