Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
GenerativeComponents
  • Product Communities
GenerativeComponents
GenerativeComponents Community Wiki Free Form Roof Example
    • Sign In
    • +An Overview of GenerativeComponents
    • +Addin Content
    • +Bentley BIM Modeler Accreditation – Program Overview
    • +C# Sample Solution and other Add-ins
    • +GenerativeComponents Solutions
    • +Learn GenerativeComponents
    • +Reference Material
    • Support for GenerativeComponents
    • -Tutorials
      • 3D array copy surface
      • Add RFA data as BuildingContent to ABD with GC Extension
      • BSplineSurface.LoftCurve is throwing an error when trying to add get the curves from cell
      • Cell Feature
      • Create a Set of Random Points
      • Creation of Global function from Custom function
      • Creation of Parabolic curve
      • Error while creating GNT
      • Free Form Roof Example
      • GC Excel Feature
      • GenerativeComponents Essentials Course
      • Get Corner points of a Solid
      • How To Create Surface From Lines & Curves
      • How to Export GC elements
      • How to get concrete sections in the cross-section dialog in Generative Components
      • Landscape Bridge Example
      • +LawCurve
      • List Of Points With A Loop Example
      • Mesh feature 3d print
      • Modular Multiplication On Circle
      • +Operation Node
      • +Optimization with the Optimizer node type
      • Palm Tree Modeler
      • Point By Function Example
      • Points On Curve
      • Prime Number Pattern
      • Selection of Points
      • Selection of points based on Query Expressions
      • Selection of points based on range of indices
      • Set a New Property Value to a Set of Selected Nodes
      • Simple Bridge Example
      • Simple Equations To Describe Form Example
      • Simple Free Form Roof Example
      • Sin Tower
      • Skeleton
      • Sunflower Seed Pattern Modelling
      • Surface Division Basic Steps
      • Surface from Rails and Swept Sections
      • The use of Packager in Generative Components
      • +Tools and Techniques
      • Ulam Spiral From A Rectangular Spiral
      • Video Tutorials
      • Video Tutorials - Short Techniques
      • Working with Parametric cells
    • +User Projects
    • +Visualized Parametric Experimentations
    • +zed_Older Content

     
     Questions about this article, topic, or product? Click here. 

    Free Form Roof Example

    Introduction

    The goal is to create a freeform roof following a spatially curved path in a landscape (for simplicity we will not model the landscape here explicitly). The landscape is represented using only four top level control points. The example demonstrates how robust hierarchical parametric modeling can give an easy to manipulate model with complex geometric Features downstream and aesthetically interesting geometric responses.

     For more examples refer to the GenerativeComponents Documentation page.

    Create a new GCTransaction file

    • Create a new GenerativeComponents Transaction file by pressing the New Script Transaction file button .
    • Arrange the windows in such a way that they do not overlap and both the symbolic view and the geometric view are visible as well as the GenerativeComponents control panel.

    Save the .gct file

    • Save the file with an appropriate name, for instance, roofexample02.gct by clicking on the Save or Save as icon . If you resume your work, open the file using the open button  . GenerativeComponents does not save geometry, but the instructions to generate geometry, so the .gct file cannot be opened in MicroStation or other CAD programs directly.

    View Rotation and the View Window Toolbar

    • Press  for view rotation. To get back to an orthographic view select the spinning arrow and switch from dynamic to “top” in the pull-down menu. This is MicroStation functionality.
    • To zoom in and out there are the + and – buttons  at the bottom of the window frame for Pan  and Fit  .
    • To shade a view, click on the lightening bolt and select the shading mode  .

    Placing the Path Control Points

    • To begin the model, select the point creation shortcut  and place four points in an axonometric view into the geometric model in a zigzag fashion.
    • These points are the base for the path that winds through the landscape (we skip modeling the landscape here for time sake).

    Create a BSplineCurve from the ControlPoints

    • To create a Feature that does not have a shortcut button, open the Feature list .
    • Click on the BSplineCurve Feature and expand it.
    • From the available Feature method (the different possible ways to create this Feature based on various combinations of inputs) select the one ByPoles.
    • The Poles variable expects a List of points to create a BSplineCurve. The syntax for a List in GenerativeComponents is

    {point1, point2, point3}

    where each element is separated by commas between opening and closing curly brackets {}.

    • In order to construct the above list, click on the Poles input field after expanding the ByPoles UpdateMethod and click between the curly brackets in the input field.
    • To select an existing Feature, for instance one of our four points, HOLD DOWN THE CTRL KEY, then hover over the point in the geometry or symbolic view until the name of the Feature appears in the input window. Clicking confirms the selection and add a comma. Repeat until all four points are filled in, then press Enter to confirm the selection.
    • For the Order fill in “3” for now; this is the order of the BSplineCurve. The Order is maximal the number of ControlPoints, which here is 4. It defines the type of curve that is constructed from the point, Order 2 would create a polyline.
    • To complete the command press Apply.
    • You should now see a BSplineCurve that follows the control polygon defined by the four points.

    Creating one sample “T” Cross Section

    The next step is to create one inverted “T” cross section of the roof along the path. In order to complete the roof we will construct one cross section first and later replicate it along the path.

    For the section we need a plane that is perpendicular to the path and one that is parallel to the horizontal component of the path.

    • Start by opening the Feature library  . If it is still open first press Cancel at the bottom and then reopen it by selecting the “square with rays icon” again.
    • Scroll to “P” like Plane and open the methods. Select ByParameterAlongCurve as the creation method.
    • As the curve select our BSpline by HOLDING DOWN THE CTRL KEY and THEN hovering over the BSplineCurve.
    • For the T Parameter type in a number of type double between 0 and 1, which is the permissible range for a parametric curve in GenerativeComponents, so for instance 0.3 and then press Return.
    • Right-click on the T variable afterwards and make sure the free option is checked so the plane can be moved along the curve for testing.
    • Select the Move tool  and click on the red circle handle that is around the plane you just created.

    • Create the second plane that will be horizontal at all times. To create it select Plane from the Feature library  again but this time choose ParallelToPlaneThroughPoint as the update method.

     

       

    • For the Origin you could select any Point, Plane or CoordinateSystem  (since the input expects an IPoint, which is the interface that stands for all point-like Features), but we want the Plane to follow the initial Plane on the path, so we can intersect the two. So choose the first plane (using Ctrl again) as the origin.
    • As the ReferencePlane we will use the baseCS.XYPlane of the baseCS CoordinateSystem. To do so, first select the baseCS (using Ctrl again) but instead of pressing Enter add a “.” period/dot after the Feature name. The dot expands the list of available properties.
    • Select the XYPlane from that list by double clicking on it and then press Enter. This creates the second Plane, plane02 at the same location as plane01 but with a different orientation.

    Creating the Vertical Section Line

    • Now we can use plane02 to create a Line that defines the height of our roof. To do so, choose the Line Feature from the Feature list  and as the update method choose ByStartPointDirectionAndLength. The StartPoint is plane01, the direction is the plane02 (a plane is basically a vector normal to the plane at its origin and therefore can be used as a direction). As Length let us use a fixed number to start with, depending on the scale of your model, for instance 3 then press OK.
      If you want to jump ahead, use the expression  5-plane01.Z instead, which makes the length responsive to the path. See step 11 for an explanation.

    Creating the “Ribs” or Outrigger of the Roof Section

    To create the “ribs” or outrigger of the roof, we need to first define the direction the cross members should be pointing to. We can derive this direction from intersecting the two planes we already have since their intersection creates a Direction that is always horizontal and always perpendicular to the curve.

    • To create a Direction we need to go to the Feature library  and select the Feature “Direction”. As the creation method we choose ByPlanePlaneIntersection. Fill in plane01 and plane02 and click OK.

    • Now that we have the direction of the ribs we can create two lines that point in opposite directions from the planes.
    • Select Line again from Feature list and as the method ByStartPointDirectionAndLength. The StartPoint is again plane01 and the Direction is the direction01 we just created. As length we use a fraction of the length of the vertical line. In order to create that reference we select the vertical Line line01 then use the dot again to access its properties, double-click on Length. Multiply the result by 0.5. The final expression should look like this:

    Length = line01.Length * 0.5

    • Press Apply only, not OK, to keep the dialog window open, because we need it for the next step.

    • To repeat the Line to the other side we can use the Create Copy button to the left of Apply.  Create Copy keeps the current values but creates a new Line instance. The only change we need to make is inverting the direction of the Line by changing the Length from 0.5 to –0.5. Now press OK.
    • We should see an upside down “T” now, which is our roof section.

    Replicate the Section along the Curve

    Now we will replicate the single section multiple times along the curved path. We will use a unique GenerativeComponents piece of functionality to do this. We can replace a single input value for a Feature with a “List” of values, which causes anything that depends on that Feature to be replicated for each of the values in the array. In our case we will use the “T” parameter of plane01. Instead of a single T = 0.3 value we will replace it with a “List” of values. The syntax for a list requires curly brackets and coma separated values.

    T = {0, 0.2, 0.4, 0.6, 0.8, 1.0}

    • To change the T value we use the edit tool   for plane01. Select the edit tool and click on plane01 (the plane with the red handle circle).
    • In the edit window click on the T value and replace the single value T = 0.3 with the List

    T = {0, 0.2, 0.4, 0.6, 0.8, 1.0}

    • Press Apply and observe what happens with the section. It will replicate along the curve for as many times as there are values in the List.
    • Alternatively we could also use the function :

    Series(0, 1.0, 0.1)

    here, a function that generates the above list for us.

    Creating a Surface from the Line.EndPoints

    We can now use the Lists of Line.EndPoint’s of the sections to define a BSplineSurface, which will be the design surface for our roof.

    • To create a BSplineSurface select it from the Feature list  . As the creation method, select ByPoints. One could also use ByPoles but then the surface would not pass through the high point.
    • For the Points input we need to create a nested List. A nested list is of rank 2, which means it is a list of lists, which is essentially Lists, as we showed them above, nested inside another List. For instance {{0, 0.2, 0.3}, {0.1, 0.5, 0.4}} But here we need references to Points instead of numbers so we can construct the surface.
    • The lines are replicated already and therefore form Lists of Lines. Their EndPoints are also Lists, so we can reference to them directly. For instance

    line01.EndPoint is such a List

    • line01.EndPoint[0] would refer to line01’s EndPoint only so we need to remove the index ( [0] ). To construct a nested List of points we need to construct a List of the EndPoint’s of  line01, line03 and line02 The expression should look like this:

    Points = {line02.EndPoint, line01.EndPoint, line03.EndPoint}

               Be sure to remove the [0] indexes after selecting the lines with the Ctrl key since we want the entire List of EndPoints not just one.

    Making the Roof Height Responsive to the Path Elevation

    (Skip this step if you already adjusted the vertical Line height in step 7.)

    Currently the roof height is constant in height and width even as the path goes up and down. To make it more interesting we can make it responsive to the undulation of the path. To do so we replace the fix length of the vertical line, line01,  of the sections with an expression that calculates the height as a function of the desired maximum height of the roof and the height of it base point along the path.

    • Edit  the vertical Line line01 by clicking on the edit tool and then the line.
    • In the length field of the Line subtract the Z value of plane01 from a fixed value. This value will be the maximum elevation of the roof in absolute Z of the baseCS CoordinateSystem

    Length=5-plane01.Z

    • This will adjust the height of the roof so that it will always exactly reach the height of absolute 5 in the Z-Axis of the baseCS. This is possible because the simple equation varies the line01.Length to compensate for the ups and downs of the path.
    • Play with the Move tool to vary the initial four point’s height and position to see the roof respond.
    • This completes building the roof surface. The next step explains how to create a user-defined component and populate it on the surface.

    Creating a User defined Feature for a Roof Panel

    Additional steps could be placing a grid of components on the surface that responds to the distortions of the roof.

    We will show one way here using a point grid on the surface and an intermediary PolygonGrid to place a user-defined cross bar panel along the surface. To start do the following:

    • Place a point on the roof surface. Use the point shortcut    but now hold down Ctrl key before hovering over the surface. If the point shows to circles around itself it is on the surface. Click to place it anywhere on the surface.

    • Once the point is placed on the surface use the edit command on the point.
    • Replace the current U and V value with a Series functions to obtain a grid of point rather then a singular point. To look up available function, press  .
    • U should be set to U = Series(0.0,1.0,0.05)
    • V should be set to V = Series(0.0,1.0,0.1)   The Series function returns a list of values from 0 to 1 in steps of 0.1 {0, 0.1, 0.2, 0.3, ….., 1.0}

     

    • Click Apply. You will see a diagonal set of points. In order to get the full grid of points you need to toggle the replication option of the point. Choose and click on the points once. That turns the diagonal into a full grid of points.

    • Create a Polygon.ByPointGrid based on the point grid just created. This grid serves as the placement method for a diagonal cone grid of our roof.
    • Select the Feature Polygon and as the creation method used ByPointGrid. Set the PointGrid variable to the point05 we just created on the surface. When selecting the point make sure to erase the index’s [0][1] to get the entire array not just one point of it.

    • Once the Polygon grid is created hide the original BSplineSurface by selecting the hide tool and selecting the surface.

    Creating a User Defined Feature

    Next we will create a simple prototypical crossbar panel. We use a placeholder Polygon to create it on the side. Then we create a new Feature from it. After that we can use the new Feature to populate the roof surface using the grid of Polygons instead of the placeholder as the input to our crossbar panel. This creates an elegant lattice as a roof, which still can be manipulated moving the initial four points of the path. So to start:

    • In order to create a crossbar Feature we first have to create a placeholder to simulate the roof input point grid. Let us place four points in a square configuration away from the roof using the point shortcut .
    • Using those points create a Polygon from the Feature list using the ByVertices updateMethod. The input needs to be in the form of a list of points again like this

    Vertices = {point06, point07, point08, point09}

    Make sure your point names match the point names here.

    • After creating the Polygon, hide the original points using the hide command. This is helpful to not accidentally select them. In order to be able to replicate the generative component using a Polygon grid we need to use only the Polygon vertices as input, not the underlying points.

    • Create the crossbar members by first creating a diagonal Line in each direction. Select the Line Feature from the list  and create it using the ByPoints updateMethod. As:

    StartPoint = polygon02.Vertices[0]

    and 

    EndPoint   = polygon02.Vertices[2]

    For the other diagonal press Apply and then the next button and replace a [1] for the [0] and a [3] for [2] in the Vertices index. A Polygon counts its Vertices in a circular fashion, not row by row. In this case we have four vertices, therefore, the index goes from 0-3. You should now have a diagonal cross.

    • Add a Cone Feature from  using the updateMethod ByLine. As the Line use the diagonal. As the starting radius we do not want a fixed number as the scale of the component is not fixed. In order to make it responsive we need to tie the radius proportionally to the length of the diagonal. To do so, set:

    StartRadius = line04.Length / 25.0 

    25 is an arbitrary scaling factor to scale down the radius, feel free to adjust it. Repeat adding a cone to the other diagonal as well.

    • Now we create a new user-defined Feature from our crossbar. To do so select the  Generate Feature Type tool.
    • A new window opens. Press  to define the Inputs for your new Feature.
    • The symbolic mode turns grey to prepare for your selection. As input, choose the placeholder Polygon (polygon02) we created for our component. Then press OK on the tool bar.  The tool bar might be hidden behind another window.

    • In the symbolic view you should see the Line and cone icons in green which confirms your selection, this will be the Output of your new Feature, the input, and the polygon appears in green.
    • In the big window that pops up be sure to select the “Replicatable” check box in the input list for the polygon. This makes it possible to have multiple polygons as inputs and not just one.
    • Also, in order to not draw the lines in the final placed crossbar Feature check the “construction” for the two diagonal lines.
    • Give the Feature a name in the Class name field. Add a number as you are likely to create several versions and it becomes hard to distinguish them in the Feature list. Then press OK to create the new Feature.

    Placing the new Feature

    In the final step, place the new Feature crossbar01 onto the Polygon grid on the roof.

    • Bring up the Feature list. It should now show the new Feature we just created called crossbar01 (or whatever name you choose) select the ByDefault update method and select the grid of Polygons on the BSplineSurface, polygon01 as the input. Be sure to remove the index square brackets when selecting the polygon01 with the Ctrl key, as we want to use all polygons, not just one. Press OK and you should see the crossbar grid populating the surface. As the last step hide the Polygon grid polygon01 in order to see the crossbar01 grid more clearly. Then shade the view by selecting  and “shade” in the pull-down menu at the bottom in the MicroStation view tools.

    The roof shaded with outlines and hidden lines.

    We are finished. In order to be able to move the initial points you may want to toggle the BSplineSurface update property to Deferred using the   deferred tool. Click on the bSplineSurface01 in the Symbolic tree model (since it is hidden we cannot select it from the geometry model). This caused the BSplineSurface and all its children (the crossbar, etc.) to not update while moving the path points. Once the path is adjusted you need to toggle the deferred property of the surface again to update its position. Below the symbolic tree is shown with the BSplineSurface hidden and deferred, which causes its children to turn red as well indicating they inherit the deferred state.

    • Be sure to switch off the deferred property again. We can now adjust some of the Features, for instance change the range of points on the surface to only populate parts of the surface.
    • This is done by adjusting the Series function of the V input for point 05 to go not from 0-1 but only from 0.2-0.8

    V = Series(0.2, 0.8, 0.1)

    • Many other changes are possible of course. We can also increase the density of crossbar members by reducing the increment size of the point grid by setting U and V of point05 to

    U = Series(0, 1.01, 0.025)

    V = Series(0, 1.01, 0.05)

    • This quadruples the number of crossbar Features and makes for a more finely-spaced lattice, as shown below. Adjust the perspective setting of the camera by clicking on  and click and drag in the view 2 window to get a more interesting view as shown below.
    • In addition the line02 and line03 list were used to create a BSplineCurve.ByLoftCurves to create the floor of the roof.

    • Share
    • History
    • More
    • Cancel
    • Jonathan Asher Created by Jonathan Asher
    • When: Tue, Oct 14 2008 12:08 PM
    • CWiacek Last revision by CWiacek
    • When: Thu, Feb 17 2011 9:34 AM
    • Revisions: 9
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies