Print at Feb 3, 2026, 11:56:59 PM

Posted by Puybaret at Oct 8, 2013, 9:10:31 PM
Re: Sweet Home 3D 4.2
You have always tried to keep the user interface as simple and intuitive as possible. [...] Asking users to define an SVG path, in my opinion, is far beyond the capabilities of most users.
I perfectly agree and that's why I propose two ways to get the cut out shape of a door: automatic from the 3D model or with a SVG path. Miserably, the automatic way has some limits that you may have not discovered and that the SVG path can fix. For example, if you try to import the Round door frame, you'll see that it won't work correctly because the frame is not closed at its bottom.

[...]I would be happy to time the speed difference between, say, 10K, 25K and 50K vertices.
Thanks for your nice proposal, but measuring this directly in the program is easier and more accurate. wink
In the example you provided, the time necessary to compute the contour of the 3D models it contains was the following:
t = 2 ms for 2604 vertices
t = 3 ms for 3429 vertices
t = 61 ms for 5984 vertices
t = 73 ms for 3873 vertices
t = 116 ms for 211656 vertices
t = 153 ms for 59268 vertices
t = 198 ms for 66311 vertices
t = 605 ms for 13080 vertices
t = 625 ms for 114630 vertices
As you can see, the more vertices a 3D model counts, the more time is necessary to compute its contour. But the 3D model with the largest vertices count is not the one that took the most time!
Anyway, I increased the max vertices count to 1 million in the current beta, but keep in mind that if you want to reduce this contour computing to 0 second, you can still specify the doorOrWindowCutOutShape property. I noted that there are still some problems with some round doors too, that I'll fix soon.

What if that contour calculation is done just once, when the shape is imported into the library or inserted inside the house, and stored then as cached additional data for the model?
I already introduced some kind of cache for cut out shapes. It's initialized at the first use of a model in a project or when the file is reopened. It could be improved by saving the cut out shape in files too, but I prefer not to have to program a SVG exporter for this at this moment.


Sajmmon, defining the SVG path for the cut out shape has to be specified with the new doorOrWindowCutOutShape# property that you can add for any door or window in the PluginFurnitureCatalog.properties file of a SH3F file. I might add the matching text field in the next version of the Furniture Library Editor if necessary.


By the way, the Beta 5 fixes also a bug that prevented to export to SVG under Java 7 / Linux. And thanks to JogAmp team, the beta can work with Java 7u40 under Mac OS X. Many thanks to Sven Gothel for the bugs he fixed recently. At the opposite, I removed support of Java Web Start under Java 6 / Mac OS X, because there's too many bugs that I fear Apple will never fix. Fortunately, these bugs don't happen with Java 6 when Sweet Home 3D is run from its .app bundle or its Jar executable file.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator