CAD Modeling for Cg Viz Applications

by William Alexander (wda@asapnet.net) - WDA Design
 

Arched Stairway TUTORIAL Part#2
The Railing

The railing can be the most problematic modeling of the stair components, as discussed in the first part of the stairway tutorial. By utilizing the same methodology use for the stringers the handrail can be efficiently modeled, however more complex. Profiles vary due to having angled sections based on the rise/run of the common steps, location (inner & outer) and the progressive change for the flared area.

Adding to the difficulty, we need to deal with matched profiles, common rail to match a turn or up easing stair part (fitting) and then the specific transition parts aligning with a gooseneck or volute with a set elevation (code) to match a newel post.
This is where the traditional (master finish carpenter) construction techniques shine for layout & assembly. All done in place and as such matched to the stair carriage or better yet; the stair carraige is the jig for forming & fitting the handrails. Thus the approach used in the arched stair case tutorials, low mathematical calculations maximum use of geometric relationships.

THE BIG PROBLEM
3D HELIX Extrusions



The profile has been extruded on a 3d polyline oriented so the end & start profiles are parallel with the "front" view. Notice these two profiles, at the bottom of the stair is a cut and pasted section of the upper extrusion. The profiles in section show the rotation that is common and problematic. This is the big problem.
Face modeling is the best solution, however to face model this entire railing would be mind numbing tedious. This is where CAD programs such as AutoCAD seem to shine for face modeling. Using the same methodology as the first Stairway tutorial for the stringers, we can efficiently model the railings and be set for a matching set of stair parts (fittings).

Profiles, Sections & Fittings
Determining Start / Finish and Matching

The stair solid dictates the form and shape of the handrail (previous tutorial), we will determine a few important developments and placement. Primarily are the profiles, we need to construct our jig, for the 3d face snap points. There is a relationship between the profiles and the related extrusion (or mesh) solids. This relationship needs to be considered at each fitting (connection) of stair parts.
The image below, left, shows "X" an extruded solid to 3d polyline path (form above). The solid was sliced (a true miter) at the point from xy- plane perpendicular to stair pitch, as it was path extruded from profile "Y1" parallel with the "front" UCS. The resulting profile, after rotating parallel with the front view UCSII is "x1", used to help illustrate the relationships only.
The "Y" extruded solid was created form profile "Y1" on the XY plane by specifying a length, then rotated to match the pitch of the stairway. The "y1" profile used for the entire handrail modeling, rotated perpendicular to the pitch of the stair (hypotenuse of rise/run) and or aligned to "mate" with another stair part. The alignment is either a tangent or planar relationship of the pieces and "mated" profiled faces.



That mathematical explanation brings us to the simple practice used by Master Carpenters and Stair Makers. The image above right illustrates the simplicity in practice, no angles, no measurements - no math!!! Red annotated triangle sides are nothing more than the rise and run rotated 90-degrees Clockwise, or for the tradesman a cut out piece of the stringer to mark the angle of a cut on the transition stair piece.
For our purposes, we will use construction, lines & polylines, to determine tangent end points, of the common railing, to arcs that "mate" the profile faces. The polyline arcs are then used to extrude a solid or array the profile to create 3dface snap points.

This maybe the most complicated part of modeling the handrail, not that bad, let us gets started...

Precision & Accuracy
Importance of Checking the Model

We touched upon accuracy of the software programs in the last tutorial. Now lets look at the interaction of the user & software, human error. Any time we need to array or distribute connected model geometry, the need to check / ensure, the precision and accuracy becomes important. OSNAP settings are a time saver but diligence in reading the pop up info and not having too many options selected is very critical. Just as testing a single arrayed alignment of a handrail section, very similar to a tradesman checking the fit before fastening pieces together.


 

A good example (above) is from one of the stair building evolutions (previous tut). The tutorial documentation is correct, but when dragging the wild polyline arc to the layout circle it snapped to the arc center and not the intersection, offset .23" or 1.3% error. Being discovered while setting up and checking the outside radius handrail, not a major problem, but a 1.3% variation ("wiggle") per step of the handrail, could show up during smoothing and rendering (specular) in a 3D program.

Most often the solution is very simple. For this instance creating a negative volume solid with the correct form and subtract it from the stairs. Obviously precision and accuracy is important, catching the normal human errors as soon as possible is by far better than finding then during the final high resolution rendering!!

The Handrails
Creation of Model (Mesh)

We will be starting with the stair solid (Link to stairway tut 1 & info)_or_(Profile and Stairsolids dwg), then a profile, distributing it to form the framework for the handrail segment mesh. A few things to remember from the first arched stairway tutorial: stair rise=7.2", tread=6-degree arc segment, total arc staircase=84-degrees (first to last riser), handrail centerlines are 4" from wall and 4" from return tread nosing (both are measured toward the stair medial center).

 

