[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!
Post Reply
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

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

Post by ABeton »

Curved Path Stairs

A new way to create parametric stairs which would be created from a path and a closed sketch.

How it works:
User creates a closed sketch(in a logical way) and selects the path lines on this sketch. Stairs are generated according to the path and would have the shape of the closed sketch.The macro is works now, but needs to be polished and needs a GUI.

Notes:
  • when drawing a stair path it is important that you draw lines from start to finish of the stairs
  • stairs are created from closed wires(either sketch or draft)
  • 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"
Previous detailed discussion here: https://forum.freecadweb.org/viewtopic.php?f=22&t=58023

11.png
11.png (381.41 KiB) Viewed 3727 times
12.png
12.png (252.24 KiB) Viewed 3727 times
13.png
13.png (88.32 KiB) Viewed 3727 times
Attachments
Curved Path Stairs (no GUI).FCMacro
(5.14 KiB) Downloaded 79 times
Last edited by ABeton on Fri May 14, 2021 9:57 am, edited 1 time in total.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Curved Path Stairs

Post by paullee »

That's really cool !

I wish the ideas of different 'types' of stairs as discussed could be further refined and implemented, so a uniform codes in modular approach could be made for further extendibility :)
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Curved Path Stairs

Post by bitacovir »

Cool!
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

I think we can do it, first to make working stair algorithms and than to incorporate them into the stair tools. I saw in Revit that they have a stair button and when you click it opens several diferent buttons which all make stairs in different ways. Something similar we have with Aray tools in the Draft workbench where they are all grouped under one Array button.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Curved Path Stairs

Post by paullee »

Great! Hope can get back to this party when there is a gap :D
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

Yeahh I hope so too, more people working on Arch is always better :D

I was hunting for a piece of code that would make it possible to make stairs out of wires with both straight and curved lines and I found it.... in the path_array file in Draft of course :lol: There they used "getParameterByLength" which as the name says returns the main parameter used by an element based on the length you select on that element. So for a straight line it returns the length, for an arc it returns the angle and so on.

Anyway, the code mostly works now to create stair edges(although with bugs). Just select the path edges(it is necessary to select them in the correct order), and it should work.

Also I wanted to ping onekk, but I do not know how to ping :oops:

Pasted Layer #1.png
Pasted Layer #1.png (269.92 KiB) Viewed 4189 times
Pasted Layer #2.png
Pasted Layer #2.png (273.09 KiB) Viewed 4189 times
10.png
10.png (182.47 KiB) Viewed 4189 times
Attachments
New Stairs5.FCMacro
(2.02 KiB) Downloaded 74 times
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Curved Path Stairs

Post by paullee »

ABeton wrote: Sun May 02, 2021 8:52 pm Ping
For example :)

Code: Select all

[quote=onekk user_id=5245]
Ping
[/quote]
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

paullee wrote: Tue May 04, 2021 1:20 pm
ABeton wrote: Sun May 02, 2021 8:52 pm Ping
For example :)

Code: Select all

[quote=onekk user_id=5245]
Ping
[/quote]
Ahh ok, thank you :D
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: Curved Path Stairs

Post by three_d »

Wow, this is awesome!
paullee wrote: Sun May 02, 2021 5:18 pm I wish the ideas of different 'types' of stairs as discussed could be further refined and implemented, so a uniform codes in modular approach could be made for further extendibility
ABeton wrote: Sun May 02, 2021 8:52 pm I think we can do it, first to make working stair algorithms and than to incorporate them into the stair tools.......
Totally agree!
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

Re: Curved Path Stairs

Post by ABeton »

Thanks three_d :) If you have any ideas/suggestions feel free to chip in.
Post Reply