I’ve found a useful Spiral Staircase DC from the 3D Warehouse, but there’s a small problem with it that I think I know I ought to be able to fix (but can’t), and a puzzle.
Here’s the component:
Spiral+Stair+DC.skp (249.9 KB)
By default, it draws a spiral stair (I know, the pedants, including me, think it should be a helical stair…, but) looking like this:
There’s an option for a central pole, which I’ve turned off in the Component Options.
But the handrail segments don’t join up.
The angle of slope for the handrail component is given in Attributes as RotX
:
and I think the atan(rise/c) should be asin(rise/c), since c is the slope length of the rail calculated as the square root of the sum of its horizontal run (arclen) squared plus the rise squared.
But when I change it, thinking that should fix it, it doesn’t.
First, the angle is still not steep enough, although the formula appears to me to be correct.
Second, If I change the atan to asin in the rail, it only affects the first step.
Yet that step is copied up and round so why do all the Copies still have atan in them, even after I force a redraw of the DC, and even after I save the changed component, close SU, and reopen it?
The Step Component contains the functions to do the copy round and up…
I’m missing something, but can’t see what. Can anyone (perhaps @pcmoor) help me fix the rail angle, on all the steps?
And I’d like optionally to add an inner rail, in cases where there isn’t a pole, and the inner radius is relatively large. I should be able to manage that myself, if I could understand why the outer rail isn’t working correctly.
[EDIT LATER]
Well, I thought I might have found an answer to the first part of my question. But I haven’t - it still isn’t quite right, though it’s closer to the right slope for the handrail.
Instead of changing atan(rise/c)
to asin(rise/c)
, I can simply use atan(rise/arclen)
arclen
is defined in the rail
component inside the first Step as arclen=parent!rail_len
, and rail_len
is defined in the Step component as
rail_len=(inner_radius+tread_width)*rot_inc
rot_inc
is the rotation increment - the angle between successive steps, in radians.
But the multiplier for the outer radius of the steps should (I think) not be the angle itself, but twice the sin of half the angle.
So, instead
rail_len=(inner_radius+tread_width)*(2.0*sin(0.5*rot_inc)
Let’s try that…
… and I get a nonsense answer. Maybe needs conversion from radians to degrees first?
=(inner_radius+tread_width)*(2.0*sin(0.5*degrees(rot_inc)))
That gets closer, but still not quite right, and the formula doesn’t propagate to the copies.
i’d really like to understand how to get the formula for the rail angle to propagate to the copied steps after raising and rotating them, and to be able then to replace the single-edge baluster
and rail
components with a solid square and round rod respectively.
Do I need to copy the rail
components separately and independently of the Step
component, not contained within the first Step
?