Start with a symmetric closed polygon profile (typ cross section). It is advisable to have an endpoint that is the midpoint of the bottom segment. (above right) The result for this segment of the tutorial (Above Left)
Set the view to SW, UCSII to "top or world" and zoom in on the 1st tread at the outer radius.
Create a new layer, OuterHR-layout, and set it to current
Make sure the ONSAP has endpoint, midpoint, center & extension selected, and the Polar Settings have two additional angles- 3 & 6 degrees.
Draw four polylines oriented to the outer construction circle center (0,0,0) 2.5" in length. (1) from the top right corner 1st riser, (1) from the mid pint of the 1st tread, (1) from the lower right corner of the 2nd Riser and (1) from the top right corner of the 2nd riser. These are the offsets for the HR (handrail) centerline layout.
Connect the three offset lines (x,y plane) on the first tread by a polyline (line segs only).
Switch the UCSII to front, and draw a polyline connecting the two layout lines on the face of the second riser. The two recent lines are the HR Center reference lines.
Switch UCSII to "top"
Select the HR Center lines, copy and paste away from the stair solid.
Draw another polyline on a different layer (visual/color), from the endpoint of the tread HR Center line, 270-degrees or on the true 90-degree y-axis, past the HR Center lines.
Select the HR Center Lines and rotate using the reference option. Align the HR Center line endpoints with the new line and in the Y,z plane.
Put the Handrail profile in the X,Y plane and move the profiles bottom mid point to the HR Center lines endpoint.
Switch UCSII to "left"
Rotate the profile, using the reference option, in the YZ plane, using the riser height as the first and second points form the profile midpoint as the reference center.

 

At the stair solid and HR Center lines we need to draw a line 1/2 the height of the rise, 3.6" in the Z direction from the mid endpoint of the treads HR center Line.
Switch UCSII back to "top"
Move the rotated profile to its similar point on the stair solid (above Right).
Copy with base point, the profiles mid endpoint and paste at the top end point of the line just drawn.
The profile needs to be rotated 3-degrees on the XY axis. Now the profile matches the helix rise and rotation for the handrail.
Now is the time to check our work. We will only face model 1/2 of a step segment of railing (profile to profile) then array to form the railing mesh. Use copy with base point and paste as block, then rotate to ensure that a copied and rotated segment of railing matches to the top of the next riser- perfectly.

Modeling the Outer Handrail Mesh

Create a new layer called HRmesh-outer, set layer to current.
Using the endpoints (OSNAP- only endpoints selected -optional), create 3dfaces based on the profile endpoints (the framework or jig). Remember from the last tutorial creation direction CW & CCW creates Backfacing & Front Facing normal orientation based on the current (SW) view in view port. The brown colors are front facing and CCW created; the blue colors are Backfacing and CW created (below left). AutoCAD displays two sided faces, but in 3D applications such as the Max platform normal directions do matter.

 

Turn off the profile's layer, and select the new 3dfaces
Copy the faces with base point (end point of HR centerline and 1st riser), paste as block, set the insertion point to the top end point of the vertical center line of tread.
Select the new block &rotate 3-degrees, creating the common arrayed mesh handrail section. Now is a good time to check the alignment of the two pieces, just to make sure they are correct in alignment and all of the face vertices are where they belong. The software snap accuracy, the OSNAP and our perceptions sometimes allow for very slight misses, .01 of an inch. Hardly perceptible, but can cause rendering and alignment problems.
Explode the new block.

We are moving on to the inner handrail mesh and will array both handrail segments together.

Inner Handrail Profile & Snap Jig (Framework)

This will be an abbreviated explanation, using the same methodology as before and differences shown. The centerline offset from the tread edge is 4", the stair solid represents the outside edge of the treads. There is now need for a mid profile per tread segment of railing. The outer when rendered in max showed its polygonal modeling, so we doubled the faces and thus the profiles in Cad.

Draw the offset reference lines as before on a construction layer, without mid point on tread. We will use the stair solid; first tread inside stair arc and the flare solid in a bit.
Draw the inner Hr Center line, this time use a 3dpolyline, there is no need to change UCSII drawing views.
Copy the profile parallel with the xz plane to the end point of the HR Center Line.
Rotate the profile in the YZ plane to match the pitch of the rise and run.
Copy the rotated profile and paste at the top of the vertical part of the 3d poly HR Center line.
Rotate the 2nd profile on the xy-plane to 6-degrees.

 

Create the inner handrail mesh segment with 3dfaces as before.

That is the inner handrail common segment.

Array to form Handrail Mesh Model

With the inner and outer handrail, segments done you model should look similar to the one below right.

Create named blocks or copy with base point (erase) & past as block for each handrail segment. The base point or insertion point is the typical profile mid endpoint and the intersection of the first risers top edge.

 

