[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!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Curved Path Stairs

Post by Kunda1 »

So cool!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
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 04, 2021 9:14 pm Thanks three_d :) If you have any ideas/suggestions feel free to chip in.
Hi ABeton, I would very much like to give my contribution to this work :D
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

Kunda1 wrote: Wed May 05, 2021 12:59 amSo cool!
Thank you :)
three_d wrote: Wed May 05, 2021 6:18 pm
ABeton wrote: Tue May 04, 2021 9:14 pm Thanks three_d :) If you have any ideas/suggestions feel free to chip in.
Hi ABeton, I would very much like to give my contribution to this work :D
That would be really great all help is welcome :) Things that need to be done are:
  • make a parametric Arch stair out of this macro(I do not have any experience with this, so I could use help/advice)
  • make a railing that would follow the stairs(also with rods)
  • later also to have an icon for the command(it would be best to have several different stair commands, similar to rebar commands)
  • when all is done, to have it all in wiki
Is there something you would like to do?

Also for the stairs, I did not have so much time to work on them, but... they are looking good :D They are actually mostly done, except that I dont know if I can fuse them nicely and refine them(at the moment each step is a separate object). Below are some cool pics and the code.

You generate the stairs by selecting each edge on a path(in a logical way) The edges you select can only turn in one direction for now, so you can make L or U stairs. With this code, you need to use a closed wire for the stairs, just select a path on this wire.
Attachments
Pasted Layer.png
Pasted Layer.png (238.94 KiB) Viewed 2677 times
Pasted Layer #4.png
Pasted Layer #4.png (251.24 KiB) Viewed 2677 times
Pasted Layer #3.png
Pasted Layer #3.png (220.44 KiB) Viewed 2677 times
Pasted Layer #2.png
Pasted Layer #2.png (277.55 KiB) Viewed 2677 times
New Stairs6.FCMacro
(2.91 KiB) Downloaded 66 times
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

Pasted Layer #1.png
Pasted Layer #1.png (192.33 KiB) Viewed 2676 times
Attachments
working_stairs.FCStd
(1.37 MiB) Downloaded 68 times
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: Curved Path Stairs

Post by three_d »

Very impressive work!!!

ABeton wrote: Thu May 06, 2021 8:10 pm That would be really great all help is welcome :) Things that need to be done are:
  • make a parametric Arch stair out of this macro(I do not have any experience with this, so I could use help/advice)
  • make a railing that would follow the stairs(also with rods)
  • later also to have an icon for the command(it would be best to have several different stair commands, similar to rebar commands)
  • when all is done, to have it all in wiki
Is there something you would like to do?
Maybe I could help with the first point, but first I think it is necessary to refine the steps by merging them into a single object.....and later I'd be happy to help you with such implementation if you agree.
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

I merged and refined the steps, unfortunatley computation times are not the best and there are a couple of problems I need to solve, it takes at least 15 sec to generate them, but still it is not bad :) If you could help me with the first point that would be great, how did you think to do it? Just a short description to get an idea :)

Also great work on the main stair tool(I saw it in the other thread), I hope it gets implemented soon!
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: Curved Path Stairs

Post by three_d »

ABeton wrote: Sat May 08, 2021 11:59 am .... If you could help me with the first point that would be great, how did you think to do it? Just a short description to get an idea :)
Hi ABeton,
I think your work could easily become a FreeCad parametric object.....to turn it into an object just follow the pattern of the "python feature" (for more details see here)

In brief:

- Define a class (in this case, it could be called "CurvedPathStairs"), where it will possible implement this object, which mostly you have already defined in your macro.

- Create a view provider class (e.g. "ViewProviderCurvedPathStairs") which defines how the object will be displayed.

In this manner, the object will be totally parametric.

ABeton wrote: Sat May 08, 2021 11:59 am Also great work on the main stair tool(I saw it in the other thread), I hope it gets implemented soon!
Thank you and look forward to seeing your progress. :D
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

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).

I checked the link you attached and I get it how it works in principle, when I finish with the bugs I will move on to make it parametric. I have an idea how to add railing later, but I am a little lazy to do it :lol:

I think that for FreeCAD to get more traction as real architecture software we need to solve the problem of making 2D drawings. This is a bit off topic, but now I see it should be our priority numero uno. I will finish the stairs first, then the modifications I started doing to the object library, and then all of us interested in architecture on this forum should see how to make 2D more user friendly for architects. At least to make a more detailed plan other people can reference later and understand how things should be done.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Curved Path Stairs

Post by paullee »

Good plan @Abeton
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

Thanks @paullee. Maybe we should have a thread in the forum dedicated just to 2D for architecture. There we could have a propper discussion about 2D, to see in what way we could make it work. At least to create a plan of action for starters, and to describe it all in detail.

Also we could gather links of old discussions there to have them as a reference. What do you think?
Post Reply