# Tutorials

In the final instalment of the stadium tutorial we'll focus on making the undulating roof. This is the first tutorial in this 5 part series to features RailClone2's new two dimensional array generator. In this tutorial we'll explore how to use this generator to make a parameterised roofing style, with controls for angle and depth. The style is made from 3 generators as in the image below.

At first glance the node tree looks complicated but by breaking it down into three sections, it should be much easier to understand. In the first part we'll create the main metal framework, using the top, bottom and default inputs. In the second we add a simple cantilevered truss, and in the final section we'll create a glass skin with the compose, sequence, arithmetic and constant nodes.

## Creating the main trusses

1. Create a new RailClone object.
2. Open the style editor and add a Array 2S generator
3. Go to Properties>Rules>X Bevel>Mode and set it to "none" from the drop down list.
4. Add a spline object and pick "spline_roof" from the scene, connect to the X Spline input.
5. In this example we're going to use a parameter to determine the Y dimension and X Rotation. Expose these parameters by right clicking on the generator and going to Export>Y Size and X Rotation.
6. Create a new Numeric parameter node and connect to the newly exposed Y Size input. Set the numeric type to Scene Units and set the distance to 36m from the Parameters rollout in the modify panel.
7. Create a second Numeric parameter node and connect to the X Rotation input. Set the value to 15 degrees.
8. Create a new Segment and pick "RoofBottom" from the scene. Set the Z Alignment to Pivot and the top padding to -0.1m. Wire the segment to the Bottom Side input of the generator.
9. Clone the segment and pick "RoofHorizontal" from the scene and wire to the default input. Change the Top Padding to 0.0m and Right Padding to 11.6m. Set the X Alignment to Center.
10. Clone the segment a third time and pick "RoofVertical" from the scene. Ensure all the padding values are 0.0m, that X Alignment is automatic and set Properties>Transform>Y to -0.3m. Wire this segment to the Top Side input.

## Creating the cantilever

1. Copy and paste the existing generator and disconnect all the segments leaving only the spline and numeric nodes
2. Create a new Segment object, pick "RoofTop" from the scene and connect to the Top Side input of the new generator.
3. Set the X alignment to Center, the Y to Bottom and Z to Pivot.
4. Adjust the Right Padding to 11.579m and the Bottom to -0.5m.

## Creating the glass roof

1. Copy and paste an existing generator to create a third Array 2S node. Disconnect any segments leaving just the spline and numeric nodes.
2. Create a new segment and pick "RoofCap" from the scene. Wire this to the Bottom input of the new array.
3. Set the Y and Z Alignment to Pivot and change the Top Padding to -0.6m. Set the Properties>Transform>Fixed>Translation>Z value to -1.65m.
6. Create a Sequence operator, connect "FacadeFrame", then the Compose node we just created, then "FacadeGlass", and finally "FacadeFrame" again. This gives us a repeating pattern for the glass.
7. Connect the sequence to the Default input of the generator.
8. Select the sequence node, go to Properties>Counters, and set the Compose counter so that it repeats 5 times. The larger glass and roof bars should now align.
9. Copy and paste the "FacadeBar" segment, change Properties>Transform>Fixed>Rotation>Z to 90 and attach to the Top Side input.
10. Finally, because the glass roof does not cover the cantilever, add a new Arithmetic operator and a Constant node.
11. Set the constant value to 13.0m.
12. Wire the existing "RoofWidth" numeric node and the new Constant to the Arithmetic node's inputs.
13. Wire the Arithmetic node to the glass roof generator's Y Size input.
14. Finally, change the generator's Z Offset value to 1.65m to position it on top of the roof structure.

## Assign the correct spline

1. Close the style editor and go to the Base Objects rollout in the modify panel. Assign "Spline_Roof" as the new path.
2. To create a smoother deformation, open the Style rollout and change the Curve Steps to a high number, 500 works well.

## Conclusion

Over the last 5 tutorials we've looked at how RailClone can help you to model detailed stadiums by creating glass walls, railings, advertising, seating, audiences and finally a fully parametric roof structure. Though stadiums were the focus of these videos many of the techniques are  applicable in a wide range of other situations. For more videos visit our tutorials page.