Generate roof plugin

This topic has been viewed 2463958 times and has 338 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
sire42
Posts: 1
Joined: Fri Apr 15, 2022 8:20 pm

Re: Generate roof plugin

Post by sire42 »

Hi,

thanks for proving this great software.

Regarding the roof plugin, the possibility to set multiple slopes would be nice indeed.

I noted, you wonder about user interaction for this, i.e. selecting the faces and directly setting the slope for the face.

I cannot help with this, but maybe for the first go, another approach is feasible as well:

I had a look into the code (currently, i am reluctant to setup a development environment to try myself *shame*), it seems the key entry point into the algo is the function getRoofFaces(...) with value "weigth" [sic]; so instead of the scalar value for slope, one would need to pass through an array/vector to use in the edges loop there as weight.

You may offer the user, for the beginning, two slope sliders. Adopt the code to pass both values as array/vector and in getRoofFaces just loop over this vector restarting at end ("wrap-around"). By this, you have already a solution for an arbitrary number of edges altering the slope every other edge. This can already cover for the most practical 4 edged roofs including sort of gable roofs if one slope is set to 90° (or close to 90°, I noted in the algo descriptions some possible concerns about singularities at this point).

This approach can be extended by simply extendending the slope vector, if once the user interaction is capable to cover arbitrary face slope setting so that eventually the slope vector length equals the edges/faces count.

best regards
User avatar
dorin
Posts: 824
Joined: Thu Apr 24, 2014 9:14 am
Country: Vatra Dornei, Suceava, Romania

Re: Generate roof plugin

Post by dorin »

News (no breaking)!
In the last several months I've made some kind of team with Daniels118.
That's mean I make a wish and he make it real.
Then I make it public like it is my work. In fact that's all my effort.
Anyway, it was a heavy time consuming and a lot of try and fail, than start from the beginning.

Finally new version 3.0 !

What's new (not to mach):
1. Individual face selection with mouse (thanks to Emmanuel & Daniele),
2. Individual face angle set (thanks to Daniele),
3. Add a Help button with some useful information (I've stole some codes from Daniele).
-Add Chinese translation (thanks to YGYL but incomplete at that moment, need updated).
As You could see I have nothing to do with this version.

Some screenshots and explanations (for new comings):
- Start from a selected room as roof projection (generated by Auto Dimensioning plugin or manually drawn)

Image

- Tools->Generate roof

Image

- You will see something like this

Image

- Select a face with mouse

Image

- Rotate roof and select other face.

Image

- Press Ctrl+click on other face

Image

- Click elsewhere to deselect all, select a face, then Ctrl+Click to select desired faces.

Image

- With this selected faces modify faces angle with the slider.

Image

- Make the same with other faces

Image

Image

- Click Ok to export roof on home

Image

- Open in Modify furniture -> Modify materials
Select all faces and set the desire texture

Image

- Select some specific faces and mark as invisible. Ok.

Image

- That could be the result

Image

Also on Source Forge
A computer program does what you tell it to do, not what you want it to do. Murphy's Law
When all else fails, read the instructions. Murphy's Law
If you don't like "AS IS", DIY. Dorin's law
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: Generate roof plugin

Post by hansmex »

Hello Team Dorin,

Thank you very much for this new version. It works, more or less.

I followed the steps in Dorin's message, and this is what happens:
- the plugin generates a correct roof
- the new interface appears with the angle slider
- however, the list with roof sections is not visible, and
- I cannot select individual roof parts in the 3D preview
- after clicking OK I try to apply textures
- when I select Modify Roof, I can apply textures to each individual roof section

Maybe you published version 2.9 instead of v3.0 ??

H
Hans

new website - under constuction
hansdirkse.info
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: Generate roof plugin

Post by Daniels118 »

Hi Hans,
the angle slider was already there in the previous version (2.5), the version 3 adds the faces list and the help button. If you click the help button you will see the current version. Also note that this version requires SH3D 7.0 or later.

Please be sure you have installed the latest version and don't forget to restart SH3D to let the changes to take effect.
If you have done the steps above and still experience problems, please post a screenshot of the GUI.
User avatar
hansmex
Posts: 4027
Joined: Sat Sep 26, 2009 11:36 am
Country: Netherlands

Re: Generate roof plugin

Post by hansmex »

It seems the plug-in doesn't replace the previous version, or maybe I did something wrong.

Seems to work like it should now, but I will test more in the coming days.

Once again, many thanks to Team Dorin :-)

H
Hans

new website - under constuction
hansdirkse.info
User avatar
GrahamI
Posts: 16
Joined: Tue Apr 21, 2020 8:46 am
Country: Australia

Re: Generate roof plugin

Post by GrahamI »

Does anyone have some samples of how to use this Plugin ?
Regards Graham
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Generate roof plugin

Post by Puybaret »

Did you look at the previous messages? Just try to reproduce some similar rooms.
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
GrahamI
Posts: 16
Joined: Tue Apr 21, 2020 8:46 am
Country: Australia

Re: Generate roof plugin

Post by GrahamI »

Hi Dorin,
I have a rectangular Roof and the Roof loads with the 2 Sides and the 2 Ends at 45°. I would like to change the angle of the 2 Ends to be a different angle. How can I achieve that please?
Regards Graham [:(]
User avatar
GrahamI
Posts: 16
Joined: Tue Apr 21, 2020 8:46 am
Country: Australia

Re: Generate roof plugin

Post by GrahamI »

Hi Dorin,
Please ignore my earlier message. I have now read your earlier message with illustrations and I believe the answer is in there.
Regards Graham
User avatar
GrahamI
Posts: 16
Joined: Tue Apr 21, 2020 8:46 am
Country: Australia

Re: Generate roof plugin

Post by GrahamI »

Hi Dorin,
Despite all attempts I am unable to Use your Plugin to create my Roof. I hope you will help me here ....
I'm wanting a 5m wide roof at the Northern end, running East/West and then 3 Ridges running North/South with an East/West wing over the Port Couchere in the South.
Can you help me with GenRoof please?

Regards Graham[img]http://[/img]
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest