Archive for ‘java’

luglio 23, 2012

spectrum { embodiments } – processing workshop in Rovinj (Croatia)

spectrum { embodiments }
Hotel LONE | Rovinj | Croatia | 27th – 31st August 2012

The more we explore the architecture of matter, the more what we get looks more and more like information; yet, infor-
mation needs a body in order to express itself as such. Architecture starts when the embodiment process takes place,
from the set of relations that define a system, by defining relations among independent objects (which, in turn, are
information systems on a finer scale). By coding the behavioral rules of interacting autonomous agents and topological
manifolds, emergent hierarchies and differentiated yet coherently related spatial and geometric conditions flourish form-
ing a spectrum (a condition that is not limited to a specific set of values but can vary infinitely within a continuum), with
a cascade of local symmetries, gradients and singularities emerging from pure information systems.
The workshop will speculate through codes written in Processing on autonomy of form and the relation among behavioral
rules and morphogenesis. Rather than trying to reductively solve dualities like autonomy/dependency, whole/parts, het-
erogeneity/homogeneity the workshop aims to exploit them as a fuel for dynamic, competitive or collaborative creation of
higher complexity and the source of a spectrum of possibilities in finding novel forms.seeable forms with no precedents.
We will write our own unconventional programming strategies in the scripting- framework Processing.

SUPERVISION
Alessio Erioli, Tommaso Casucci, Alessandro Zomparelli
Affiliations
Co-de-iT – Computational design Italy – www.co-de-it.com
a collaboration between Co-de-iT and MLAUS / proto/e/co/logics

INFORMATION & REGISTRATION info@mlaus.net

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:

n_vertices
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:

n_faces
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 realtime_mesh_exporter.py 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

[UPDATE]

Here is an updated versione of the script to blender 2.69:

simple_realtime_mesh_exporter_v269.py

maggio 15, 2011

Benchmark in processing.org

Trying to better understand the functioning of the Java language (in particular of processing) I decided to build a small class of benchmark with which to keep monitored the duration of some operations computationally expensive. The usage of the class is very simple: copy the file. pde in the folder of your sketch and open the main file (for example mySketch.pde in a folder with the same name “mySketch”). The usage that I suggested (but you are free to adapt it to your taste and your needs) is to declare an instance of the class benchmark at the beginning of the code, then the instance will be initialized at the beginning of phase to be monitored specifying the subject of control (a simple string that will be reported in the console) and successively is close. Will then appear on the console the duration of the operation (or loop of operations), in milliseconds. You don’t need to create a new instance of the benchmark class for each control, just overwrite the same every time.

usage example:

benchmark myBenchmark;

... code ...

myBenchmark = new benchmark("myOperation time");
...operations...
myBenchmark.end(); //return in console "myOperation time: ###ms"

...code...

myBenchmark = new benchmark("myAnotherOperation time");
...another operation...
myBenchmark.end(); //return in console "myAnotherOperation time: ###ms"

This is really simple, but I hope useful.

download benchmark.pde


[edit]
I improved my benchmark using class method static instead of default instance. In this way it is not possible to output nested benchmark controls (you can have a nested control copying the class with a different name for every hierarchy level) on the other hand it is possible to access to benchmark methods without having to instantiate the generic class benchmark.
I also insert a memory control that display total memory used by virtual machine and a delta memory that, after the calling of garbage collector, evaluate the memory used by myOperation.

usage example:

...
benchmark.begin("myOperation");
... operations ...
benchmark.end();
...

benchmark_example

example of benchmark output

download benchmark_static.pde