# How do you divide a surface into a grid of smaller surfaces?

## How do you divide a surface into a grid of smaller surfaces?

Contents

- 1 How do you divide a surface into a grid of smaller surfaces?
- 2 Intro to Python Scripting: 22 Divide Surface to Pts
- 3 Related Content
- 4 Want to Contribute?
- 5 Subdividing surface
- 6 Grasshopper 3D Grid from Surface
- 7 Contents
- 8 Introduction
- 9 3D Grid from Surface
- 10 BoxMorph
- 11 Surface Analysis
- 12 Color by Slope
- 13 Rhino Grasshopper Tutorials
- 14 Learning Grasshopper for Rhino
- 15 computational design and generative art
- 16 Dividing Geometry
- 17 grasshopper code

I am trying to divide a roof surface into a grid of 4′ by 2′ rectangles. So far I have only been able to divide the surface into a grid of points but haven’t been able to figure out how to create individual surfaces out of them.

This is the geometry I am trying to divide.

### Replies to This Discussion

Permalink Reply by Aaron on July 26, 2011 at 2:48pm

To simply divide a surface into smaller surfaces, you can use IsoTrim (image below). To get them to be constrained to 4’x2′ dimensions requires your surface to be a factor of 2′ in one direction and 4′ in another (I assume). You can probably get really close by messing with the UV values. Hope this helps.

Permalink Reply by Andrew Heumann on July 26, 2011 at 7:07pm

When you’re dealing with trimmed surfaces like this, things can be a bit more complicated. Using the isotrim component as the others suggest will give you rectangles that lie outside of the boundary of your roof. In order to avoid this I would calculate the surface isocurves at the appropriate spacing and then use these to split the surface.

As Aaron suggests, you could get close to this 4’x2′ dimension by dividing the UV dimensions of the surface. For more accuracy, assuming the surface is planar, you could generate the splitting curves another way, directly offsetting them by the required dimensions. The attached definition shows both strategies.

Hope that helps!

P.S. I think this makes you the third LWHS student on the Grasshopper board! I had no idea you went on to study architecture. How are things?

Permalink Reply by Aleksander Łapiński on May 17, 2013 at 6:48am

Do you guys have an idea, how to divide those divided rectangles into a smaller grid ? Is there any possibility ?

Permalink Reply by Grasshope on September 15, 2015 at 10:42pm

Can anybody advise how to do this using Rhinoscript? thanks!

www.grasshopper3d.com

## Intro to Python Scripting: 22 Divide Surface to Pts

In this quick tutorial we divide a surface up into points using python. This is a really quick tutorial, but is useful because it shows one way to reparameterize a surface using python.

### Rating

Please rate this tutorial below. Thanks.

## Related Content

## Want to Contribute?

Want to be an author? Drop us a line here we’d love to have you.

Already have a video you’d like to post? Send us a link and we’ll get you going.

www.designalyze.com

## Subdividing surface

I would like to make division on face of a solid without splitting it. Is there a command for doing it ?

### Replies to This Discussion

Jak chcesz zrobić podział bez cięcia??

How do you want to do division without split ting ?

If you are looking to get a series of curves that represent subdividing the surface, for regular straight line intervals, you could try using the Contour command (you may need to extract a copy of the surface if it’s part of a solid object). For curves that follow the surface isoparametric lines, you could divide one or more of the edges with the command Divide and then use ExtractIsocurve to extract the isocurves at those locations.

Other possibilities: Grasshopper or Paneling tools plug-ins.

Maybe I did not explain correctly what would I like to obtain. I was practicing with UV Unwrap and I want to have additional lines to use as seams on solid. Otherwise, I can only use solid’s egde as a seam. In programs like Blender, that are mainly working on mesh, it is possible to select any mesh edge as seam for unwrapping. I am curious how UV Unwrapping works with NURBS.

v5.rhino3d.com

## Grasshopper 3D Grid from Surface

## Contents

## Introduction

This is a continuation of Grasshopper 2D Grid. This method is based on subdivison (defining U and V values) of a surface which is lofted between two curves. We can change the control points along the curve and manipulate the input surface this way.

## 3D Grid from Surface

First you set two curves drawn in Rhino and create a loft between them using the Surface » Freeform » Loft component. Then we repeat the same steps as we did in the **UV Surface Divide** example from Grasshopper 2D Grid. You subdivide the surface with the Surface » Util » Istotrim command. The Isotrim (SubSurface) requires you to divide a UV Domain Maths » Domain » Divide Domain based on the input Surface. Connect the divided domain and the input surface to the Isotrim (SubSurface) component. The result is a series of smaller surfaces, you’ve pannelized the surface. These are the cells of your grid.

