# Making Patterns with Grasshopper

We will start this lesson from where we left off in the Intro to Grasshopper tutorial. If you are just joining us, in Rhino, we made a surface that is 80x45 mm and placed a point in the middle. I will shorten some of my instructions, so for example, instead of saying under the Parameter tab inside of geometry panel theirs an point component, I will write Parameter Tab > Geometry > add **Point**. You can also double click on the work space and just type the tool name for an even quicker workflow, in this case **Point**.

### Adding our inputs

- Delete the Color swatch and Preview component from the previous Algorithm. We will use them later.
- Parameter tab> geometry> add the
**Point**Component - Right click the Point component and click on set one Point
- Select the point you made inside of rhino
- Hide and lock the Rhino layers for right now
- Hide the Rhino Grid for a cleaner look. Go to the Rhino command panel and type Grid
- Type h and press enter to hide grid

### Making a point grid

Here we will make a simple grid of points based off our surface. We will use math to keep our grid the same ratio as our surface.

### Divide the surface

- Surface Tab > Utility > add the
**Divide Surface**Component - Connect the Surface output slot into the Divide Surface input slot

### Add a number Slider

- Parameters Tab > Input > add a
**Number Slider** - Right click on the Number slider
- select Sliders type, change to Integer
- select Values and change the max to 20

### do some math

- Duplicate the number slider 2 times. select > ctrl+C > ctrl +V
- Math Tab > Operators > add two
**Multiplication**Component - Change one slider to 16, another to 9 and the last one to 2
- Connect 16 to one slot A and 9 to the other.
- Connect 2 into both slot Bs

### Hide what we don't need

- Select all the components except the Divide Surface component
- Press Spacebar and click on Disable Preview
- This helps keep the preview less cluttered.

### Flatten our data

- In the Divide Surface component, you will see a little P in the output slot, this is where our
**Points**are - Right click on the P and select Flatten

### Measuring Distance

- Vector Tab > Point > add the Distance component
- Connect the Divide Surface output P to Distance input A
- Connect our Rhino Point output to input B

### Understanding Domains

**Domain**s are just a collection of numbers that are within the parameters we want. So lets say you have a dice. That dice domain is 1-6. It's lower limit is 1 and upper limit is 6, these limits are called **Bounds**. Curves and surfaces have domains. A simple line has a domain of 0 - 1. If I wanted to make make a sub curve of that line, I can tell Grasshopper, I want a subcurve in the domain .3 to .7. This would shorten the curve on both sides.

In math domains are incredibly important and valuable. It is the basis of scaling. Lets imagine we have a dice with 10 sides. You roll the dice 5 times and you get 7, 6, 8, 5, 6. The domain of that dice is 1-10 so we got 5 random numbers in that domain. Now these numbers are relative to each other and their domain. So if I take this information **remap** it to another domain, let's say 0-100, my numbers will become 70, 60, 80, 50 and 60. Here is an example of what that looks like. We will cover this more in detail on the next page.