[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!
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

ABeton wrote: Sat May 15, 2021 3:12 pm 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.
Glad to here you have more FreeCad construction sites :D
Here are some of my thoughts for when you will come back to your Curved-Path-Stairs-Macro:
  • Although computation time is important let's focus for now on the funcionality aspects of the macro. Optimizations can be done before the stair is converted into a parametric object.
  • Playing another bit with your Macro and trying to model the following half-curved stair I failed and so I got convinced that it could be very usefull to introduce another concept in order to imrove the disposition of the steps. Additionally defining a walking path and then generating steps which have a constant width along this path and are perpendicular to it IMHO could be a huge improvement. (See following image for desirable behaviour and current situation).
  • Searching on the WEB I found this old FreeCad thread https://forum.freecadweb.org/viewtopic.php?t=23501 and this Github repository https://github.com/wschildbach/FreeCadStairConstructor. Maybe it helps.
Thank you again for offering your skills to the comunity!
Regards
Attachments
Stairs.FCStd
(75.53 KiB) Downloaded 58 times
Stairs.png
Stairs.png (85.23 KiB) Viewed 2839 times
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

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

Post by ABeton »

Thank you for your input and testing it means a lot :)
  • I agree on the first point and hope it can be made faster in the future
  • I was thinking to do something similar to the walking path you propose at first, but because of the way the stairs are programmed it would make them very prone to errors. For the tool to work properly it is very important that the used path is the inner one, because otherwise the edges that create the stairs would often intersect and this would cause errors.
  • This looks very interesting I will check it out :) The code will probably be useful to see
Also if you want to design stairs like in the picture bellow, you can create stairs with a filleted inner path and than draw a solid which you can use for boolean difference. It is not perfect but it works :lol:
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

ABeton wrote: Mon May 17, 2021 9:26 pm Also if you want to design stairs like in the picture bellow, you can create stairs with a filleted inner path and than draw a solid which you can use for boolean difference. It is not perfect but it works :lol:
Thks for the advice! I will definitvely give it a try. :P
Cheers
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

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

Post by ABeton »

Sure thing! :)
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,

Following your suggestion I was able to model a similar stair like the one in my previous post (see stais_01). However this approach has the big disadvantage not to allow to control the steps in the turning region.
So I came up with this workaround:
  1. model the half side of the stair (Shape02_outer) left from the walking path by selecting the walking path as inner path
  2. model the half side of the stair (Shape02_inner_buggy) right from the walking path by selecting the walking path as outher path
  3. then make a boolean union of the two
  4. eventually make a final boolean cut to obtain a sharp edge on the inside
Unfortunately step 2 fails and doing it by selecting the inner path of the stair is quite useless (Shape02_inner_false).
Do you have an idea how the problem could be solved :?:

Thks for your help ;)
Stairs.JPG
Stairs.JPG (87.23 KiB) Viewed 2669 times
Attachments
Stairs.FCStd
(311.86 KiB) Downloaded 68 times
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

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

Post by ABeton »

Hi @balrobs, I am sorry for the late answer but I have been really busy.

And about this, the approach you tried does not work because the path you select to create the stairs always has to be the inner one. So that is why the second case fails. I really like the idea, but at the moment I am not sure how this problem could be solved with the limitations of the stair macro :?
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

ABeton wrote: Fri May 28, 2021 8:28 pm Hi @balrobs, I am sorry for the late answer but I have been really busy.
No reason to feel sorry!
Your macro is already a great piece of software and I'm confidend that it will get better and better.
The FreeCad mantra is: It's ready when it's ready :D
Cheers
ABeton
Posts: 150
Joined: Tue Sep 03, 2019 6:39 pm

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

Post by ABeton »

Thanks :D
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

ABeton wrote: Sun May 30, 2021 9:51 pmPing
Hi ABeton,
Today I used your macro to model an oval stair. Amazing stuff! :D
Everything worked fine ... but since I had to make several attempts with different input values until I got the desired result I thought that a GUI could be very useful. So I studied some examples in the wiki and added my first GUI to your macro. :o
Along with this I applied these changes:
  • renamed Macro to CurvedStairRC.FCMacro
  • wrote macro header info
  • commented out never used variables
  • wrote logs with PrintLog() to clean up the ReportView
  • implemented message box when no path was selected
  • implemented message box when an entire closed path was selected
  • reported messages when creation task starts and ends
  • enableed tooltips for dialog input fields
Here is the modified Macro.
CurvedStairRC.FCMacro
(13.93 KiB) Downloaded 30 times
In general, the changes should be an improvement. Unfortunately, some weaknesses remain and I don't have the skills to fix them. :oops:
  • the macro remains very slow. I tried to do some profiling following this excellent thread
    https://forum.freecadweb.org/viewtopic.php?f=10&t=44785
    and found out that the bottlenecks are given with Part.Shape.fuse (ca. 80%) and Part.Shape.common (ca. 20%) operations but I'm not able to go further like this. :oops:
    profile.png
    profile.png (139.27 KiB) Viewed 1495 times
  • another very useful improvement would be to take into account different user inputs for the stair thickness (throat depth). See following picture:
    CurvedStairRC.png
    CurvedStairRC.png (193.71 KiB) Viewed 1495 times
    Since I don't understand your stair generation code I am also lost here. Would it be possible to change your code in this regard?
  • another thing I don't understand: Before calculations start I try to write a message to the ReportView so that the user can be prepared for a longer processing time. Strangely this message appears only at the same time with the message that the task has been completed.

    Code: Select all

    19:17:57  Task started. Please be patient as it can take quite a while to finish!
    19:17:57  Task finished!
    This problem I can probably fix by myself so I will investigate further.
Cheers balrobs
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee »

ABeton wrote: Ping
Wow ! Thanks @Balrobs to create the GUI ! Cool ! 8-) Finally I have a glance at @ABeton's script. :)

Noted there are lot of Boolean to be done which needs long time and roughly understand the overall approach. Really inspiring what can be done to do a custom profile stairs ! ( In my earlier attempt, Arch Stair - More Geometry Control? Profile Generator , I only focus on custom/curve profile on landing, with constant thread, straight flight.) Can have more brainstorm later on how to gain best of both ride on this approach :D

Some Thought to Save Extensive Boolean Time ?

In the meantime, has a thought maybe another attempt save OCC Boolean operation but probably need more time to generate the 'profile' - see https://wiki.freecadweb.org/Curves_SketchOnSurface - it generate a wire / face mapping a Sketch on a curve surface, then by offsetting it at different distance from the surface, it can generate a solid (by Part Lofting the 2 faces ?)

So the idea is generating the 3d profiles of the whole stair, 'inner' and 'outer', and Part.Loft them - could work or not? Or only work for each thread (save 1 boolean for each thread ?) and boolean each steps?

Someone would comment or like to try as proof of concept ?
Post Reply