[PR] [0.18-0.21_pre] Arch Stair - More Geometry Control? Profile Generator

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: 5130
Joined: Wed May 04, 2016 3:58 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by paullee »

jahwobble wrote: Thu Nov 19, 2020 9:57 am I am, of course, constantly comparing with the BIM software I use for work. With Revit stairs, different nosing profiles can be used, the nosing can wrap around the front and sides of the tread, the riser can be sloped. The tread and riser can be different materials. Customized railings with fancy balusters can be used, so many balusters per step can be specified etc etc. This may give you some ideas of what you would like to do with Arch stairs but on the other hand, you may say "the hell with that!" :D

I quite like the relatively simple nature of Arch stairs - I actually find a stair case quicker and easier to build this way.
:) I would very much like to 'modularize' those parts, but unfortunately I am not trained as a programmer but just a beginner in python on :oops: Always hope there are more capable peoples can develop those features :D

Maybe when there is some more time, I may attempt to let user to define a typical tread and rise profile, then ArchStairs repeats it ..?
jahwobble wrote: Using a wire as a base reminds me of one of the Revit methods - stair by component. The user sets the top and bottom level parameters, along with the maximum riser height at minimum tread depth then dynamically sketches the path for each flight. I actually prefer the Arch stairs method because the base wire is placed before the stairs are created and can be tweaked to adjust the stairs afterwards. In Revit, I would have to go back and manually adjust each flight while playing with the step and level parameters, and it can be quite fiddly to do so.

The wire base method strikes me as quicker and more flexible so i would't be too harsh on it. ;)
Know very little about Revit, do you mind illustrating what is 'stair by component' maybe some online video / tutorial ?

Thanks.
jahwobble
Posts: 51
Joined: Sat Sep 21, 2019 1:05 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by jahwobble »

Here's a stair by component tutorial: https://www.youtube.com/watch?v=6ush7rLRu2M

I often use Stair by Sketch instead: https://www.youtube.com/watch?v=txhQFiywjKA
paullee
Veteran
Posts: 5130
Joined: Wed May 04, 2016 3:58 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by paullee »

jahwobble wrote: Thu Nov 19, 2020 4:11 pm Here's a stair by component tutorial: https://www.youtube.com/watch?v=6ush7rLRu2M

I often use Stair by Sketch instead: https://www.youtube.com/watch?v=txhQFiywjKA
Checked some online materials about Revit's approach to Stairs, seems quite complicated but advance :)

Inspiring indeed, have thought about what can / should be done for a while.

Not sure if someone indicated ArchiCad has better Stairs tools? And if anybody can make a simple comparison or suggestion ?
paullee
Veteran
Posts: 5130
Joined: Wed May 04, 2016 3:58 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by paullee »

Other peoples writing Macros to create different kinds of Stairs, e.g.

RC stairs macro
Steel Stair Generator

Maybe these can be incorporated later. Anyone ? :D
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by carlopav »

Nice,
perhaps it is possible to incorporate them keeping the code divided. This is an example of the opening filling generator:
You can even add custom properties for every algorithm: https://github.com/yorikvanhavre/BIM_Wo ... ows.py#L68

to be more precise:

Code: Select all

StairObject

   execute()
   -> get_preset_stair_shape(obj)
      -> if obj.StairType == "Standard":
         -> get standard_stair_type(obj)
         
   onChanged(StairObject.StairType)      
   -> remove_stair_type_subproperties(obj)
   -> add_stair_type_subproperties(obj)
      -> if obj.StairType == "Standard":
         -> get get_standard_stair_type_subproperties(obj)
So every different mode can add its own properties to the object (like IFC object does).

The problem remains the IFC export, but it can be not so difficult if we consider exporting as Brep most of the stairs...
follow my experiments on BIM modelling for architecture design
paullee
Veteran
Posts: 5130
Joined: Wed May 04, 2016 3:58 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by paullee »

Thanks @carlopav, seems lots of codes for me to study as python beginner :D

Maybe can help add issue to Mantis bug tracker ?
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by balrobs »

This post is intended to help keep track of an issue with the stair connection between landing and the second flight that is covered in this thread:
https://forum.freecadweb.org/viewtopic. ... 30#p472079
and reported in Mantis here:
issue #4548
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by three_d »

This post is an answer to this forum discussion.

BTW, @three_d, if you have another gap, just note the Riser could even be looked better if it could consider the thickness of the Tread, so it extends slightly lower to the bottom edge of the below Riser :D
Hi paullee, I tried following your suggestion....and it seems to work (img 1), but I still have a problem with the flight/landing connection when the "Flight" option is set on "HalfTurnLeft/Right" (img 2).

img 1.png
img 1.png (195.94 KiB) Viewed 2196 times

img 2.png
img 2.png (196.02 KiB) Viewed 2196 times

