Print at May 16, 2022, 6:01:53 AM
Posted by dorin at Oct 3, 2021, 12:51:04 PM
Generate roof plugin
In the series of YAUP: GenerateRoof plugin v1.0 alpha
!!! WARNING !!!

  • Fail on more than 90% of cases
  • Not all texture are correct rendered

Q:"Why you published like this?"
A:"It's a path trout jungle. Someone else could make a highway from this"

How I think to use:

  • Select a room (manually made or trout Autodimensioning))
  • Tools -> Generate roof... bla.. bla..
  • Set roof faces angle -> OK (optionally check inner polygons)
  • On preview click OK



Result something like this:


Now you have to set textures and texture angle:


Finally (if You have lack):


Don't forget!!!
It's an alpha stage AND
I'm not a programmer!

PS This is the test file .
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by hansmex at Oct 3, 2021, 2:04:46 PM
Re: Generate roof plugin
Your plugin works on the test-file, and also on a simple square house. That's a start.

The problem with the textures is not new. Maybe Puybaret will solve it some day.

Thank you for your hard work, I'm sure it will get better :-)

H
----------------------------------------
Dual boot - AMD FX6300 6-core, 16GB ram
Windows 10 Pro, SH3D 6.2 with 8 GB memory allowance
Ubuntu 18.04, SH3D 6.2 with 2 GB memory allowance

Posted by dorin at Oct 3, 2021, 7:16:29 PM
Re: Generate roof plugin
Thanks Hans!
As usual you are tolerant of me!
I'm sure it will get better :-)
I hope so also but not in my life time.
I think it's a wrong way (approach) or at least too complicated.
There are a lot of math which are over my helmet.
It's hard for a "One man show" and I need help. I haven't received any help so far and I don't think I will.
It is difficult to consult only with yourself.
I think to try with 3D plane approach but is not more simple.
My plan is to try another challenge: cross section plan.
We will see!!!
Thanks again for moral support!
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Puybaret at Oct 5, 2021, 10:21:45 AM
Re: Generate roof plugin
Nice first version. Congratulations! smile
As inner polygons seem to be generally accurate, I guess you are on the good path to fix most issues.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by dorin at Oct 5, 2021, 8:20:22 PM
Re: Generate roof plugin
Thanks Emmanuel!
inner polygons seem to be generally accurate

Of course, are made with your code from PlanControler.
The part responsible with roof computation (partially mine, partially stolen) don't work as expected.
I will let this path for other volunteers(if any).
As I've already say, I will try another approach (if the life time hope permit).
I've study about 3D Plane equation for few weeks and appear is not so complicated as seems at first view.
For this version I've work in frog, with out a plan and try, test and fail without a clear target.
The main path remain the same:
roof projection -> compute roof -> create shape -> add to Home Plane.
Now I'll try to be more clearly organized. I've start to make a logical diagram for this plugin like in '70+ years. I will put it here when I have first version.
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by YGYL at Oct 10, 2021, 8:50:26 AM
applause   Re: Generate roof plugin
The reason for the texture error is that the texture coordinates are calculated incorrectly
-----obj example--------
mtllib Exemple9.mtl
g 1_1_1_1_1_1
usemtl default
v 4496.651 683.83997 1944.5
v 4080.21 267.83997 2360.941
v 5405.8 267.83997 2360.941
v 4739.619 582.83997 2045.1409
v 5090.0 582.83997 2045.1409
vn 0.0072383927 0.71531975 0.6987598
vn -0 0.70748127 0.7067321
vn 0.0048255385 0.7128935 0.7012557
vn 0.0072383634 0.7155777 0.6984956
vn -0 0.708003 0.7062094
vt 2.572153 3.0108545 0
vt 4.0783777 0.0 0
vt 4.0783777 4.7945237 0
vt 2.9361613 3.52434 0
vt 2.9361613 4.7916303 0

f 1/1/1 2/2/2 3/3/3
f 4/4/4 1/1/1 3/3/3
f 4/4/4 3/3/3 5/5/5
--------------------
5 polygon vertices V, corresponding to 5 VT
Bring 5 V's into 3D space,The apex of a partially sloping roof can be seen.

But it is not easy to calculate the correct texture coordinate value, and I don't know
There are such UV tools in other modeling software

Posted by Pelmenik at Oct 29, 2021, 5:12:27 AM
Re: Generate roof plugin
like this plug-in.
I tried it with a 25deg hipped roof for an L shaped house and it worked well. To set percentage and angle for a corrugated texture for each roof section was quick. Now I will attach the flashings and other details.

