分享

Tutorial 6

 koko_Librate 2014-01-28


Introduction

Result of this tutorial

This tutorial will be about creating a curved brick wall using a 'stretcher bond' brick pattern that consists of bricks of the same size laid from the mid of each bricks above and below. In this tutorial you will you will use mathematical functions to generate the wall and will use the dispatch function to achieve the 'stretcher bond' pattern.

The Design

As said before, the task of this tutorial is to make a curve brick will with a 'stretcher bond' brick pattern. The variables of the definition will be:

  • the wall height
  • the wall lenght
  • the brick dimensions
  • the vertical and horizontal distances between the bricks

Building the grasshopper model

Step 1 - Creating a cosine curve

Generated points with a cosine function

The first step will do is to generate the basic curve shape of the wall with a cosine function. We first make a list of points with the cosine function. Then we translate these points to a curve with the 'Interpolated curve' function. You can find the cosine function at:

Math ? Trig ? Cos

We connect the cosine function to the Y input of a grasshopper 'Point(XYZ)' component.

Vector ? Point ? Point XYZ

Now we need a number of values to generate a list of points. Create a range and a domain for the range:

Sets ? Sequence ? Range

Math ? Domain ? Domain

Create two sliders and connect them to the a and b input of the domain. Set the a input of the domain to zero and the b input of the domain to 30. Connect the output of the domain to the domain input of the range. Create an other slider and connect this slider to the range N input (number of steps) of the range. Set this slider to 60. Connect the range to both the X input of the Point XYZ component and to the x input of the cosine function. Your grasshopper definition should now look similar to the image right above this text. Also you will probaly see now a series of points following a cosine function on your screen.

Now we translate these points in a interpolated curve:

Curve ? Spline ? Interpolate

Now you will have the basic curve that will be used to define the shape of the wall. In the next step we will create the basic location and rotation data for the bricks.

Step 2 - Defining the location and rotation data for the bricks

Vertical lines according a preset distance

We will use the cosine curve from the previous step and divide this with a preset distance between each division point. This distance will be related to the distance between the center of each brick. The first thing we do this step is creating a series of vertical lines. The height of these lines will be our height of the wall. First divide the cosine curve with the 'Divide distance' component.

Curve ? Division ? Divide distance

Make a slider and connect this to the D input (distance between points) and set the slider value to 0.27. Use 'Line SDL' function to make the vertical lines.

Curve ? Primitive ? Line SDL

Connect the division points output P from the 'Divide distance' component to the S (start point) input of the 'Line SDL' component. Connect a Z vector to the D (Direction) input.

Vector ? Vector ? Unit Z

And make a slider dat connects to the L (lenght) input and set the slider value to 8.

Tangent vectors for the division points

The 'Divide distance' component also has a tangent vector output for each division point. We will use these vectors as basic data for the rotation of each brick. You can visualize these vectors with a 'Vector display'.

Vector ? Vector ? Vector Display

We will use this vectors later. First we create the vertical points that will be the center of our bricks. Divide the vertical lines we created in the beginning of step 2. Again use the 'Divide distance' component and set the division between the points to 0.23. This vertical division parameter will define the vertical distance between the center of each brick.

Now we create a plane for each point we just created. We create a serie of horizontal planes with:

Populated XY planes on points

Vector ? Plane ? XY Plane

Connect the P output from the divided points from the vertical lines to the input of the XY plane component. You will now probaly see a lot of planes populated on the points. The problem is that all thes planes are still facing the same direction. This will mean if we use these planes as a basis for our bricks then they will all not be rotated along the curve but all we be facing the same direction.

We can use the tangent vectors from the divided cosine curve to align the planes. The function we need is located at:

Vector ? Plane ? Align Plane

Before connecting the XY planes to the P (plane to straighten) input of the 'Align plane' component we first need to flip the data from the XY planes because the data matrix is not ordered in the way we need. Find the 'Flip Matrix' component at:

Aligned planes on points

Sets ? Tree ? Flip Matrix

Connect this flipped data to the P in put of the Align Data

Vector ? Plane ? Align Plane

Now connect the T output of the divided cosine curve to straighten the planes according the tangent vectors. The planes should now be aligned as the image at the right.

Step 3 - Populating the bricks

Dispatch pattern
'Stretcher bond' plane pattern
Populated bricks

Last step is populating the bricks according the planes. We use a 'Center Box' component that will use the aligned planes a basis to generate the bricks. But before we do this we have to achieve the 'stretcher bond' brick pattern. We will use a 'Dispatch' to get this result.

The 'Dispatch' component tests a list of data according a true false pattern. It will read 1 values as true and 0 values as false. The true values will be listed in the A output and the false values in the B output.

Before we use the dispatch function we have to flip the matrix of the P output of the 'Align Plane' component from step two. Connect the output of this flipped matrix to the L (list to filter) input of a dispatch function. Find the dispatch function at:

Sets ? List ? Dispatch

The default dispatch pattern (True false) is fine in the case of this tutorial.

Copy the 'Dispatch' component with the 'flip matrix component' and connect one of the copied groups to the A output of the first 'Dispatch' and the second group to the B output of the Dispatch. Then create two plane visualizers and connect one to the A output of the first copied dispatch group and the other to the B output of the second copied dispatch group.

Params ? Geometry ? Plane

Disable the preview of all dispatch components. You will now see a 'stretcher bond' pattern of the planes in your Rhino screen.

Now we generate the bricks. As said before, we will use the 'Center Box' component for this. You can find the center box Component in:

Surface ? Primitive ? Center Box

Connect the planes we created before to B (Base plane) input of the 'Center box'. The create tree sliders to define the X, Y, and Z Dimensions of the box. Set X to 0.25, Y to 0.10 and Z to 0.12. Now you will see brick shaped boxes populated according the planes and you finished your 'Stretcher bond' cosine wall. 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多