|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Generate roof plugin » » » » Post: Re: Generate roof plugin |
Print at Dec 16, 2025, 9:07:30 AM |
| Posted by sire42 at Apr 15, 2022, 8:54:08 PM |
|
Re: Generate roof plugin 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 |
|
|
Current timezone is GMT Dec 16, 2025, 9:07:30 AM |