Select the new blocks and start the array command. Polar settings as follows
-Center= stair arc centers or in this case 0,0,0.
-Select "Angle to Fill & Angle Between"
- Angle to Fill= 84-degrees (total stair arc segment)
- Angle Between= 6-degrees (tread arc segment)
Preview and if all looks well click "accept"


Move each block on the z-axis to match block insertion point to the mated profile mid endpoint. Alignment is critical so watch the OSNAPs and change views on the view port as needed. NOTE: a single block can be created from the Handrail segments, to minimize move operations, precision and accuracy to this point being twice as important.
Your model should resemble the image below. If it does, erase the first (4) inner handrail segments, to prepare for the flared portion on the handrail.



THE FLARED HANDRAIL
Pure 3Dface Modeling

Setting up the Snap Jig (Framework)

Using the same offsets and general methods as the common handrail, we will set up the 3 unique flared handrail segments per tread. Due to the tighter radius of the curve and changing stair pitch will be dividing the Handrail segment in half, for a smoother appearance.


SW view, "top" UCSII, new layer; flared-layout and zoom in on the flared solid.
OSNAP settings; endpoint, midpoint, center & extension selected.
Draw a "line" from the flared solid arc center, by hovering over the arc segment of the tread to show the center at the same Z elevation as tread surface. Continue the line to the closest end point of the tread. (below left) Then from that point start a new line and find the "extension" angle / direction. Type 4 in the command line and press enter.
Continue creating the offset reference lines as shown.
Draw a 3D polyline for each step (run & rise), by connecting the offset reference lines, to create three HR Center reference lines. (below right)

 

Select one of the HR center 3D Polylines, copy with base point (leading endpoint) and erase if you like.
Switch to the top view, zoom in on the reference offset lines, and determine the angle between the 3 lines that divide the tread segment. We need to know these for profile rotation. NOTE: For simplicity whole numbers are used for the angles and depending on rendering needs you may choose greater precision.

 

Following the same sequence as used before, draw a line parallel with the y-axis, paste the HR center block at the starting point, rotate the block aligned with the y-axis line, paste the profile (typical endpoint) in the X,Z plane, then rotate the profile in the yz-plane using the stair rise as the reference change. (below left)

 

Switch UCSII to front and draw a polyline vertically 3.6" (1/2 rise), from the HR Center tread middle division.
Copy the tilted profile with base point to the top endpoint of the new vertical line.
Switch UCSII to "top" and rotate the profile 10-degrees about the insertion endpoint & it's z Axis.
Explode the HR Center block, (avoiding blocks in blocks) if you desire
Select the profiles, new line and 3D poly HR center, copy with base point, the typical endpoint. (above right)


Zoom in on the flared solid, paste as block, insert at the original leading endpoint and rotate so the HR Center polyline is in the original location.
Lather Rinse and … repeat for the other two tread segments.

That is the snap jig and framework for the flared portion of the handrail. On to modeling the mesh...

 

Modeling the Flared HR Mesh

This is pure 3dface modeling at it is best in CAD. Those of you who are 3 dimensionally challenged, hang on tight.

By this point, the basics of face modeling should not be a major problem. Complexity and working with the views, keeping track of face orientation, and your mental-GPS location in the model can cause problems. The orientation of the snap jig to the typical views as you will find out makes for some mental gymnastics.

This part of the handrail makes the staircase what it is, so be patient and methodical when creating the faces. Start with the SW view and draw all of the backfacing 3dfaces first, per segment of railing. Then the normal (front) facing, zoom in (real close as needed) to make sure the OSNAPS are where they belong, and use only the "endpoint setting".

The faces normal orientation is dependent on the current view port viewing direction beware of this when changing views. It is advisable to change views as needed. Another tip maybe to set up layers for normal and backfacing to differ between the jungle of lines, then convert the faces to a common layer.

Below you can see the normal layers. Each tread segment has a similar color to the jig and layout lines for the normal facing and a somewhat contrasting color for the backfacing. Notice the brown face on the first segment, above and below are front facing due to the SW viewing direction. The last tread segment modeled in the SE viewing direction and the layers are inverted in the view shown, but the normals are correct.

Take your time; it is worth the effort and using a simpler profile will help but not always with the final rendering.

A quick Render

Below is the staircase to date, railings raised in max, we still need them on the stair solid to create and fit stair parts like up easing, gooseneck, turns and volute transitions.

Parting Thoughts
Helix Form Handrail Modeling

Everything is in place, meshes profiles and construction lines to create and mate stair fittings. Being the focus of the next tutorial for modeling the Arched Staircase.

The difficult part of this type of complex modeling is not in the methodology but the density of lines created by changing, curving meshes and not getting lost. The rigid and precise nature of Cad programs like AutoCAD can make it as easy as max especially for those who are most comfortable with the "drafting" nature of CAD.

It's not instant, but the workflow provides for precise placement of all components not always being that fast or accurate in 3D programs. It can be fun; challenging and the results are at least equal to any exclusive 3D program.

Cheers
WDA