8
S206E057 – Spring 2021 Page 1 (5/18/2021) Copyright ©2021, Chiu-Shui Chan. All Rights Reserved. Tutorial introduction: 13 online series of exercises @ http://vimeopro.com/rhino/grasshopper-getting-started-by-david-rutten. 1. Basics of interface between Rhino and GH – lecture 1: http://www.grasshopper3d.com/page/tutorials-1: This first video is a basic one that explains the connection between GH and Rhino. GH is a plug-in which components have geometry. These geometries will be displayed on Rhino, but they can’t be selected or changed. We could connect Rhino geometry and GH geometry through an interface mechanism. Otherwise, the GH components shown on Rhino are just previews. In some cases, generating previews uses a lot of processing power, so disabling preview of components is recommended. Note: a GH definition is also called GH component. a. Define a line in GH > click Curve menu > Select Line to put a line component in GH. b. Right click A > “Set one point” to put a point in Rhino as the starting point of the line c. Right click B > “Set one point” to put an end point in Rhino. This GH line in Rhino and the line component in GH are both in green color. But, the line in Rhino can’t be selected nor moved. d. Now build up a line that works both in Rhino and GH: i. Draw two points A and B in Rhino. ii. Right click A in GH > Set one point > In command line, select point type in Rhino> change the Type from Coordinate to Point and select a point. iii. Then, the Rhino point geometry will serve as the input of the starting point of the GH line component. iv. Repeat the same procedure for point B, the drawn line could be edited by moving the pts in Rhino. v. If the input Type is coordinate, then the coordinate of points, not the geometry, will be imported to GH. 2. Creation of 3D curves – lecture 2, Multiple Components—Generate changing lines between curves. a. Draw” two curves in Rhino, “divide” the two curves to 20 Rhino pts. b. Set up “line” component in GH, and use “Set Multiple Points” to pick points on Rhino line A to GH A; and points on line B to B. Then 20 lines between pts are drawn. (If GH component is closed, then the lines will disappear. Use Bake to save lines to Rhino.) To make an algorithm to divide and connect points is the following. c. Draw two curves in Rhino. d. Set up two divide curve GH components (or Curve panel > Division). e. On each component of “C” input part, use “Set One Curve” to assign the GH with the Rhino curves. f. Define a “line” component; link both output P of “Divide” to the input A&B of Ln. Lines are drawn. g. Apply Params > Primitive > Integer component with Integer value set up and link it to the count input. S206E057 -- Lecture 14, 5/20/2021, Interaction between Grasshopper & Rhino

S206E057 -- Lecture 14, 5/20/2021, Interaction between

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

S206E057 – Spring 2021

Page 1 (5/18/2021)

Copyright ©2021, Chiu-Shui Chan. All Rights Reserved. Tutorial introduction: 13 online series of exercises @ http://vimeopro.com/rhino/grasshopper-getting-started-by-david-rutten.

1. Basics of interface between Rhino and GH – lecture 1: http://www.grasshopper3d.com/page/tutorials-1: This first video is a basic one that explains the connection between GH and Rhino. GH is a plug-in which components have geometry. These geometries will be displayed on Rhino, but they can’t be selected or changed. We could connect Rhino geometry and GH geometry through an interface mechanism. Otherwise, the GH components shown on Rhino are just previews. In some cases, generating previews uses a lot of processing power, so disabling preview of components is recommended. Note: a GH definition is also called GH component.

a. Define a line in GH > click Curve menu > Select Line to put a line component in GH. b. Right click A > “Set one point” to put a point in Rhino as the starting point of the line c. Right click B > “Set one point” to put an end point in

Rhino. This GH line in Rhino and the line component in GH are both in green color. But, the line in Rhino can’t be selected nor moved.

d. Now build up a line that works both in Rhino and GH: i. Draw two points A and B in Rhino. ii. Right click A in GH > Set one point > In command

line, select point type in Rhino> change the Type from Coordinate to Point and select a point.

iii. Then, the Rhino point geometry will serve as the input of the starting point of the GH line component.

iv. Repeat the same procedure for point B, the drawn line could be edited by moving the pts in Rhino.

v. If the input Type is coordinate, then the coordinate of points, not the geometry, will be imported to GH.

2. Creation of 3D curves – lecture 2, Multiple Components—Generate changing lines between curves.

a. “Draw” two curves in Rhino, “divide” the two curves to 20 Rhino pts. b. Set up “line” component in GH, and use “Set Multiple Points” to

pick points on Rhino line A to GH A; and points on line B to B. Then 20 lines between pts are drawn. (If GH component is closed, then the lines will disappear. Use Bake to save lines to Rhino.)

To make an algorithm to divide and connect points is the following. c. Draw two curves in Rhino. d. Set up two divide curve GH components (or Curve panel > Division). e. On each component of “C” input part, use “Set One Curve” to assign the GH with the Rhino curves. f. Define a “line” component; link both output P of “Divide” to the input A&B of Ln. Lines are drawn.

g. Apply Params > Primitive > Integer component with Integer value set up and link it to the count input.

S206E057 -- Lecture 14, 5/20/2021, Interaction between Grasshopper & Rhino