Quite different is the case of the modular approach: at the moment in the connection between first flight-landing (img 3) is not possible to create the last riser :(

img 3.png
img 3.png (219.94 KiB) Viewed 2196 times

Code: Select all

+ added line
- removed line
* changed line

					     (.....)

	 def makeStraightStairs(self,obj,edge,s1,s2,numberofsteps ..... ):


					    (.....)

				if obj.Structure == "Massive":
+ 				 if obj.RiserThickness.Value:
+ 					p1a = p1.add(DraftVecUtils.scaleTo(vLength,obj.RiserThickness.Value))
+ 					p2a = p2.add(DraftVecUtils.scaleTo(vLength,obj.RiserThickness.Value))
+ 					struct = Part.Face(Part.makePolygon([p1a,p2a,p4,p3,p1a]))
+ 					if obj.TreadThickness.Value:
+ 						p2 = p2.add(Vector(0,0,-abs(obj.TreadThickness.Value)))				
+ 						p2a = p2a.add(Vector(0,0,-abs(obj.TreadThickness.Value)))
+ 						riser = Part.Face(Part.makePolygon([p1,p1a,p2a,p2,p1]))
+ 						riser = riser.extrude(vWidth)
+ 						self.steps.append(riser)
+ 					else:
+ 						struct = Part.Face(Part.makePolygon([p1,p2,p4,p3,p1]))

					                       (.....)

* 		if i == 0 and downstartstairs == "HorizontalCut":
  			r2 = r2.add(Vector(0,0,abs(obj.TreadThickness.Value)))			
  		r3 = r2.add(vWidth)
  		r4 = r3.add(vHeight)
* 		if i == 0 and downstartstairs == "HorizontalCut":
  			 r4 = r4.add(Vector(0,0,-abs(obj.TreadThickness.Value)))
 		 riser = Part.Face(Part.makePolygon([r1,r2,r3,r4,r1]))

					                          (.....)

		# structure
        	lProfile = []
        	struct = None

+ 		firstRiserThickness = None

		if obj.Structure == "Massive":
            
			if obj.StructureThickness.Value:
				
				vBase = vBasedAligned.add(vRiserThickness)

				for i in range(numberofsteps-1):

					(.....)
				
					if len(lProfile) == 1:
    
                    				last = last.add(Vector(0,0,-abs(obj.TreadThickness.Value)))

 
+			  			firstRiserThickness = last

					(.....)


-				lProfile[-1] = lProfile[-1].add(-vRiserThickness)
					
					(.....)

+				if obj.RiserThickness.Value:
                  
+					lProfile[-1] = lProfile[-1].add(-vRiserThickness)
+		
                if downstartstairs != "HorizontalCut":
                  
+					lProfile.append(vBase.add(-vRiserThickness))
+			
                lProfile[-1] = lProfile[-1].add(Vector(0,0,-obj.TreadThickness.Value))

+      					lProfile.append(firstRiserThickness)


				lProfile.append(vBase)

					(.....)

Code: Select all

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22960 (Git)
Build type: Release
Branch: master
Hash: c5a4b01d2e4218bcc0eb6650337650a6c65ef0e4
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
ArchStairs[05_05_21].py
(71.41 KiB) Downloaded 65 times
paullee
Veteran
Posts: 5130
Joined: Wed May 04, 2016 3:58 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by paullee »

three_d wrote: Wed May 05, 2021 6:17 pm Hi paullee, I tried following your suggestion....and it seems to work (img 1), but I still have a problem with the flight/landing connection when the "Flight" option is set on "HalfTurnLeft/Right" (img 2).
Gorgeous ! :)

For HalfTurn landing, that I remember it is currently an extrusion of the sectional profile. So if a 'riser' profile is provided, maybe it extruded at one end only, and subtracted it from the 'original solid'.

three_d wrote: Wed May 05, 2021 6:17 pm Quite different is the case of the modular approach: at the moment in the connection between first flight-landing (img 3) is not possible to create the last riser :(
See attached file and previous workflow on the 'current' workflow to produce 'custom landing shape'.

First, each flights and landing is individual Stairs Object (based on individual Sketch / Wire below), subsumed under a 'master' Stair object. So each object has the Tread/Riser setting.

The Landing / Flight in higher level should automatically has a Last Segment attribute set to the Landing/Flight in immediate lower level - see screen capture, Stair002 (a Landing) has Last Segment automatically set to Stairs001 (a Flight). Currently, when the height of the previous flight change, the subsequent landing/flight pick this up and change its level/elevation automatically.

So it should be possible to have the landing to obtain the previous Flight Riser Thickness and insert in subsequent Landing.

I am tied up with some others studies associated with facade surface, wall baseplate etc. Glad you and more peoples are happy to play with Arch/BIM and improve it. May have a closer look soon :D

Screenshot from 2021-05-06 07-58-35.png
Screenshot from 2021-05-06 07-58-35.png (261.13 KiB) Viewed 2168 times
Screenshot from 2021-05-06 07-59-29.png
Screenshot from 2021-05-06 07-59-29.png (263.51 KiB) Viewed 2168 times
User avatar
three_d
Posts: 26
Joined: Thu Aug 20, 2020 3:33 pm

Re: [PR] [0.18] [0.19_pre] Arch Stair - More Geometry Control? Profile Generator

Post by three_d »

paullee wrote: Thu May 06, 2021 12:21 am For HalfTurn landing, that I remember it is currently an extrusion of the sectional profile. So if a 'riser' profile is provided, maybe it extruded at one end only, and subtracted it from the 'original solid'.
paullee wrote: Thu May 06, 2021 12:21 am First, each flights and landing is individual Stairs Object (based on individual Sketch / Wire below), subsumed under a 'master' Stair object.....
So it should be possible to have the landing to obtain the previous Flight Riser Thickness and insert in subsequent Landing.
Hi paullee, Thanks for clarifying these details.
Now that I understand better how it works, I hope to be able to improve the landing shape.....and my hope is to keep things as simple as possible.
Post Reply