# Introduction

This example is becoming a more complicated again and it will not be discussed at the same level of detail as the previous ones assuming some familiarity with GenerativeComponents at this point. If you are not familiar with GenerativeComponents yet start with the previous examples first. We start with setting up a new empty .gct file roofexample02.gct as usual.

For more examples refer to the GenerativeComponents Documentation page.

# Creating a Landscape

This time we build a landscape surface to support and adjust our bridge design.

Create a * BSplineSurface.ByPoles* using 12
ControlPoints ideally in a grid of 3x4. In one direction at least 4 are
advisable to be able to adjust the surface not just to concave and convex
settings but also s-curved cross sections for more interesting conditions for
the bridge.

# Adding the Bridge Supports

Once the surface is created, add support Points just
like in the previous example but this time they will be placed onto the surface
to follow it when the landscape changes. We can do so by creating * Point.ByUVParameterOnSurface.*
or better just using the point shortcut holding down the ctrl key and snapping to
the surface. Once the points are placed one recognizes that they are not
necessarily coplanar in their pairs. So we need to create an offset point each
for the pairs to compensate for this condition. The offset point will have its
origin in one of the points of the pair and its X and Y value set to 0 and its
Ztranslation value set to the Ztranslation value of the other point in the
pair. That way those two points are always level and we can connect them with
the support line.

Then we can place the familiar CoordinateSystem onto the respective Lines to use their XDirection as the direction for creating the tangent lines for the bridge curve connecting the two supports. For a detailed explanation of this step see the example before.

# Creating a responsive Bridge Pylon

Now to construct a pylon to support this bridge through a cable fan we need to create some sort of placeholder of a structurally determined position. We can work with an approximation of the center of gravity for now using a Series of points along the curve of the bridge and then using the centroid position of all the points in the set.

This gives us the upper most point for the pylon direction. To get the point on the landscape we can try to project the mid point of the bridge curve line onto the BSplineSurface.

Now we can connect the two points and derive the
direction from the line. Using the direction we can create a * Line *by

*to project upwards beyond the direction line to create the highpoint of the pylon. The length factor depends on many factors of course, but for now let’s choose it to be half the length of the bridge curve.*

**StartPointDirectionandLength**# Creating the Cable Array

To get the fan of lines we can connect the end point of the pylon with the set of points along the curve.

# Roadway Surface

Creating the roadway was accomplished by creating a BSplineSurface using the sweep update method.

Next we adjust the pylon settings so it is easy to add more pylons while the distribution adapts. We accomplish this by creating BSplineCurve segments each with its own pylon construct and cable point array. This way when adding more curve segments along the original BSplineCurve the number of pylons also increases.

Switching back to a single pylon now with an improved landscape rendition. Here it is nicely viewable how the pylon leans against the curve.

A close up view.

Setting the number of pylons to 6 in the same context.

# Exercising the construct for different Variants

Super imposing several settings onto the same image.