S206E057 – Spring 2021

Page 2 (5/18/2021)

h. Apply Number slider with the range of 0<10<100 as input with Integer defined and link to the count to make the change dynamic. In this case, 10 was the default number. We shall link the Number slider to Integer Primitive to declare that the input is integer type for the count (N).

In results, we will have two Rhino curves, and flexible GH points, If we move the control points of these Rhino curves up in Z direction, then they could be seen as two arches, The linked GH lines could be treated as beams connecting these two arches in space. All we need are columns, trusses, or cables to support these arches and beams. The image on the lower left has zero linked line, whereas the right one has 100 links. These elements on the right image have GH points and lines with no surfaces yet. We also have to put meshes to make them solid and bake into Rhino model component.

3. The method of editing the GH component in real time – lecture 3, refining a definition: a. Apply the same two curves done in Tut-2. b. Add a new curve in the middle of the two curves. c. Set up a “divide curve” definition in GH. Assign it to the middle curve. d. Define a “number slider”, and a “pull point” to project points from an object to the nearest objects (Vector >

Point > Pull Point). Select G in the pull point component, right click > select “Set One Geometry”, select curve A. Connect point output in Divide Curve component to the point input in “Pull Point” component.

e. Then, make a copy of the Pull Point and assign its geometry to curve B. (Note: The divide curve is to divide the curve by the number of segments. The other component that divide the curve by length is the function of Curve panel > Division > “Divide Length”.)

f. Use an “Arc-3pt” definition or a line definition connecting the divided three curves, see the following results.

Here are the different results from applying different algorithms. The point is to use simple algorithm for good results.

1. Method 1: Applying the first algorithm used in the last exercise with the control points of the two curves being lifted up with various Z values to get 3D effects, the connections between two curves are straight lines.

S206E057 – Spring 2021

Page 3 (5/18/2021)

2. Method 2: Applying a curve in the middle of the two curves with the same amount of control points as the other two curves, lift up the Z value of the middle curve smoothly. Then apply 3 point Arc function to get the edges curvedly connected. The Pull Point function in GH will not be able to get a constant cut along the top of the curves to get a good result of arch supports. This is the same as the example given on the last page. But, the curves are 3D.

3. Apply divide function to three curves and define a 3 point arc. In result, the final form is a smooth series of arches, lined up along the evenly divided distance from the curves. After the arcs are generated, select the arc component, and right click to select “bake” to bake the geometry to Rhino as parts of the Rhino model. Note: Baked geometry is a copy of the GH geometry. Any alterations in GH will result in alterations of the GH geometry not of the baked geometry.

4. Creating Biarcs: Note: A biarc is a kind of model commonly used in geometric modeling and computer graphics. It is composed of two consecutive circular arcs with an identical tangent at the connecting point. Since the tangents at the connecting node are the same, the G1 continuity property is preserved. G1 means that the curves share a common tangent direction at the join point.

a. Draw two curves in Rhino. b. Define two “Divide” components and assign both to the drawn two curves respectively. c. Create a slider with “0<5<50”, which creates a slider with minimum of 0, maximum of 50 and default is 5. d. Then, link the slider output to the input N of two “Divides”. These two curves are divided into 5 segments

with 6 dividing points. e. Generate a biarc component, Curve panel > Primitive > Biarc, link the output P of Divide A to the Start

point of BiArc, and the other point of Divide B to End point of Biarc.

S206E057 – Spring 2021

Page 4 (5/18/2021)

f. In this example, we could apply Vector > Vector > Unit Z to create a vertical curve by defining it as the Ts input. This means that the vector Z is parallel to the world coordinate Z axis.

g. For the end point tangent of Te, apply another Z component vector to it.

h. The curves are down and we need to reverse the vector to make a smooth curve. Vector > Vector > Reverse. Link the Z unit output vector to Reverse input and Reverse output to the Biarc endpoint tangent.

i. Results of the single curve are the combination of two curves, which could be changed by ratio. Ratio could be the slider between 0 and 1. 0 ratio will have the curve meets at the end of one curve. 0.5 is the default of meeting two curves in the middle of the resulting curve.

S206E057 – Spring 2021

Page 5 (5/18/2021)

j. These two parts of the resulting curves could be lofted to form 3D meshes, Surface > Freeform > Loft, by linking A1 to Loft A, and A2 to Loft B. Two meshes will be created. See the image on the lower left.

k. Then, join the lofted two meshes into one. Note: a mesh is a boundary representation, which is recognized by the Brep component. Brep Join is a function to join a number of boundaries or Breps together, Surface > Utility > Brep Join.

l. Hold down shift to link the two Loft outputs to the “Brep Join” input. The generated surface is a polysurface. The united mesh, the polysurface, could be extruded (extrude along Z vector) to generate a plate.

m. In GH, Surface Offset only works on individual surfaces. It cannot handle both polysurfaces. The Offset Surface only works for one half of the geometry. At present GH doesn’t have a solid offset component even though Rhino 7 has a command for this now. If the polysurface is not a complicated one, one could bake the Join Brep to Rhino, and apply OffsetSrf to make a solid out of it. But, results of this example are too complicated for Rhino to handle (it doesn’t work here).

Summary: The benefit of creating geometry directly in GH is basically that it is defined by parameters and is easy to change. Sometimes you don’t want to change a certain shape, then it is better to create it in Rhino and input its data to GH. 5. Example of utilizing BREP to create a vase There is a component called Brep that needs to explain. Brep is a collection of faces, or Boundary REPresentations. The face could consist of an underlaying surface (which may be a Nurbs surface, or a revolution surface, or a sum surface, or a plane) including trimming curves. Thus, a Brep consists of faces, surfaces, loops, trims, edges and vertices. It is in fact a topological entity much more than a geometric entity. All surfaces and polysurfaces in Rhino are Breps.

S206E057 – Spring 2021

Page 6 (5/18/2021)

The following example is to utilize BREP (Params > Geometry > Brep) to generate a glass vase with a special module attached. Here are the short explanations of the algorithm.

1. A surface will be created or say summed up (Sumsrf, Surface > Freeform > Sum Surface) by combining two curves. In this example, one is the profile of the vase and the other one represents its height. In this example, we could use local definition to import the two curves to A and B in Sumsrf. Yet, for programming convention, we should use “Curve” parameter, which is a collection of curve geometry, to save the curves for Sumsrf input. Position of A will determine the position of the generated form.

2. The resulting surface, which is the overall volume S, shall be divided (Maths > Domain > Divide Domain Square or Divide Domain2) into grids by X (U) and Y (V) numbers.

3. The basic module of the basic form pattern (lower right image of a cross plate) will be imported from Rhino into GH through Brep, and it will be used to morph on the Sumsrf. Thus, we need a Bounding Box to orient the geometry. (BBox, Surface > Primitive > Boundary Box, or type bbox).

4. The bounding box shall be deconstructed into its own constituent parts (DeBox, Surface > Analysis > Deconstruct

Box) to get its x, y, and z values.

5. Results of the DeBox will provide the z value to represent the height (or say the depth of the body of the vase). And the overall volume S of SumSrf are used to create a twist box on a surface patch (or say surface box, SBox).

6. The overall shape will be deformed (Morph) by combing the basic module (Geometry) with the boundary box BBox (Reference box) put it to the divided surface box SBox (Target) to make a final object. The concept of morph is to transform or be transformed completely in appearance or character.

Here are the curves. Here is the image of a compositional module. Here is the GH program that creates a composition. Here are the results.

S206E057 – Spring 2021

Page 7 (5/18/2021)

Take home exercise -- another example of creating an organic form from lofted objects.

a. Create three curves. b. Move curves to three different positions, see the

image on the right. c. Put a Curve parameter component in GH, click set

multiple curves and select the three curves sequentially by Reference Mode. In this case, the sequence of selection matters a lot.

d. Set a Loft component and link the curve output to C input of Loft component.

e. Apply divide domain square component, it will allow us to divide the domain by U and V dimensions. f. Generate two number sliders of 0<20<40 for U & V on domain component. This is the concept of dividing a domain which

is the loft surface into segments representing the dimensions of a basic module. See lower left image.

g. In Transform > Morph > Surface Box, or type Surface Box and link the output of Loft to Surface input of SBox, the domain (D) input is the divided segment output. The height could be defined by number slider of 1. See upper right image.

h. Model a basic pattern by box, sphere, and Boolean Difference. See lower left image.

i. Apply Brep > select the Brep of the modeled pattern. j. Transform > Morph > Box Morph, or just type Morph in the component search window. The box morph component will

morph a basic pattern object into a twisted box. In this case, the G of Morph is Brep output, which will be used as the reference box and put it to the target of the surface box (the divided loft object). See the right image on the last page.

S206E057 – Spring 2021

Page 8 (5/18/2021)

k. Create a more advanced pattern of double layers of the pattern, see lower two images.

l. Redefine the Brep by clear value and set multiple Brep again to select the double layer. m. We could also use a more complicated basic form for morph by using a Bounding Box (Surface tag > Primitive >

Bounding Box) to group the geometry together into a box representation. Its Box output is the reference of the Morph component input. The Brep geometry is the geometry input G of Morph. See the results of applying the first pattern below, this example is similar to the lab exercise we did in class. But we don’t use deconstruct box function to get the dimension of its height, we just use slider to define the H value in the SBox function.

n. For the second pattern, rotate the pattern 180 degrees, to get the result as the right image below. Or, apply reverse in the loft component “c” input parameter to change the curve direction. Of course, the curve selection sequences on the “Curve” parameter influence the “normal” direction of the resulting loft surface.

Reminder:

In this exercise, we deformed the solid geometry by a few methods to get organic forms. Basically, we have to construct the basic shapes first, and followed by sequential steps for the creation. Thus, Rhino modeling and GH are similar in some ways and different in other ways. Keep in mind that many functions in Rhino are supported by manual mouse input, or by the optional settings in the command line. Yet, in GH, we don't have that system supports for manual input. We must precisely define every step in the processes for generating geometries. Otherwise, we ought to look for GH plug-ins to make the creation workable.