## BoxMorph

Once the surface is pannellized into a uv-grid, you can use it for many different transformations. One of the transformations we will demonstrate here are the Surface Box and the BoxMorph tool. A SurfaceBox creates 3D cells (with a specified height) from the 2D cells of the divided Surface. The Boxmorph places an object within those 3D cells, automatically adjusting the dimensions of your geometry. It adjusts the BoundingBox of the geometry to match the 3d boxes on the surface, and scales the geometry accordingly.

First, you need to convert the 2D cells to 3D by using the Transform » Morph » SurfaceBox command. Connect the original surface and use the **D**omain from the Divide Domain component. Specificy the **H**eight by using a Number Slider. Now you have generated the **T**arget boxes for the geometry.

Then you can load the geometry you would like to morph over your surface. Params » Geometry » Geometry Use *set one geometry* and make a BoundingBox *per object* with the Surface » Primitive » BoundingBox tool. Then load your **G**eometry into the Transform » Morph » BoxMorph and plug the BoundingBox into the **R**eference Box input on the Boxmorph tool. Finally add the **T**arget boxes from the SurfaceBox command.

You can use also set multiple geometries, but then you have to set the BoundingBox to *union box* by right clicking on the component and checking *union box*. You also have to ensure that the geometry is grouped before you enter it into the **G**eometry input. To group geometries, use Transform » Util » Group

## Surface Analysis

The surface subdivision can also be useful in analyzing the surface. For example, by using Surface » Analysis » Evaluate Surface we can evaluate the surface based on a uv coordinate.

UV coordinates refer to the domain of the surface. For our purposes we will reparametrize the surface, meaning we redistribute the uv domain from 0-1. Right-click on the **S**urface input of the Evaluate Surface component. Select Reparametrize. Now we generate the uv input. This can be done in several ways.

Using the Params » Input » MD Slider is visually easy to understand as the square lay-out of the slider mimics the uv-point in relation to the surface. The output of the slider is a x,y,z coordinate where the z is always 0.

Another method is creating an x,y,z-point by using Vector » Point » Construct Point and Number Sliders (0-1) for the x and y input. Do not define the z coordinate, as it is not necessary.

The last alternative is to write your coordinates in a panel. Params » Input » Panel Write <0.5,0.5,0.0>to retrieve the centerpoint, for example.

To keep your definition compact you can decide to internalize the uv-coordinate. This means that the data is stored inside the component and is permanent until substituted with another input. Right-click the uv-input and select *internalize data*

## Color by Slope