My usual way to make a roof is by deciding the roof angles, calculate walls for each roof section, .obj, and then lay them into each other at the decided angles and then attach flashings and any other details.

Posted by dorin at Dec 25, 2021, 10:33:03 PM
Re: Generate roof plugin
clown In the series of YAUP: Generate Roof plugin v.1.0
Don't expect too much!
As I promise I've try another approach: planes intersections.
There is advantages and disadvantages.

Anyway few words and pictures for this version:
It work for few simple roofs: rectangle and shape L, T, S, F(as described here).
Don't work as expected on complex shapes like E or round.
The angle could be adjusted before add roof to home plane.
The blue edges could be made invisible when You set texture.

BUGS:
-Sometimes make SH3D unresponsive;
-Texture coordinate are wrong on north faces;
-The interior face of roof are transparent.



Also on SurceForge .
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Puybaret at Dec 25, 2021, 10:47:01 PM
Re: Generate roof plugin
Nice gift for Christmas! Thank you Dorin smile
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by bdfd at Dec 26, 2021, 7:47:33 AM
sad   Re: Generate roof plugin
Hi,

Thank you for this first try.

After downloading and installing this plug-in, it works one time (for the garages) and not twice (for the main house) !

After done many tries, I think that I found first bug... biggrin



Why ?

Good luck and HNY !

sad
.
----------------------------------------
SH3D 6.6 and nothing else - W11 64b
Core i9-9900KF (4.0 GHz), RAM 32 Go DDR4 3 Ghz, MSI GeForce RTX 2080 8Go

Posted by dorin at Dec 26, 2021, 6:48:24 PM
Re: Generate roof plugin
Hi, bdfd.
1. I'm glad You try it and surprisingly work!!!
2. You've right, it's a bug.
"Why?"
When I make this I consider to be only one building in home plane.
The last picture I've post (with more buildings) I have to correct manually this bug.
Select all on newly Roof-gen level (roof & room under roof), cut and paste on first Roof-gen level. Then You delete the empty level.
3. I know is full of bugs and the worst was discovered by Hans.
It appear don't like the very regular shapes and fail.
When I make it I've tested on relatively complex shapes considering, on regular shape to work implicitly. I'm wrong!
Unfortunately, after ~6 month of work 10~12 h/day to this, I need a break.
4. This approach seems to be also a dead way.
Probably I need to learn python to convert Polyskel library or bpypolyskel with which maybe I don't need to reinvent the wheel.
Happy New Year to everybody!
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by crackwood01 at Jan 31, 2022, 2:52:31 PM
Re: Generate roof plugin
Hi Dorin,

here, nothing is happening at all, and i have no preview window

Posted by crackwood01 at Jan 31, 2022, 2:57:58 PM
Re: Generate roof plugin
Hi Dorin, here's a video of what's happening, any idea?

https://screenrec.com/share/Re8dEtCFX0

Posted by dorin at Feb 1, 2022, 11:30:24 AM
Re: Generate roof plugin
1. Thanks You try it and share a video.
2. From video I've see few things:
2.1 The plugin work and show some errors (red arrows)
2.2 You use the alpha version; try to use v1.0
3. Also v1.0 will fail in some situations.
4. I work to new version but it took to long for only one man (when solve something I broke other thing and so on)
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by crackwood01 at Feb 6, 2022, 3:27:47 AM
Re: Generate roof plugin
Hi Dorin,

i can't update the alpha version to 1.0 .. when i download the file, it says that plugin is installed but nothing happens.
I can't locate the installation folder to uninstall the plugin because i paid the full version on microsoft store .. any idea?

Emmanuel?

Posted by crackwood01 at Feb 6, 2022, 3:33:40 AM
Re: Generate roof plugin
Edit: found the installation folder

Posted by crackwood01 at Feb 8, 2022, 12:45:07 AM
Re: Generate roof plugin
Hi Dorin,

first of all i have to say: you're a great programmer and i really love your "YAUP"s!

You really manage to create a useful plugin here!

can't wait to see more of this plugin, we all know that SH3d is a great tool but suffers of lacks of "architectural" functions,
with a improved side view plugin and and improved roof plugin, and who knows a stairs plugin. SH3d will become an handsome tool!

All of the plugins proves that there is a way to achieve such things

can't wait to see more:

i hope someday we could choose wich type of roofs

in the meantime, i have achieved to some roofs




Posted by Gildaniel at Feb 11, 2022, 2:21:29 PM
Re: Generate roof plugin
Hi Dorin!

You so cool, with your usefull plagins!!!!

I tried, there are some issues with empty edges (yellow)

Also it could be great to mark somehow basic room sides in order roof to be opened on those

