[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
User avatar
Roy_043
Veteran
Posts: 8456
Joined: Thu Dec 27, 2018 12:28 pm

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

Post by Roy_043 »

paullee wrote: Sun Jan 23, 2022 12:39 pm 3d profiles of the whole stair, 'inner' and 'outer', and Part.Loft them
How would you generate those profiles for stairs with nosing details?
paullee
Veteran
Posts: 5099
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee »

Hmmm, the original approach to create the face of the Tread (and Riser I think) seems good to produce the Tread (with or without nosing) by simple extrusion. And in the original ArchStair object, these solids are simply collected as a Compound (to my memory, no need boolean operation).

The CPU intensive operation discussed seems to be generating the solid of the Stairs which has a sloping bottom - to my understanding each step as an rectangular extrusion to boolean fuse with a 'triangular' solid in sectional profile, and these steps are boolean fuse together one by one - my understanding correct ? I just have a glance over the code :)

By the way, would a Part.Wedge do the trick to save 1 boolean fuse operation ?

Thanks.
paullee
Veteran
Posts: 5099
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee »

balrobs wrote: Wed May 19, 2021 8:37 am 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.
ABeton wrote: Sun May 30, 2021 9:51 pmThanks :D

For this scenario, seems a 'centre' align option (and algorithm) needs to be added ? - The selected path define the alignment of step/tread, and create the outline / face of the tread, by offsetting to both sides.

Doable ?
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

paullee wrote: Sun Jan 23, 2022 12:39 pm So the idea is generating the 3d profiles of the whole stair, 'inner' and 'outer', and Part.Loft them - could work or not?
Hi @paullee,
thanks a lot for your reply. I think this approach would make a lot of sense. So if I understand you correctly the user would have only to select a left and a right path, give a step number and a stair height and then both paths could be devided into the same steps number with constant treads. For both path the 3D-profiles could be generated and then a single loft between those could make the stair body?
paullee wrote: Sun Jan 23, 2022 2:22 pm For this scenario, seems a 'centre' align option (and algorithm) needs to be added ? - The selected path define the alignment of step/tread, and create the outline / face of the tread, by offsetting to both sides.
Doable ?
Maybe not necessarily. Adding one vector for the left path with the values Delta_li/Sum_Delta_li and another one for the right path with the values Delta_ri/Sum_Delta_ri could also do the job. What do you think?
handsketch.jpeg
handsketch.jpeg (160.04 KiB) Viewed 1859 times
As a proof of concept I will see if I can try to do these steps by hand for my oval stair, see if I succeed to create the stair body and how long it will take to create the curved left and right surfaces (using a polyline or a spline for the lower profile curve?) and the loft operation.

Cheers
paullee
Veteran
Posts: 5099
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee »

balrobs wrote: Sun Jan 23, 2022 6:10 pm thanks a lot for your reply. I think this approach would make a lot of sense. So if I understand you correctly the user would have only to select a left and a right path, give a step number and a stair height and then both paths could be devided into the same steps number with constant treads. For both path the 3D-profiles could be generated and then a single loft between those could make the stair body?
...
handsketch.jpeg

As a proof of concept I will see if I can try to do these steps by hand for my oval stair, see if I succeed to create the stair body and how long it will take to create the curved left and right surfaces (using a polyline or a spline for the lower profile curve?) and the loft operation.
Thanks for the sketch, yes that should be more or less what I am conceiving - the original ArchStair generate the sectional profile / face, then simply extrude 'orthogonally'.

If there are 2 profiles/faces, hopefully each segment in either profile corresponds to each other correctly. One issue seem the '3d profile' maybe some elliptical, if the 2d floor layout is an arc - pardon my mathematic :D

Hmm, would it be able to generate a face then by simple Part.Face(Curvilinear profile of each step) then, or need Curve/Surface WB ?

You may try creating 2 or 3 steps to prove the concept.
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

paullee wrote: Sun Jan 23, 2022 6:43 pm You may try creating 2 or 3 steps to prove the concept.
I re-modeled my oval stair "by hand" following as much as possible your "loft-approach". This are my steps:
  1. draw with sketcher an inner and outer stair path on the xy-plane
  2. extrude them with part:extrude in z-direction
  3. create a sketch for the outer-path and map it with curves:map_sketch_on_surface on the outer extrusion
  4. do the same for the inner extrution
  5. make a loft between the outer and inner profile with curves:loft_profile_objects
