Archive for ‘Uncategorized’

ottobre 8, 2013

adaptABILITY _ blender + grasshopper workshop

ParametricBratislava is proud to present our latest collaboration with
This time after listening to the request of many of our followers we finally decided to break the lines and design for you a 5 days workshop concentrated on the parametric learning and implementation of blender in architectural modeling. How can we create and interpolation between blender and Grasshopper for rhino? Keep reading and maybe join us to find out!


Blender + Grasshopper workshop

Bratislava, Slovakia
30 Oct – 3 Nov 2013

[.] Brief

“Intelligence is the ability to adapt to change.”― Stephen Hawking
The human ability to adapt to changing environments depends on human behavior as well as on the tools we create and use; we are, in fact, symbiotic with the tools we create and in turn they change our mindset and behavior, fostering the creation of new ones to solve upcoming challenges as well as to satisfy our need to explore the new. Embracing the technological evolution to the fullest as designers means embedding toolmaking as a necessary part of the design process, thus making us more adaptable in front of new design challenges, and in the present day the word “tools” in design and architecture implies directly software.
No single software fits all the situations and needs of our daily job or research; we must learn to play with many different tools with their own peculiar features, extending and combining them seamlessly in order to expand our toolset and enhance our tools sensibility.
The workshop will explore how to use and combine two powerful design tools and exploit their synergies. Blender is one of the most powerful and famous free, open source 3d modeler (and much more – just check the 2013 reel …don’t forget it’s a free software!) and Grasshopper is the well renowned graphic programming editor and generative modeling tool. The synergistic potential of these tools could lead to new opportunities for custom design strategies and provide new advanced features in our skills set.

[.]Software & skills:

Basic modeling skills in Rhino and Grasshopper [Primer level] are required.
No specific Blender skills are required (although an introductory knowledge of 3D modeling is welcome).
Participants should bring their own laptop with pre-installed software. The software package needed has no additional cost for the participant (Rhino can be downloaded as evaluation version, Grasshopper and Blender are free), but since they are subject to frequent updates a download link to the version used in the workshop will be sent to the participants a few days before the workshop.


Andrea Graziano + Alessandro Zomparelli – Co-de-iT.


Academy of Fine Arts and Design – Bratislava, Slovakia
Hviezdoslavovo námestie
811 02 Bratislava

[.] Academic credits:

The participants will be provided with a certificate stating that they took part in an official workshop of the Academy of the Fine Arts and Design, Bratislava, which is worth 3 ECTS credits. The credits themselves will be awarded by the participants domestic institution based on this certificate. We advise the participants to discuss the procedure with the domestic institution n advance. Even though this is a standard and only possibility, there might be additional requirements from the various universities.

[.] Organized by:

This workshop is organized by Co-de-iT in collaboration with:
3D Dreaming – Architecture from a digital point of view
rese arch
. Academy of Fine Arts and Design in Bratislava

[.] Contact:
luglio 23, 2012

Blender: Random Material Assigner (to BMesh N-gons)

This is a simple script for assignement of random materials to different faces (n-gons) of a single object. It works differently to the existing Random Material Assigner and the mine is a version very rough. I wrote this script because for the particular job that I had to do it was more comfortable handling a single object to be fixed as a random mosaic, rather than a very large number of different objects. Here is the code:

import bpy
import bmesh
import random

obj = bpy.context.active_object
mesh =

bm =

for f in bm.faces:
    f.material_index = int(random.random()*len(obj.material_slots))



novembre 15, 2011

Blender Real-time Exporter (simple version)

Sometimes, working with tools like Processing or Grasshopper I’ve felt the lack of maneuverability of blender meshes modeling. I therefore decided to develop a small script for export my mesh refreshing it in real-time. This will make it possible to read information from different software programs interactively with the ability to store files prefix.vertices and prefix.faces, containing respectively the vertices and faces of the mesh.
Is also possible to simultaneously export multiple objects with the ability to apply the modifiers before exporting. The export deals only with the mesh, so there are not applied the transformations like translation / rotation / scale of the object.

Following is a brief description of the syntax adopted for export .vertices file:

vertex_01_x vertex_01_y vertex_01_z
vertex_02_x vertex_02_y vertex_02_z
vertex_03_x vertex_03_y vertex_03_z
vertex_04_x vertex_04_y vertex_04_z
vertex_05_x vertex_05_y vertex_05_z

and .faces file:

face_01_vertex_01_ID face_01_vertex_02_ID face_01_vertex_03_ID face_01_vertex_04_ID
face_02_vertex_01_ID face_02_vertex_02_ID face_02_vertex_03_ID face_02_vertex_04_ID
face_03_vertex_01_ID face_03_vertex_02_ID face_03_vertex_03_ID face_03_vertex_04_ID
face_04_vertex_01_ID face_04_vertex_02_ID face_04_vertex_03_ID face_04_vertex_04_ID