The Evaluate Surface component returns a **P**oint, a **N**ormal and a **F**rame (plane derived from geometry). We can use this data to analyze the curvature of the surface. In order to visualize this data, we will color the subdivisions according to their slope. This could be useful when you are generating a walkable surface and the slope cannot by higher than 10% (wheelchair accessibility, for example. This can be done in many ways, but to understand the process exactly we calculate the vector of the normal compared to a vertical vector. If we multiply this by 100, we obtain the slope percentage.

To visualize the process we will first draw two SDL-lines Curve » Primitive » Line SDL . One SDL-line will **S**tart from the evaluated surface **P**oint following the **D**irection of the **N**ormal. The **L** doesn’t matter, a Number Slider can be used in this case. The other SDL-line follows the z-**D**irection, **S**tarting from the same **P**oint, using the same Number Slider for the **L**ength. Make sure the have the same orientation, if not (like in the example here) one of them needs to be inverted by using the Math » Operators » Negative .

Now we extract the Endpoints Curve » Analysis » End Points to easily generate a 2-Point Vector Vector » Vector » Vector 2Pt , ensuring the correct direction of both vectors instantly. Compute the angle between the two vectors. This equals the slope since calculating the difference between the horizontal vector and the tangent vector on the surface (90 degrees rotated normal) returns the same number. Use Vector » Vector » Angle and multiply Math » Operators » Multiplication this by a 100. You can either use a panel to specify the number, or you can *set a number*.

For a colored representation of the different slopes we can use a color gradient option. Params » Input » Gradient . There are different pre-sets if you right-click on the colored component. Moving the small dots adjusts the corresponding colors and percentages. Connect the slope percentages from the Multiplication component into the Parameter **t** of the Color Gradient. Plug the Divided **S**urface geometry into a Display » Preview » Custom Preview component. Then enter the output of the Color Gradient into the **C**olor input of the Custom Preview.

wiki.bk.tudelft.nl

## Rhino Grasshopper Tutorials

In this tutorial, I will explain how you can use Gradient to color a set of panels based on their height.

In the first step, we can make a rectangular surface in Rhino and deform it by “softeditsrf”.

Next, we import the surface into Grasshopper 3d (Params>geometry>surface). We can divide the surface into panels by using “isotrim” (Surface>util). Isotrim can be combined by “Divide Domain2″(Maths>Domain) to divide the surface into subsurfaces.

To colour the panels based on their height we need their “Z coordinate”. We can have their centroids (Surface> analysis) and then extract the z coordinate by “deconstruct point” (vector>point).

“Gradient” (Params>input) has three inputs. First is the “Lower limit” which is the starting colour of the gradient and obviously the “upper limit” is the last colour. “Parameter” is the colour we want. We need the minimum height for the lower limit and the maximum for the upper limit. We can use the “Bounds” (Maths>domain) to extract the domain of the z coordinates. By using the “deconstruct domain” (Maths>domain) we can have the start and end numbers of the domain.

By giving the “z coordinate” of the points to the gradient’s “parameter” we can have the right colour.

At the end, we can connect the Gradient to a “custom preview ” (display > preview) and give the panels (isotrim output) the “geometry”.

If we give the “y component” of the points we can see that the panels will be colourd based on their y coordinates.

parametrichouse.com

## Learning Grasshopper for Rhino

## computational design and generative art

## Dividing Geometry

Divide curves and surfaces into points for geometry distribution.

**Divide Length** … number of points with a given distance (**L**) in between.

**Divide Curve** … number of equal segments (**N**) between points along curve. If you want points at each of the corners in a closed curve, set kinks boolean to true.

**Divide Surface …** creates a grid of points along the local **(** **U** and **V)** coordinate system of the object.

**Orient** … to re-orient the geometry … reference plane (**A**) and target plane (**B**)

**Divide Surface** out puts points … distribute planes on each of the points by using **Plane Norma**l. Points (**P**) are the origin and the normal vectors (**N**) plug into the z-axis of (**Z**) of the **Plane Normal**

**Cones** take planes of input so you can plug **Plane Normal** directly into Cone base (**B**).

Geometry that doesn’t take planes for input … **can use point as reference plane** so you can define an explicit point to use as reference. Create Geometry container **Geometry** … create a point container **Point** which becomes reference plane (**A**) in **Orient**

rbrodiegh.wordpress.com

## grasshopper code

. a collection of codes & grammars for **Grasshopper**, a generative modeling tool for Rhinoceros.

**Hitomezashi Pattern**

The definition create a specific Hitomezashi pattern.

There are a Nurbs and a Mesh version of it.

**Mesh Color by Curvature**

The definition applies a vertex color based on the average or upper value of the angles between adjacent faces.

**3D Hilbert Curve**

This definition generates a 3D Hilbert Curve, a continuous fractal space-filling curve.

**nGon mesh tessellation**

Starting from a closed surface it builds a nGon mesh tessellation

**Curves Sorter**

Starting from a list of curves it takes the first one then it looks for the closest curve and it eventually flips the direction to optimize the toolpath lenght.

**froGH**

A sparse collection of tools for Grasshopper.

See the code, explanation and download here.

**Clusterizer**

This definition groups indexes of connected points into separate clusters. It requires Sandbox & Anemone plugins.

**Spirograph**

This definition simulates a spirograph tool.

**3D Differential mesh relaxation**

This definition explores the 3D relaxation of a mesh effected by an image gradient.

**2.5D Differential mesh relaxation**

This definition explores the 2.5D relaxation of a 3D mesh by a system of attractor points forces.

**Vorospace**

This definition creates a mesh model of all the connections between the centers of the 3D voronoi cells and the adjacent cells.

**2D Differential mesh relaxation**

This definition explores the 2D relaxation of a mesh by a system of acctractor points forces.

**3D Hexagonal Weaving**

This definition explores the weaving of an hexagonal grid providing 3 different interwoven frames.

**Vectors field over HexaMesh**

This definition explores the deformations over an Hexagonal grid by a vectors field of point charges and the colors of the resulting mesh are driven by the field values.

**Mesh faces by deviation angle**

This definition selects adjacent mesh faces depending on the angle of deviation. It requires Hoopsnake & Starling plugins

**Erwin Hauer’s Box Morph**

This definition explores the Box Morph technique to get the Erwin Hauer’s continual surfaces using meshes.

**Math surfaces**

This definition provides several math surfaces (nurbs and mesh) based on k3surf formulas.

**Trilateration**

Custom user object (written in C#) to find the mathematical intersection(s) of 3 spheres.

you can dowload the files (user object + sample gh definition) here:

**GH to SVG – UPDATED**

A serie of Clusters/Components in order to export and visualize directly a SVG file

**ASCII art generator**

This definition uses any image to create a AASCII art picture.

**Recursive subdivision**

Recursively subdivide a surface in order to minimize panel curvature (tested by keeping the distance between the centroid of the subsurface and its projection on the subsurface itself below a given threshold). Uses a C# custom component. It will all be a lot clearer if you give it a try.

**Tangent threshold**

This code samples one or more curves and, for each sample point, gives the points in both directions whose tangents form a given angle with the tangent of the given point. In narrow curvature zones the two given points will tend to be close to the original one, while in straighter zones they will spread farther. Uses a C# custom component.

**Koch Snowflake [Hoopsnake] **

This code creates a Koch Snowflake 2D fractal using the Hoopsnake component

**Sierpinski Triangle [Hoopsnake]**

This code creates a Sierpinski Triangle 2D fractal using the Hoopsnake component

**Gradient Descent Algorithm**

This code creates a Gradient Descent algorithm on a surface generated by an image sampler logic. There’re two type of the algorithm: normal and rotated. The package includes a GH definition, the Rhino 3d file and a map used for the image sampler component.

N.B.Original VBnet code by Woo Jae Sung.

**GH to Maya**

This tutorial package includes a GH definition with a method to preserve mesh vertices colors after welding and explains a pipeline to render vertex-color meshes in Mental Ray in Maya. Included are: GH definition (v 0.9.0014), Rhino 4.0 file, .fbx mesh sample, .mb file with finished result

**GH to Blender**

This tutorial package includes a GH definition with a method to preserve mesh vertices colors after welding and explains a pipeline to render vertex-color meshes in Blender with Cycles. Included are: GH definition (v 0.8.0060), Rhino 4.0 file, VRML mesh sample, Blender file with finished result

**Voxelizator**

A definition that draws custom size cubic voxels onto a surface or polysurface.

**Ribs Structure**

This definition creates from a given Nurbs surface a Ribs structure and all pieces unrolled.

**Strip fabrication**

Fabrication of single-curvature striped surfaces. A study based on the Strip Morphologies technique by ©StudioMODE

**Seamless Pattern**

. A simple GH definition that mimics the Escher patterns process.

**DiY Architectural Dialogue machine.**

. insprired by this post – http://allisonarchitecture.tumblr.com/post/5613643435

i did a GH def to sort random strings from several lists of data in order

to do an architectural dialogue machine.

**Blender2GH.**

a simple GH definition to import a Blender3D geometry using the export .PLY file format

**Hexachaos.**

Random hexagonal based pattern generator

**Uneven Subdivision.**

Uneven subdivision of a NURBS surface, controlled by random intervals.

**Complete Diagrid.**

Diagrid definition that covers the whole surface, up to the edges.

**Phyllotaxis growth.**

Phyllotaxis variation working on variables with a few changes of the values “i” in the math formula of spiral: x= cos(i), y=sin(i), z=i

**Phyllotaxis.**

Phyllotaxis 2D pattern.

**Curvature analysis pattern.**

This definition subdivides a surface into a quadrangular panels, plots a circle or a closed spline(similar to an ellipse) with center in the centroid of each panels, scale the radius dimension trough a numeric values extrapolated from the curvature analisys of the input surface.

**Attractors vector deformation.**

The complex structure of radiolaria was treated as a two-dimensional representation with a hexagonal pattern. Two points control the deformation of individual cells that make structure through a transformation of vectors connecting the vertices of the single cell with the point. The deformation of the grid can be caused by an attraction or a repulsion generated by attractor points.

**Image field04.**

Investigation on the potentiality of numerical field generated by a source image. The height of one ellipse control point is linked with grayscale value of the image generating parametric variations in the starting flatten pattern.

**Pie chart.**

A definition that draws a percentage pie chart from a list of values (random values are used here but you can plug any list of values including external data).

**Panels dispatch**

This definition allows you to tessellate a surface with two different panel types dispatched through random sorting.

**Quad 2 diagrid **

This definition allows you to tessellate a surface and smoothly transform the tessellation from a quadrangular to a diagrid pattern.

**Hexagonal field**

A magnetic field applyed to an hexagonal grid ruled by 4 points that can be switched (attractors or repulsors).

**Tatami-Cairo-Diagrid tessellation**

This definition allows you to tessellate a surface going smoothly from tatami tessellation to diagrid through Cairo tessellation.

**Curve driver **

This definition allows you to control geometry properties (curvature radius) through a control curve.

www.co-de-it.com