[Working Macro][work in progress] Curved Path Stairs

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Curved Path Stairs

Post by paullee »

@bitacovir should be interested, and probably a number of others !

See how it goes :D
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

Cool, I will make a thread :D
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: Curved Path Stairs

Post by three_d »

ABeton wrote: Tue May 11, 2021 1:07 pm Thank you for the advice three_d and sorry for the late response. There are some annoying bugs I have been trying to squash :lol: I will simplify the tool to work with only closed wires selected(first I wanted to do any kind of wire, but it is not practical).
Hi ABeton, don't worry.....I guess that it's not easy to implement a complex object such as curved stairs....good luck :)

ABeton wrote: Tue May 11, 2021 1:07 pm I think that for FreeCAD to get more traction as real architecture software we need to solve the problem of making 2D drawings....
paullee wrote: Tue May 11, 2021 1:53 pm @bitacovir should be interested, and probably a number of others !

See how it goes :D
Hi paullee
That's right, I find it really very interesting and stimulating and I think that it will be extremely useful :)
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

I was not able to solve some problems :? But stairs work in a most cases. Some limitations:

- when drawing a stair path it is important that you draw lines from start to finish of the stairs
- if drawing sketches and using arcs stairs only work if you do it consecutevly in counter-clockwise direction(with wires there is no such problem, it is only important that you draw lines from start to finish of the stairs)
- stairs are created from closed wires(either sketch or draft)

I would like to have them fully functioning just in sketcher but I dont know how to solve the arc problem. Try out the macro and let me know what bugs you find. Also if you get some ideas how to solve some of them that would be great.
Attachments
New Stairs11.FCMacro
(5.09 KiB) Downloaded 61 times
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: [Working Macro]Curved Path Stairs

Post by ABeton »

Well... I can say that that the main problem is fixed :D Stairs work qute well with almost all edges in sketcher(I had a problem only with b-spline).

It was actualy a simple fix. The problem was how edges in a sketch are sorted. So the fix was to create a new wire out of the selected edge and sort it, it was two lines of code :lol: Anyway, test it out and let me know of the results. There is an "align" option in the macro if you get some errors when creating the stairs just change the value and see if it works. Options are "left" and "right".

10.png
10.png (291.62 KiB) Viewed 2547 times
Attachments
New Stairs13.FCMacro
(5.14 KiB) Downloaded 68 times
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [Working Macro][work in progress] Curved Path Stairs

Post by balrobs »

Hi @ABeton,

I tried your Macro and I can say it's cool stuff. Compliments to you and thank you for picking up this challenge.
Here are some thougts/suggestions:
- sometimes it was difficult for me to predict where the stairs will start and where they will end ... I couldn't understand the logic behind it.
Edit: Just realized that respecting the right path order and choosing the right alignment do the trick :mrgreen:
- sometimes to optain the desired result I had to make several tries ... inner path, outher path, left align, right align.
- in some cases the Macro fails if certain dimensions are too small (see red stairs with small distance between flights, i.e. 35cm in attachment).
- as you already mentioned sometimes splines actually have some problems.

Despite these minor issues, I think your tool can be a huge help for modeling stairs.
BTW is there a way to control step dimensions and therefore step numbers in the zones between the flights?

Thank you again and kind regards
stairs.png
stairs.png (58.61 KiB) Viewed 2516 times
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: [Working Macro][work in progress] Curved Path Stairs

Post by three_d »

Excellent!
I just tried your amazing work :D
I tested different types of the stairs...but as you already know, it takes some time to build them. For the rest, everything worked fine and without any major problem.

Thank you very much for great work that you've done!
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: [Working Macro][work in progress] Curved Path Stairs

Post by ABeton »

balrobs wrote: Fri May 14, 2021 2:51 pm Hi @ABeton,

I tried your Macro and I can say it's cool stuff. Compliments to you and thank you for picking up this challenge.
Here are some thougts/suggestions:
- sometimes it was difficult for me to predict where the stairs will start and where they will end ... I couldn't understand the logic behind it.
Edit: Just realized that respecting the right path order and choosing the right alignment do the trick :mrgreen:
- sometimes to optain the desired result I had to make several tries ... inner path, outher path, left align, right align.
- in some cases the Macro fails if certain dimensions are too small (see red stairs with small distance between flights, i.e. 35cm in attachment).
- as you already mentioned sometimes splines actually have some problems.

Despite these minor issues, I think your tool can be a huge help for modeling stairs.
BTW is there a way to control step dimensions and therefore step numbers in the zones between the flights?

Thank you again and kind regards
stairs.png
Thank you very much balrobs :)
  • Yes I get your first point, it would be more logical that stairs are created in the order you select the edges rather than in the order you draw them. But I am really an amateur when it comes to coding so this was the best I could do :lol: It is not perfect but I hope it is usable.
  • Unfortunately it is necessary to just try things out until it works with the tool. Because of the way how this macro is designed it is necessary to manually change the alignment of the stairs. I tried to make it automatic but the calculation time is really long then, so I just left the manual approach. I would like to refine the stairs later, so they become parametric and that users can change all the options in the property menu.
  • For the third problem, I think I fixed it now. I don’t have the macro here now but when I do I will attach the fixed one.
  • And yes the splines are problematic. I really don’t know what could be the cause of that
There is no way to control the number of steps between the flights. At the moment all steps are at an equal distance from one another. I am not sure how could such an option be programmed.
three_d wrote: Fri May 14, 2021 5:53 pm Excellent!
I just tried your amazing work :D
I tested different types of the stairs...but as you already know, it takes some time to build them. For the rest, everything worked fine and without any major problem.

Thank you very much for great work that you've done!
Thank you, it means a lot :D

Yes the biggest drawback is the computation time. It is mostly because of all the boolean unions that are done in the background. Best not to go over 50 stairs.

I will focus on some other things now, primarily the BIM Object Library, to improve it a bit. So I will work slowly on the stairs from time to time(it is better to mix things up when coding, working just on one thing gets boring :lol: ). But yeah the plan is to make them parametric later and add a couple of more options to them. Also if I manage to make a railing that would be cool.
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: [Working Macro][work in progress] Curved Path Stairs

Post by paullee »

Seems good have a team here to code, test, find bugs, comment etc. !!! Looks really great, keep going :D

Hope @yorik might have a look and give some direction !
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: [Working Macro][work in progress] Curved Path Stairs

Post by ABeton »

paullee wrote: Sat May 15, 2021 4:01 pm Seems good have a team here to code, test, find bugs, comment etc. !!! Looks really great, keep going :D

Hope @yorik might have a look and give some direction !
Thanks :) Yes getting feedback is really important when making something like this, thanks people :D

And yes I hope Yorik could give some advice, I have much to learn about programming in FreeCAD.
Post Reply