In the future, the intention would be to expand export opportunities allowing you to export files with different formats and reporting information about the vertex-colors.

Installation of Blender Real-time Exporter:
Download and open it with blender text editor, press Alt-P for run the script and in Object Data menu it will appear the new panel: Real-time Mesh Exporter.

You can also try the exporter with my simple Processing sketch BlenderToProcessing.pde. I don’t use libraries like toxiclibs or hemesh, but only Processing function beginShape(). So with particular quad faces it gives some errors of visualization.

Happy Blending


Here is an updated versione of the script to blender 2.79: [updated 31/01/2018]]

settembre 5, 2011

Rearrange the mesh after WeaverBird’s subdivisions (part 2)

In this second part I explain a possible solution to the problem of rearranging the order of faces and vertices. The default order from subdivision components of WeaverBird is presented in a non-intuitive form. The default order of the mesh after three levels of subdivision of one quad-face looks like this:


default distribution of faces after three levels of subdivision

This distribution comes from the progressive rotation and repetition of the basic counterclockwise order:

|          |
|  3    2  |
|          |
|  0    1  |
|          |

So what I’m looking for is a rearrangement of the order of faces and vertices that is similar to a grid arranged in rows and columns. To obtain this I have decomposed the problem into two steps.
In the first step I hypothesized a more simple distribution:


more simple distribution

Now we consider the coordinates of every face in function of their parents faces. For exemple:

0 ==> {0;0;0}
1 ==> {0;0;1}
2 ==> {0;0;2}
3 ==> {0;0;3}
4 ==> {0;1;0}
5 ==> {0;1;1}
26 => {1;2;2}
64 => {3;3;3}


Looking for a rule rows for columns we can describe the progression of individual rows via binary numbers. For exemple the first row looks like:

{0;0;0}, {0;0;1}, {0;1;0}, {0;1;1}, {1;0;0}, {1;0;1}, {1;1;0}, {1;1;1}


This sequence represents the paths of the faces belonging to the first row from the bottom. If we consider the same sequence for every row and a similar one for columns then we will be able to describe every number in function of its row and columns index. For exemple we can write 26 like:

26 => (4, 3) => ({1;0;0}, {0;1;1})

and we can easily get the global path:

26 => {1;0;0} + 2*{0;1;1} = {1;2;2}

now we are ready for second step.

In second step we will switch from linear to counterclockwise distribution. To do that simply flip the 2 with 3, getting a new distribution:


counterclockwise distribution

Then we see the correspondence between the new order and flipped paths. Looking at our friend 26:

26 => {1;2;2} ==flip==> {1;3;3}


Now there is a last step. We have to consider the progressive rotations of subdivided faces. Every new subdivision level new faces rotate around the center of the parent face of one position counterclockwise (+) for every level and a number of positions corresponding to superior path index clockwise (-). For exemple:

n: {A0; B0; C0}
A1 = (A0 + 0)%4
B1 = (B0 + 1 - A1)%4
C1 = (C0 + 2 - B1)%4

26 => {1;3;3} ==rotating==> {1;3;2}


At this point we can take the numbers from paths {A;B;C} and give them a new index:

ID = A*4^2 + B*4^1 + C*4^0


At the end of the process the output looks like that:


rearranging of four faces after three subdivision levels


If you want you can try my C# script. To work, it must be placed in succession to my previous script for rearranging single face’s vertices order. Look at my Ghrasshopper definition for better understand how it works:

download Rearrange

settembre 4, 2011

Rearrange the mesh after WeaverBird’s subdivisions (part 1)

This script was developed to be used in succession to the components of simple subdivision and Catmull-Clark subdivision introduced in Grasshopper thanks to the plugin WeaverBird developed by Giulio Piacentino.

One of the difficulties of working with subdivided meshes is the not easy acces to different faces. The difficulty stems from two fundamental aspects: the order of the vertices of the individual faces is not always the same, but it was caracterized by a different shift in each subdivision for each face. The second aspect concerns the order of indexing of individual faces and vertices. In fact, these orders do not coincide with the rows and columns of the corresponding grid.

To solve the first problem you need to go and investigate the slip rule, which follows a rule for incremental four faces derived from the mesh of departure according to their order and the number of subdivisions.

Look at the image to better understand the difference in output, if we decide for example of triangular faces using vertices [0, 1, 2] of each quad-face:

tidyng vertices of single faces

tessellation by triangles (0, 1, 2): before and after rearranging of relative order of the vertices

It is possible to download the Grasshopper definition for vertices shifting. It includes my script in C # together with an explanation and a different version of the process with standard GH components both edited by Mirco Bianchini

download Shift Vertex

Because the orientation of vertices depends on the order of faces of starting low-poly mesh, I insert in my c# component vertex the possibility to correct manually through a list of integers containing the individual shifting values for faces of starting mesh. By default I give a shifting value of 1 for the first face. Disconnecting the panel it turns off automatically.