Or, may be, to generate all kind of edges and once, and one can make transparent those edges he doesnt need to show in his case (blue)



Posted by Wiebenor at Feb 12, 2022, 12:56:59 AM
Re: Generate roof plugin
Hello, I have a problem where if I try to add a roof to my building, the generate option is grayed out, any idea how to get it to work???

Posted by Wiebenor at Feb 12, 2022, 12:58:07 AM
Re: Generate roof plugin
One thing I forgot to mention is that I technically don't need the roof, it's just that for the thing that I am currently working on I would like to have a roof to give it a more complete look in a walkthrough of the outside of the building

Posted by Wiebenor at Feb 12, 2022, 9:00:07 AM
Re: Generate roof plugin
Ugh... I got the button to ungrey, by selecting my building, but it doesn't seem to do anything. Now, are we supposed to select the walls, or the "room" that outlines the entire building? I've been selecting the "room" but IDK why it won't even appear to do a single thing, if that's what you are supposed to use to activate the roof plugin.

Posted by Gildaniel at Feb 12, 2022, 1:52:14 PM
Re: Generate roof plugin
You need to draw big room around your external walls, which is your future roof projection. Then select this room and use plugin

Posted by Gildaniel at Feb 13, 2022, 5:21:52 PM
Re: Generate roof plugin
Fast making precise roof overhang projection with help of walls thikness method:

1. Draw your walls
2. Сhoose "room" and dobleclick on external walls there are room creating with the same contour.
3. Then you can change wall thickness in Parameters, to specify roof overhang, if needed.
4. Choose "walls" and doubleclick on the room - SH creates second walls contour
5. Choose "room" once again and doubleclick on new walls contour - now you have room projection; just delete outer walls to see it

Here is video https://www.youtube.com/watch?v=Uwt3G-8FMyE

Posted by dorin at Feb 13, 2022, 8:30:01 PM
Re: Generate roof plugin
Fast making precise roof overhang projection

Use AutoDimensioning plugin
where I've include this feature.
just delete outer walls to see it

Use Select Hide Utility plugin for selections.

I steel work at a new version of Roof Generator.
Meanwhile try to avoid collinear lines on Your roof projection.
Will fail like in Gildaniel video.
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Gildaniel at Feb 14, 2022, 8:57:51 AM
Re: Generate roof plugin

Use AutoDimensioning plugin
where I've include this feature.

Use Select Hide Utility plugin for selections.



Very usefull plugins, Dorin, how I could miss them!

Are you planning in your roof plugin some method to check sides of projection to be opened roof?

Like here


Posted by dorin at Feb 14, 2022, 7:49:13 PM
Re: Generate roof plugin
@Gildaniel
Also You don't have last version of Multiplier plugin

@Gildaniel,@crackwood01 and others
1. I want to thank You all to test it!
2. I'm not a programmer!
Emmanuel, Tobias, Enko, the new coming Daniels118 and others are REAL PROGRAMMERS. I'm only a fake.
3. I like Your proposed roofs but, even could appear simple, are not so with out a lot of user interactions.
Maybe someday, somebody (younger) will program this.
4. At that moment we have almost nothing decent usable and this task appear to be a nut too hard for my teeth.
5. Along others I try to solve problem with:
- co-planar planes
- rounded parts which have a center
- compute point order of roof faces polygons
6. Don't expect too much from me.
7. Maybe to beg Daniels118 to translate Polyskel library from python to java 1.8
8. When and IF we will have an usable roof generator I hope to can modify it in preview window.
9. From ~40 model of generic roofs I reduce to ~8 from I chose hipped roof which I think could be made from few clicks.
10. Don't ever expect to made in the same way La Sagrada Familia
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Wiebenor at Feb 15, 2022, 12:47:51 AM
Re: Generate roof plugin
You need to draw big room around your external walls, which is your future roof projection. Then select this room and use plugin


sooo... i'm just selecting the interior room when i shouldn't be? if i then make a room that extends outside the building, it should work?
i'll upload a picture of what i have so far, so you can see if you can spot any glaring problems, aside from the obvious need for an external sized room


not sure how to upload photos here exactly so ill link to it, as well as try to use the image linker system used here, so sorry if theres more than 1 copy


[img]https://i.ibb.co/yYLY8Ds/vaca-hires.png[/img]


hopefully one of those worked, but we'll see. bottom of picture is front, unfinished works of a playground is on the right

Posted by Wiebenor at Feb 15, 2022, 1:01:45 AM
Re: Generate roof plugin
so... i did the making a bigger room method of creating a roof, but it still doesn't bring up any roof building menu, like i understand the plugin should

