Netherlands
Joined: Sep 26, 2009
Post Count: 4000
Status:
Offline
Re: Thoughts about roof-plugin
Your description of an algorithm is just the start. The truth is quite a bit more complex. The OSM list describes many roof types, but hardly covers everything.
Take a look here : this kind of house with dormers, and many different roof sections is quite common in the US.
Trying to write a plug-in that could make such a roof wouldn't be easy.
France
Joined: Nov 7, 2005
Post Count: 9423
Status:
Offline
Re: Thoughts about roof-plugin
Thanks for the roof document link, it gives a good idea of various roofs and their parameters. But to ensure you reach your goal, you should probably start with a few roof simple models.
I would suggest that you inspire yourself from ShapeGenerator plug-in source code (it's included in the plug-in), i.e. create roof shapes with Java 3D classes, then export those shapes at OBJ format with OBJWriter class, finally create a HomePieceOfFurniture instance and add it to the edited home. If you need to keep some parameters for the computed roof to update it afterwards, feel free to set your own properties on the HomePieceOfFurniture instance.
As it's possible to rotate objects around an horizontal axis, you could also try to create a roof by assembling flat boxes and triangles, but I think this will be more complicated to program.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Aug 31, 2012
Post Count: 11
Status:
Offline
Re: Thoughts about roof-plugin
yes i know its just the description of the general idea. And you can't cover every roof type. But your link would be covered by my idea. The most complex thing i see is to get the align of the subroof right. But i wouldn't go for absolute perfection in the first Version. There are still the current ways.
Joined: Aug 31, 2012
Post Count: 11
Status:
Offline
Re: Thoughts about roof-plugin
Hi, I have a first draft for the roof designer at the bottom of this post. You draw the gabel and enter your properties in the dialog.
Currently i just use a polyline and store all informations in the properties. The next step is to generate a roof object from that informations.
I'm not really happy with the polyline approach. But I have no better idea how to draw and store the gabel at this moment. My goal is that you can see the gabel in the plan.
Joined: May 12, 2013
Post Count: 1545
Status:
Offline
Re: Thoughts about roof-plugin
Very interesting (even if I agree with the posts saying that it will be complicated in the real world)
Several years ago I briefly used some software or other (IMSI Floor plan, I think), with an automatic roof option. For a simple roof, on a simple plan, it worked beautifully. But was not much help when it came to a plan with more than two walls of equal height and two walls with a gable.
On the other hand, my guess is that a simple roof might still be useful. And to that effect, your approach with a clean interface looks very good.
So - yes - idea very interesting. Looking forward to trying anything you come up with.
France
Joined: Nov 7, 2005
Post Count: 9423
Status:
Offline
Re: Thoughts about roof-plugin
It's great that you could start to program this plug-in. The polyline is a nice way to get some coordinates by reusing existing features of Sweet Home 3D. I would suggest that you request to draw this line in a clone of the current home that will display only walls. You could display this clone in your dialog box with your own plan component / controller, using subclasses of PlanComponent and PlanController classes (VideoPanel class uses for example a subclass of PlanComponent). If you're interested by this, just ask for more details.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Italia
Joined: May 12, 2017
Post Count: 65
Status:
Offline
Re: Thoughts about roof-plugin
This thread is very interesting and I'm following this! I would like to have the time to help, but I neither have the time to update my home unfortunately.
I currently created custom components for my roof, and i do have a dormer that "cuts" half of the roof to create space for a big door window. I would also point out that usually (at least here where i live) roofs extends over the walls and covers also the outside!
Joined: May 12, 2013
Post Count: 1545
Status:
Offline
Re: Thoughts about roof-plugin
do you mean something like this?
Not even that, where the other software failed was a little, rectangular cabin 22m² with a gabled roof. So far so good. However, my father had built a 9m² annexe on the long side with a roof angle different from the main construction. This I could never create with the automatic roof function in the other software.
Now even if I had to make the roof myself, the result was much better in SH3D.
My point being - that even a simple automated roof can be a great help. But I agree with hansmex and the others, that getting (even slightly) more complicated designs to work, may not be possible.
ok
P.S. Maybe hard to see, but to the left of the building the roof is slightly different. So with SH3D I could get the roof right. (Sorry, this is an old image from an old thread .)