Import Simple Environment from Grasshopper

From TOI-Pedia

Introduction (Under Construction)

Simple-3D-environment.jpg
In this tutorial you will learn a basic method of how to import a simple environment from Rhino into your Processing sketch. In this tutorial Grasshopper will be used for exporting data to Processing, therefore a basic understanding of Grasshopper is needed to succesfully finish this tutorial.

Setting-up Grasshopper

The first step in importing our environment into Processing is to translate our environment into point coordinates which we then save in txt files with the use of Grasshopper. Since this step is already described in detail in the previous tutorial "Processing Grasshopper communication" we will discuss this part briefly in this tutorial.


How to set-up your Grasshopper?

Geometry.jpg
Open your Rhino file which contains your environment and load the Grasshopper plugin. In Grasshopper add the geometry component: Geometry » Params. By clicking with the right mouse on the component set multiple geometries and add all your geometries.











Brep component.jpg
Now we have linked our environment to Grasshopper,we want to retrieve coordinates from these geometries. The first step therefore is to explode the geometry with the Surfaces » Analysis » Brep Componentscomponent. This component gives us all the vertices of the geometry.






Average.jpg
In order for the placement of the geometry in Processing we need however also the midpoints of all the boxes. These midpoint do we get by averaging the vertices with the Math » Util » Averagecomponent.


The next step is that we need the x,y and z dimension of the boxes we want to import in Processing. We need these dimensions, since Processing defines a box by its width, height and depth. The most easiest way to get the box dimensions in Grasshopper is by taking two vertices and substract the x-coordinates and substract the y-coordinates of the two vertices. The z-dimension can be used directly. In order to substract the x and y coordinates, we need to select two vertices from the list of vertices we got from the brep component using the Geometry » Params. Then we need to decompose these points into its x and y components, using .
Personal tools
Actions
Navigation
Tools