Posted by dorin at Feb 15, 2022, 6:37:28 AM
Re: Generate roof plugin
The plugin work in this order:
1. Select 1 or more rooms. If are more only first will be computed.
2. Menu->Tool->Generate roof...
Recommendation 1: try on a test file, eventually with file provided on this page.
Recommendation 2: install AutoDimensioning plugin, read instructions , and, if You have some walls, will generate roof projection for that walls.

NOTE 1: If roof are not generated correctly, try to modify a little bit the foot print to avoid some edges to be collinear.
NOTE 2: Even so will not work all the time!

PS: I've try to reproduce Your building and with v.1.0 work!
Verify in Help->About Your installed version.
The result are not total correct (some faces) but it work.
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Daniels118 at Feb 15, 2022, 6:38:23 AM
Re: Generate roof plugin
Hi Dorin,
you're doing a great work with this plugin. About the polyskel algorithm, there is an excellent Java implementation which also have an interesting feature that could be used to build roofs opened on one side as the one asked by Gildaniel. You can see the code in action here.

Posted by dorin at Feb 15, 2022, 7:45:20 AM
Re: Generate roof plugin
Thanks Daniel! I've see it first and than Polyskel implemented in Blender.
Booth have some dependencies which I don't know how to pack in a plugin.
Also I prefer to use the dependencies of SH3D.
Thanks for help!
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Daniels118 at Feb 15, 2022, 12:13:22 PM
Re: Generate roof plugin
If you feel the campskeleton API suits your needs I could try to pack all required classes in a single java project that you can directly reference in your plugin. The sw is licensed under Apache 2.0, so it can be modified and included in a GPL v3 licensed plugin.

Posted by Wiebenor at Feb 15, 2022, 4:42:48 PM
Re: Generate roof plugin
The plugin work in this order:
1. Select 1 or more rooms. If are more only first will be computed.
2. Menu->Tool->Generate roof...
Recommendation 1: try on a test file, eventually with file provided on this page.
Recommendation 2: install AutoDimensioning plugin, read instructions , and, if You have some walls, will generate roof projection for that walls.

NOTE 1: If roof are not generated correctly, try to modify a little bit the foot print to avoid some edges to be collinear.
NOTE 2: Even so will not work all the time!

PS: I've try to reproduce Your building and with v.1.0 work!
Verify in Help->About Your installed version.
The result are not total correct (some faces) but it work.




The size of the building I am making is around 268ft long in the left to right direction, if that helps any... I believe I have the autodimensioning plugin, and will try that, but as for you getting it to work, depending on what faces work, it might work in my case, as the roof is just to make the building feel complete in any pictures or videos made.. also remember, that my playground will be the big thing that will be the focus, as the building is already built, but I am doing a design for my church, who's kids are supporting another church in building a playground, so I thought I'd take the rudimentary mspaint looking drawing with post-it notes and added pictures, and try making a quick 3d design...

Posted by Wiebenor at Feb 15, 2022, 4:50:09 PM
Re: Generate roof plugin
Also, in case you're wondering, I did try with a demo house plan or two that came with the program and it worked just fine

Posted by Wiebenor at Feb 15, 2022, 5:01:24 PM
Re: Generate roof plugin
On second try of doing a roof in a demo house, I didn't get it to work, so I think I tried before and it didn't work, sorry for my bad memory... Also just tried autodimensioning, and it didn't work, plus I am using v1.0 of the roof plugin... Is there some other plugin I'm missing, or perhaps a system file that or update, is not present is needed???

