Better algorithm for creating pitched roof (probably)?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Better algorithm for creating pitched roof (probably)?

Post by Roy_043 »

In a different Arch_Roof related topic this was mentioned:
kisolre wrote: Tue Nov 03, 2020 7:35 am SlopedPlanesMacro as first suggestion.
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Better algorithm for creating pitched roof (probably)?

Post by ebrahim raeyat »

Roy_043 wrote: Tue Nov 03, 2020 10:05 am In a different Arch_Roof related topic this was mentioned:
kisolre wrote: Tue Nov 03, 2020 7:35 am SlopedPlanesMacro as first suggestion.
Thanks, I didn't think that this macro has such abilities. I must read the code.
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Better algorithm for creating pitched roof (probably)?

Post by ebrahim raeyat »

Roy_043 wrote: Tue Nov 03, 2020 10:05 am In a different Arch_Roof related topic this was mentioned:
kisolre wrote: Tue Nov 03, 2020 7:35 am SlopedPlanesMacro as first suggestion.
I worked a little with this tool, but it seems also it has some bug that i can't find why this happens, but by using my algorithm, we can quickly create a roof with no error, if the user want to open the above of roof, we can cut the roof with plan.

roof.gif
roof.gif (840.15 KiB) Viewed 2510 times
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Better algorithm for creating pitched roof (probably)?

Post by Roy_043 »

ebrahim raeyat wrote: Thu Dec 03, 2020 9:24 am my algorithm
Where can I download your code? I looked on your Git but couldn't find it there.
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Better algorithm for creating pitched roof (probably)?

Post by ebrahim raeyat »

Roy_043 wrote: Fri Dec 04, 2020 7:54 pm
ebrahim raeyat wrote: Thu Dec 03, 2020 9:24 am my algorithm
Where can I download your code? I looked on your Git but couldn't find it there.
I created the repo:

https://github.com/ebrahimraeyat/PitchedRoof
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Better algorithm for creating pitched roof (probably)?

Post by ebrahim raeyat »

I changed the base of roof to sketch, now if user input polygon as base of roof, i convert it to sketch and set it as base of roof:
roof.gif
roof.gif (887.6 KiB) Viewed 2384 times
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Better algorithm for creating pitched roof (probably)?

Post by yorik »

Wow, that looks impressive... I'm really grateful for people wanting to develop stronger basic algorithms :) That's really something sorely needed in many areas of BIM/Arch...
Andrew Haas
Posts: 6
Joined: Mon May 06, 2019 8:49 am

Re: Better algorithm for creating pitched roof (probably)?

Post by Andrew Haas »

Hi,

I am Ebrahim's development partner in this tool! :)

What we are aiming to do is create a comprehensive tool for creating all types of roofs. The code is available on the repo Ebbrahim has created for it. When it's all done, we hope for it to be considered for inclusion in the Arch/BIM workbench.

At the moment we are working on a way to "split" the roof to achieve different pitching points, and eave overhangs.

We want this to be achieved with the miniumum of user imput.

the best I can come up with is this workflow:

The user traces the RED outline;

Image

The nominates the green "splits":

Image

The tool creates the BLUE outline, which the skeleton script uses to create the roof:

Image

Image

The script then extends the roof planes down to the RED outline.

Image

This is the best I can think of. Any Ideas?
Last edited by Andrew Haas on Mon Dec 07, 2020 12:44 pm, edited 2 times in total.
Andrew Haas
Posts: 6
Joined: Mon May 06, 2019 8:49 am

Re: Better algorithm for creating pitched roof (probably)?

Post by Andrew Haas »

The other way of doing it, would be to have the user trace the "Blue" line, and create a tool to extend the roof planes where required.

I don't like this option because it requires too much knowledge to accurately determine the pitching point on complex roofs.
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Better algorithm for creating pitched roof (probably)?

Post by ebrahim raeyat »

yorik wrote: Mon Dec 07, 2020 12:16 pm Wow, that looks impressive... I'm really grateful for people wanting to develop stronger basic algorithms :) That's really something sorely needed in many areas of BIM/Arch...
Thanks, @yorik, I have been to use this python library for recognizing edges:

https://github.com/Botffy/polyskel

seems it's not supported different angle for each edge, but there is a library that do it, I mentioned in this post:

https://forum.freecadweb.org/viewtopic. ... 91#p441891
Post Reply