oval_stairs.JPG
oval_stairs.JPG (66.96 KiB) Viewed 1771 times
All steps happen without delay :D ... only when it comes to TechDraw things slow down significantly.
One thing I do not understand yet is why the sketck mapping doesn't produce equal tread length along the paths :?:
CurvedStairRC_LoftApproach.FCStd
(326.65 KiB) Downloaded 29 times
paullee
Veteran
Posts: 5099
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee »

balrobs wrote: Mon Jan 24, 2022 2:26 pm I re-modeled my oval stair "by hand" following as much as possible your "loft-approach". This are my steps:
  1. draw with sketcher an inner and outer stair path on the xy-plane
  2. extrude them with part:extrude in z-direction
  3. create a sketch for the outer-path and map it with curves:map_sketch_on_surface on the outer extrusion
    ...
oval_stairs.JPG
All steps happen without delay :D ... only when it comes to TechDraw things slow down significantly.
One thing I do not understand yet is why the sketck mapping doesn't produce equal tread length along the paths :?:

Great ! This is slightly different from what I was originally conceiving but inspiring :D
  1. The most importantly consideration is whether the approach save time afterall
  2. Original idea is to construct the 3d-profile through python (Complicated mathematics ? And not sure if it form a face though conceptually develop-able)
  3. With the SketchOnSurface, I just input a Thickness (-ve) e.g. at the Inner-mapped Sketch then it create a solid, skip lofting with the other (the Outer-mapped Sketch)
  4. It seem with this approach the angle of each tread is consistent?
  5. No much idea the algorithm of the SketchOnFace
  6. Now there are 3 solids to compare the difference in construction :)
CurvedStairRC_LoftApproach_r.FCStd
(365.18 KiB) Downloaded 31 times
Screenshot from 2022-01-25 00-46-48.png
Screenshot from 2022-01-25 00-46-48.png (233.11 KiB) Viewed 1736 times
Screenshot from 2022-01-25 01-07-11.png
Screenshot from 2022-01-25 01-07-11.png (236.6 KiB) Viewed 1736 times
Screenshot from 2022-01-25 00-49-09.png
Screenshot from 2022-01-25 00-49-09.png (244.06 KiB) Viewed 1736 times
Screenshot from 2022-01-25 01-07-25.png
Screenshot from 2022-01-25 01-07-25.png (195.33 KiB) Viewed 1736 times
Screenshot from 2022-01-25 00-54-44.png
Screenshot from 2022-01-25 00-54-44.png (260.3 KiB) Viewed 1736 times
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

paullee wrote: Mon Jan 24, 2022 5:09 pm Great ! This is slightly different from what I was originally conceiving but inspiring :D
It's just an attempt to find a way to better control the steps arrangement ... and it's far from working :mrgreen:
The main reason is that SketchOnFace doesn't map the stair profile as I would expect it. Firstly even when the horizontal lengths of the stair profile and the face are identical the tread length are distorted. Secondly it seem as if the SketchOnFace command couldn't work on surfaces which are based on wires with more then one segment.
I will keep trying
paullee wrote: Mon Jan 24, 2022 5:09 pm [*] It seem with this approach the angle of each tread is consistent?
Yes, your approach leads to a much consistent result :)
paullee
Veteran
Posts: 5099
Joined: Wed May 04, 2016 3:58 pm

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

Post by paullee »

balrobs wrote: Tue Jan 25, 2022 2:06 pm The main reason is that SketchOnFace doesn't map the stair profile as I would expect it. Firstly even when the horizontal lengths of the stair profile and the face are identical the tread length are distorted. Secondly it seem as if the SketchOnFace command couldn't work on surfaces which are based on wires with more then one segment.
Maybe someone can have some gap to analysis the geometrical difference with these few approaches, to understand the algorithm, so get more certain result :)

By the way, Curve wb has a tool to sew several segment of edges into one.
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

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

Post by balrobs »

paullee wrote: Tue Jan 25, 2022 2:59 pm By the way, Curve wb has a tool to sew several segment of edges into one.
Thanks @paulee for your hint :D
With your Curve WB tool (join selected edges into a bspline curve) I was able to solve my mentioned problems and model a generic(?) curved stair by drawing the inner and outher profil and therefore better control the steps arrangement.
Unfortunately the profile drawing is quite a tedious task ... maybe it could make sense to automate this in some way ... being in sketcher would then allow the user to make fine adjustments
Thank you again for your help
CurvedStairRC_LoftApproach_rr.jpg
CurvedStairRC_LoftApproach_rr.jpg (123.68 KiB) Viewed 1628 times
Attachments
CurvedStairRC_LoftApproach_rr.FCStd
(220.94 KiB) Downloaded 32 times
Post Reply