Posted by dorin at Feb 17, 2022, 11:21:53 AM
cool   Re: Generate roof plugin
@Daniels118
Sorry for late response!
0. Manny thanks for Your availability to help me!
1. You're right, campskeleton are Weighted straight skeleton which are more useful for YAUP.
2. I imagine an interface like Furniture materials BUT to modify face angle (maybe also the texture) before added to plan.
3. Could be also invent a new kind of furniture (roof) with some specific properties (I don't know how and which) to be able to modify after inserting in plan.
4. I'll be very happy if I could have this java file added to plugin as separate class with ALL dependencies (jutils + etc) or adapted.
5. In such case my job are reduced to make graphic interface and insert object in plan cool dancing
YES I ACCEPT YOUR OFFER!!! wink
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Daniels118 at Feb 17, 2022, 4:58:32 PM
Re: Generate roof plugin
Hi Dorin,
I think editing a roof after it has been placed could be a plus value. A possible way to implement this could be to encode the generating perimeter along with any user supplied parameter within a custom property attached to the roof object (custom properties can be added with the standard API, see setProperty and getProperty methods in com.eteks.sweethome3d.model.HomeObject), so that you can rebuild the perimeter later even if the user deletes the generating room. Since properties can be made only of strings, all the required information have to be serialized/unserialized in order to be stores/retrieved.
I'm not completely sure about the fact you have to code only the user interface, since from my understanding the library only generates 2D coordinates, so you also have to figure out a way to compute the vertical position of the points. Another open point is the texture mapping, however this could be solved later.
That said, I'm going to put my hands on wink

Posted by Daniels118 at Feb 17, 2022, 8:09:46 PM
Re: Generate roof plugin
Hi dorin. The bad news is the campskeleton library requires the Java compliance level 8. The good news is SH3D runs on Java 8+ on 99.9% of computers biggrin Many thanks to Emmanuel for having confirmed this so quickly!

Here you will find a zip file which contains 2 Eclipse projects, you must import them into your workspace as "existing projects" and choose "load from archive":
  • campskeleton_allinone is the project you have to include in your plugin project;
  • campskeleton_plugin is a test plugin (see below).
The campskeleton library requires the java.vecmath package, which is already included in SH3D, so I have added a dependency from the SH3D project which is not included in the archive, hence you will get a build path error. You could download the source code of SH3D and import it into your workspace to satisfy the dependency, or download just the vecmath package, it's up to you. It must be on the build path, but you haven't to include it in the sh3p package. When building the sh3d package be sure to include all the files from the campskeleton_allinone project.

The example plugin adds the "CampSkeleton" item under the "Tools" menu. It will simply display the example editor from campskeleton (the one you seen in the video) already initialized with the selected room points:


If you have trouble to setup the workspace just let me know.

Posted by dorin at Feb 18, 2022, 8:47:36 AM
Re: Generate roof plugin
Hi Daniele!
Let's start with good news: WORK!!!
After few modifications (work only with rooms in clock wise) and I fix it.
Work with ALL my files used for test including some improbably shape.
Now some TODO:
-this version is the stable one which don't allow negative value for weight (like we see in the demo video).
I have both and I'll try to update current files You have share.
-somewhere in org.twak.utils is a import_obj.py file used to import obj+mtl files in Blender.
That's mean somewhere this files are generated. I'll see where.
If so is all I need to pass them to exportObject(). It's too good to be true!
-for 3D I've see this in src.
All this mean I've have to start work from 0 the roof plugin and it's OK.

Thanks again for priceless help!!
Dorin
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by ndorigatti at Feb 18, 2022, 10:23:39 AM
Re: Generate roof plugin
Hi dorin, hi daniele, i'm not enough inside the plugin dev, but reading last dorin message I have this:

Given what the campskeleton generates, in order to generate 3d view, if you can get the "lines" that are inside the generated geometry you could "elevate" nodes inside the polygon and you have a 3d object similar to the old version of the plugin, right?

If campskeleton allows you to get all the nodes (did not see the code, but nodes are part of the maths usually), i can find those inside the polygon by using the raycasting technique (basically for each point you draw a line bigger than the polygon max size, and you check how many times it crosses the polygon, if odd is inside, if even outside).

I'm sorry I can't help on the dev part, i have small kids and never have time to use my pc when not at work :(

Posted by Puybaret at Feb 18, 2022, 11:04:43 AM
Re: Generate roof plugin
Dorin, about some roof parts which looks like missing, I always wondered if it wasn't due to the generated shapes which two faces wouldn't be visible (back and front faces). The default settings in Java 3D is to cull (hide) back faces. If you want to change this, just create an instance of PolygonAttributes, call setCullFace(PolygonAttributes.CULL_NONE) on it and use it to change the appearance of the shape with setPolygonAttributes.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by Daniels118 at Feb 18, 2022, 11:33:30 AM
Re: Generate roof plugin
@dorin
this version is the stable one which don't allow negative value for weight
Sorry, I didn't realize negative weights wasn't available in this version. Hope you can get it work, otherwise just ask.
for 3D I've see this in src
You're right, I didn't see yet the code when I wrote about vertical positioning of the points. Looking at the video published on the research project page referenced on github I've learned the library is born specifically to build roofs, so now I'm expecting it is 3D-ready.

@ndorigatti
Thank you for your effort, but in the end it seems the vertical position comes out of the box (see above).
Anyway, I like exploring other solutions, so let me expose some thoughts. The method you proposed is easy to implement for simple shaped roofs, but it would require some kind of guessing for complex shapes, because not all inside points should be elevated by the same amount. If you look at the 2D image in my previous post, you can easily end up that the right side of the roof won't be as tall as the left side. This doesn't mean the method is wrong, it just means it requires some degree of intelligence, which require some effort to implements. Maybe we could come to a complete solution in 10 minutes, maybe not. Since the library developers seem to have already solved this problem, you could look at the code to understand how they did, if it really is of your interest.

Daniele

Posted by ndorigatti at Feb 18, 2022, 1:22:59 PM
Re: Generate roof plugin
@Daniels yeah, i see. TBH my idea was just to get the "inner" part of the roof and elevate it using the same logic dorin developed previously, not that i'd use raycasting to get the elevation.
But given there is already a solution for 3d in campskeleton, it's perfect to start from that.

The only thing (as a user) I'd like to see in a plugin like this is the possibility to move/change the control point and specify the elevation for different parts of the roof (obviously with some limitations). It comes in my mind a very basic but similar thing to the terrain editor developed by Puybaret.

As soon as my kid starts to sleep alone and early, I'd look into the code happily ^^

Posted by sjb007 at Feb 18, 2022, 1:40:51 PM
Re: Generate roof plugin
* Where I put a number in {}, i.e. {2.0} I'm, referencing https://wiki.openstreetmap.org/wiki/OSM-4D/Roof_table which is a great reference for thinking about all the various roof forms.

Couple of requests to add for consideration if at all possible:
1. If I understand the principle, moving the big yellow dots changes the angle of projection away from the perimeter line. If so, it'd be useful to have an overlay showing what that value is.
2. On each perimeter line have the ability to disable that plane of roof. This would be good for gable ends {2.0} with already peaked walls below, or unusual roof shapes.
But otherwise this looks awesome. Now all we need are rooflights! laughing
A couple of other pie-in-the-sky ideas coming to me:
3. A segment or points get an elevation parameter which I think would allow half-hipped {2.3}, and saltbox {3.0} and "cutouts" {3.0 free outline example}, but that may not be possible based on the library.
4. A slightly easier idea for half-hipped and the like is to use two rooms. Room one uses the campskeleton to generate the planes, and room two is used to clip the generated roof. So the campskeleton segments for the half hipped ends are further out, and the clip room segments are closer in, causing that stubby little end plane. I hope that made sense.

Posted by dorin at Feb 19, 2022, 6:41:46 PM
Re: Generate roof plugin
@Emmanuel
1. PolygonAttributes I've set it starting with v.112 and I've solve to don't see the sky through the roof when in virtual visitor.
Also from v.117 I've fix the elevation problem observed by bdfd.
2. The missing part from roof faces are really missing.
The blue lines have to mark the edges; are not wire frame lines.
I don't make an mechanism for treating errors and at the moment is ALL or NOTHING!.
Nothing when at least one face are null, nothing happen on screen.
The incomplete faces are wrong defined but have at least 3 points in place of 4 or more.

@ALL FRIENDS
I'm surprising how many people want to help me. MANY THANKS!
At that moment I'm still trying to continue on that direction because I think it wort.
Some description:
-I steel use plans intersection like in v1.0 but I add also the offset polygons and edge intersection from v.1.0 alpha.
-From plans I have 3D points and superpose it over 2D points from edge intersections.
-Planes help me to know to which face belong the point and give me the height but it give me also too many points.
-To compute face I have to identify point-by-point from start to end.
To reduce points numbers and put it in the correct list I identify few problems:
--Co-planar panes intersect other plans in the same point and I need only one in that position
--When roof are circular or only same parts are arc circle I need a list with centers (that's I work now)

About use of this YAUP (my vision):
-Generate bottom roof; copy and paste at specified elevation (roof thickness);connect with a border in a single object.
All this make by plugin.
-Then modify resulted object moving point, edge or faces.
Could be useful the option to insert/delete.
Of course the points up and down have to be synchronized.

Only for developers or for anyone curios Roof Work
It's 2 folders compressed; one eclipse with current work version (132) and second with files for test.
Could be good as references.

When we consider this way is a dead way maybe me or some of You will start over.
I want to thanks again to everybody!
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by dorin at Feb 24, 2022, 4:55:27 PM
Re: Generate roof plugin
Some few improvement in Roof work v135
1. The archive contain 2 folders and an sh3p file.
-one folder with eclipse work (with a lot of aid lines)
-one folder with more precise test files
-one plugin file without aid code
2. I've improve 2D intersections but it is more to do
3. On last post I don't explain very clear what I intend to do:
-* What is given? and what is required?
* Given: a roof footprint (room)
* Required: compute roof faces (3D closed polygons)
- Get all information from what is given:
--points, lines, lines angle, angle between lines, lines length
--get user input (general roof angle)
- Try to solve request:
--compute offset polygons and edges in 2D
--compute edges intersections in 2D
--compute planes from 3 points (2 lines points and 1 point at 100cm at angle)
--compute 3D intersection of 3 planes
--compare intersections 3D with 2D and make 3D points lists for every face
--compute 3D polygons, point-by-point, from 3D points from every face, based on indexes of planes
4. Normal users MUST use it with care!! Is not finished(yet).
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by dorin at Mar 2, 2022, 7:07:23 PM
Re: Generate roof plugin
I know is not the moment to boring You while the whole world have other concerns.
Few improvement since previous. Roof work v.137
As usual: 1 folder eclipse, 1 folder with test files and a sh3p.
WARNIG!!! Those who what to use plugin file don't forgot to remove previews versions.
Few screenshot with good and bad:








----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by dorin at Mar 10, 2022, 6:15:09 PM
Re: Generate roof plugin
New version 2.0 and on Source Forge
Finally I've give up to reinvent the wheel.
Thanks to Tom Kelly for his campskeleton , a professional solution. It work on more than 95%
Thanks also to Daniele who help me and point me on right direction.
Of course could be improved but not by me.
Problem: steel don't compute texture coordinate correctly.
**Don't forget to to remove previews versions.**




----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Puybaret at Mar 10, 2022, 7:15:48 PM
Re: Generate roof plugin
Very nice and impressive results! My favorite is of course the SH3D roof wink
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Mar 11, 2022, 1:54:11 PM
Re: Generate roof plugin
Congratulations!!

For someone who can't program, you made a VERY nice plugin.
Thank you very much :-)
----------------------------------------
Dual boot - AMD FX6300 6-core, 16GB ram
Windows 10 Pro, SH3D 6.2 with 8 GB memory allowance
Ubuntu 18.04, SH3D 6.2 with 2 GB memory allowance

Posted by Vidium at Mar 11, 2022, 4:34:16 PM
Re: Generate roof plugin
I've been watching your progress and was impressed from the beginning. I'm stunned you have improved the function to this level. Amazing guy. Thank you!

Posted by dorin at Mar 12, 2022, 7:22:34 PM
Re: Generate roof plugin
Thanks to all!
But let's be fair:
1. The real hero is Tom Kelly who transpose the straight skeleton theory and improve it to weighted straight skeleton implementation in java.
I've try many times to read and understudy this but I fail.
2. Without the Daniele's plugin adaptation I'll never be able to do it.
3. What I've done was to make some weak solder between this sources and SH3D.
So that's all. Not big deal!
From my side is an unconditional surrender. If my attempt to make a new algorithm have succeed it would have been really amazing but...

On the other hand:
I encourage every one to try to make plugins for this software or new software in any language. It keep brain in function.
You can even use my method to steal and modify the work of others.
"Never say never"
I think it's time to give way to the youngest.
Majority of You are younger or around my boys children edge and they have also kids.
I'm born decade before the computer age so now it's Your time. Don't waste it!
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Daniels118 at Mar 13, 2022, 1:08:02 AM
Re: Generate roof plugin
@Dorin
You're fair, nonetheless you made a GREAT work. I've seen "programmers" that would never achieve such results even in a thousand years.
Well done! applause

Posted by dorin at Mar 16, 2022, 2:06:22 PM
Re: Generate roof plugin
@Daniele,
Thanks but there is few problems:
1. Wrong texture;
2. Use full power of CampSkeleton.

1. I don't know how to make texture to be correct rendered.
It is a lot of terms and ordered sequences which I don't know.
I still try but I don't see a good result without help.
There are people who (I suppose) could do this (@enkoniyto, @ndorigatti) and maybe others.

2. Implement:
-2.1 Individual faces angle but for this I need:
--- to be able to select face in preview (similar to texture manager) but with mouse;
--- to add a slider for selected face, synchronized with an input box for precise value;
--- to add an reset button (to 45dg) for all faces.
--- to implement dynamic roof generation in moment You move slider or insert value.
--- I prefer a Model Preview Controller (like in main software) than to rewrite it again.
-2.2 Compute polygons with holes (like B or 8 or D)
--- for this could be selected more than 1 room but with smaller area than exterior roof projection and with all points inside projection.
--- first must verify IF CampSkeleton really can compute this. There is a file for this but I don't know if and how it work.

The most important and urget (for me) is 1.

Do You like my dreams?
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by Daniels118 at Mar 16, 2022, 3:04:14 PM
Re: Generate roof plugin
@Dorin
About the the point 2
To make everything easier you could consider to separate the user input from the 3D preview. I mean you could reuse the 2D editor that comes from campskeleton to handle the user input; since it already works out of the box you haven't to spend any effort to make it work (see my example project). The 3D preview would be a plus.
Of course this is just a hint to reduce the amount of required work, I don't want to change your vision of your project.

Posted by dorin at Mar 20, 2022, 9:15:39 AM
Re: Generate roof plugin
New version 2.5 code-name "DL"
Unfortunately this plugin left YAUP category and go to Normal Plugins.
That happens when professional are implied. Thanks to Daniele who make 99% of work.
For this I owed him a truckload of beer d oh

News:
-bug fix in texture computation - @autor Daniele
-elegant solution to correct faces name - @autor Daniele
-remove blue edges when roof are exported - @autor Daniele
-add a slider in place of spin box
-replace "Refresh" button with "Reset all to 45dg"
Now You don't need to set a rotation angle for texture, just select 1, few or all and set texture at once.

Reminder of usage:
-select a room (supposed to be roof footprint)
-Tool-> Generate roof...
-change angle as how You like -> OK
-on 2D plan select object, Modify furniture, modify materials and set what texture you like.

If You try to modify texture globally from first texture button will don't work as expected!
Don't forget to set 3D view to show all levels.



Also on Source Forge
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by hansmex at Mar 20, 2022, 10:40:46 AM
Re: Generate roof plugin
Dorin,

We should erect a statue for the King of Roofs !!

The latest version works very, very well.

I tested on a few complex roofs without any problems.
Even the L-shaped roof with exactly equal sides now generates correctly.

Textures apply correctly and are orientated the way you expect. (Please send subroutine to Puybaret for inclusion in main program).

I see two remaining problems:
1 - The yellow border underneath the roof. It doesn't appear in the furniture list, so we can't change it (for the time being).
2 - The Autodimensioning plugin generates rooms for all walls, even when I select "Selected walls only".

Thanks you!!

Hans
----------------------------------------
Dual boot - AMD FX6300 6-core, 16GB ram
Windows 10 Pro, SH3D 6.2 with 8 GB memory allowance
Ubuntu 18.04, SH3D 6.2 with 2 GB memory allowance

Posted by dorin at Mar 20, 2022, 1:52:42 PM
Re: Generate roof plugin
@Hans
The statue have to be a trinity: Emmanuel, Tom, Daniele.
Surrounded with a fancy and me, at gate, selling tickets to those who want to make selfies with them.
Back to be serious.
Textures apply correctly and are orientated the way you expect. (Please send subroutine to Puybaret for inclusion in main program).

I do if I have any clue "which" and "what".
Daniele try hard to teach me but he finally realize how dump I am and provided me the code.
Emmanuel is smart enough to knew what to do.

@1. It's a ordinary room. Make roof invisible and modify it or delete it.
I've insert it to don't let the roof on the air and to have a contrast.

@2. The AutoDimensionig have to be improved and You have right as usual.
I've also see it but I'm not able to be multitasking.

Thanks but tanks have to go to trinity guys.
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

Posted by YGYL at Mar 21, 2022, 4:36:37 AM
Re: Generate roof plugin
Thank you very much!
It is recommended to add the Auto Dimensioning plugin for generating roof room areas to the Generate Roof plugin. Using 2 plugins for one thing will be confusing to most people

Posted by dorin at Mar 21, 2022, 10:22:35 AM
Re: Generate roof plugin
@YGYL
Thanks You test it!

1. All my plugins intend to be some tool box not Swiss army knife.
If You have something to fix in Your house, usually You need different tools from different toolbox (screwdriver with different heads, hammer, pliers etc.)
I don't think some of this are useless any time and could convert a hammer in screwdriver to have all in one finger.

2. I've add roof projection on Auto Dimensioning for two reason:
-- sometime is required in 2D plans in REAL LIFE
-- there are a lot of necessary subroutines which exist already

3. Auto Dimensioning is useful especially for round walls;
For relatively normal house You could draw roof projection by hand and don't use AD plugin.

4. Could You imagine and explain me how a user could interact with program?
-where to make click, then where and what to input or draw something, what program ask next and so on.
-maybe a scratch of UI and some explanations
Don't forget:
A computer program does what you tell it to do, not what you want it to do

5. If You help me to continue version 1 (with plane intersections)
it could be possible to use directly walls and their slope to generate more complex roofs.
Or You could provide another source code for this to contribute to this community.
----------------------------------------
A computer program does what you tell it to do, not what you want it to do. Murphy's Law (Greer's Third Law)
When all else fails, read the instructions.Murphy's Law

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