Generative Design Variations M.4.1.1 Nodes

I have entered the M.4.0 Attractors chapter. The starting points for all graphics in this chapter are points that can move and attractors that attract or repel these nodes. M.4.1 Starts with ‘Nodes’. Here is the summary from the Generative Design book: ‘When creating a virtual world in which attractive forces are simulated, at least two kinds of objects are needed: attractors (points that attract) and nodes (objects that are attracted). In principle, both attractors and nodes are simple points in space. The most important information is their position: x, y, and (in the event that they move in three-dimensional space) z-coordinates. They also have other properties and functions, which will be examined in more detail in the following pages. The first examples are based on a two-dimensional space, but it will be easy to shift into the third dimension later. An object that can move is now needed as the node. In addition to its position in the world  (x, y), it is also assigned a velocity vector that specifies by how many pixels the position is offset in each frame. In the following example, a simple node class is created and a few instances from it are placed on the stage.’ Here is the original program:

The programs are not supported by JavaScript. So I have prepared a Flickr Album which contains all still images I have made during this assignment. You can find that album clicking this link:

I will shortly describe what I did and the link will redirect you to the Flickr page. I’ve started with increasing the node count from 20 to 2000. Changed the display size to 800 x 800. Made the background black. Reduced the size of the nodes to 1 x 1 pixels. At this moment I like to see very much nodes and very small. Also slowed down the damping to 0.005. And I changed the random velocity (or speed) to -1, 1.

Decreased the amount of node count to 1000. Increased the size of the nodes to ellipses of 10 pixels. Also removed the fill of the ellipses.

I would like to replace the ellipses by another shape. I created a function for that called newShape. To begin with I used three rectangles which are diagonally connected. Why rectangles? I have no idea. Sometimes you have to follow your intuition. The color scale ranges from white to blue. When running the program it has sometimes a 3d-ish quality. Which I noticed later.

Let‘s see what happens if I make these rectangles smaller. That gave me an interesting effect. What if I double the amount of rectangles in the newShape function. Huh? I got an Exception in thread “Animation Thread” java.lang.RuntimeException: Nothing left on the event queue. at processing.core.PApplet$InternalEventQueue.remove( at processing.core.PApplet.dequeueEvents( at processing.core.PApplet.handleDraw( at processing.core.PGraphicsJava2D.requestDraw( at at in my console. But the program keeps running. And that is the most important thing for me. I also reduced the vertical movement. That makes the objects even more flag-like.

I could use a for loop for this newShape. Which gives me the possibility to make a longer flag-like shapes without using much repeating code. The red dot on top of the flags is outside the loop.

Increased the node count to 1000. And I used an S-shaped form for newShape. I also reduced the randomness for velocity.y (the vertical speed) to almost nothing (-0.001, 0.001). That is giving me horizontal movement only. Swapping those numbers with velocity.x gives me a vertical movement.

Used an m-based shape with the same vertical movement.

Replaced the m-shape with a double sized m-shape with more color. Not sure if that is a good combination of colors.

The newShape is now overlapping itself. Improved the shape by separating the original form from each other. Added a more colourful version too. And I added a Wimbledon color version. Which was not a great success (I think). So I reduced the amount of color variations. And ended with red-white-red-white colors. Also reduced the strokeweight to 1 pixel which makes the images smoother.

Used a horizontal wave existing out of bezier curves. I started with a white version but changed that into a version which uses only red and white.

Generative Design Variations M.3.5.1 Defining custom shapes

As always I quote the Generative Design book: ‘Various forms are already implemented in the mesh class. For instance, a sphere can be generated using setForm (Mesh.SPHERE). The mesh class can be easily expanded to define new forms. In the following script, a class MyOwnMesh is generated that extends the existing class. All methods are then derived from the mesh class. Only the method calculatePoints () has to be replaced, in which x, y, and z are calculated from the values u and v, allowing either the creation of completely new formulas or the modification of pre-existing ones to generate new forms.’ Here you can find the original program.

And because ths program does not work in JavaScript I have not put any code on my loftmatic page. All the links on this blog are linking to a specific page in the Flickr album which contains all the images I have made during this assignment. You can find that clicking this link:

For all programs I imported my light settings from the earlier examples. And I did some small changes in the program itself. I would like to zoom in and out. So I introduced a ZoomFactor variable. And because I would like to see the object from all sides I used rotateX and rotateY for that by attaching mouseX and mouseY. MouseX is also used for controlling the morphing but I don’t mind that. Might be a bit clunky but because I am the only user I can live with that. Also increase UCount and VCount to 400. Which gives me smoother images. Just as in the earlier assignments I go through all the twenty-two meshes. I started with the plane mesh. And that gives me ‘The function Plane (float, float) does not exist. So I skip the plane mesh. I will try to morph just to the next mesh. In this case that is the sphere. Which gave not so interesting images so I replaced the sphere by the torus. Which was also not very interesting so I replaced the torus by a paraboloid. And again it wasn’t interesting enough so I replaced it again by the steinbachscrew. And that worked well. I think it has something to do with the shapes. If the shapes are too simple they do not create an interesting morph between them. But one simple shape and a complex one morphs fine.

The combination tube and sine did not work so well. So I changed the sine with the figure8torus. That works a bit better. Sometimes you will recognize the original mesh. But during this session I found most interesting shapes are generated somewhere at the point when none of both shapes are recognizable.

Changed the sine for a sphere mesh. But that gave me a lot of cumbersome sometimes even not so elegant objects. But here is a good example of geometry which is boring for the most part but when added a little more geometry on a certain position it’s getting interesting again.

Morphed the torus with the figure8torus. Which seems to work pretty well together. This is a good example of an object which has just some minor variation. But even than… in it’s simplicity it does a very good job.

Made a few variations using the paraboloid morphing into the figure8torus. These objects are completely unpredictable. You never know what kind of object there is going to be generated.

The steinbachscrew is morphed into the figure8torus. Zooming in on objects is also a very handy way to generate images. Sometimes showing the total object is not so interesting. But when you zoom in you might find more interesting things.

The sine mesh is morphed into the figure8torus. But I found the forms it delivered not too interesting. So I thought this would be a fine moment to switch the figure8torus into the elliptictorus. And that generates images that are way too perfect. You can see this specially when you enlarge the object. But sometimes perfection is also a quality.

figure8torus morphed into the elliptictorus. I think I’ve seen a few of these images before. But I might be wrong. However this is not bad geometry at all.

Figure8torus morphing into the corkscrew. Some very interesting forms when working in the middle of the display screen. A few of these are looking very much the same. But if you give it a closer inspection you can see that they are actually very different from each other.

The figure8torus morphing with the bohemiandome. These are good examples of objects which are looking very balanced. Ok… I have to admit they are a bit boring.

The figure8torus morphing with the bow. A bit more of the same. But they are not bad.

Figure8torus morphing with the maedersowl. I think that the unpredictiveness of each geometry is a very interesting part of this assignment. You never know what comes next. And that keeps it interesting to continue. Which I did.

Elliptictorus morphing astroidalellipsoid mesh. On the outside it was not looking very promising. So I went into the object. That’s also a fine option. You can get close but you can also get into the object itself. So inside it was the opposite. At a certain moment it is getting a bit too minimalistic.

Morphed the corkscrew with the astroidalellipsoid. Stayed very close to the object. Also very minimalistic.

Some variations with the corkscrew mesh morphing into the triaxialtritorus. On a certain moment it is getting very complicated. I would like to see these objects in a 3D program. But unfortunately you cannot export the object to the dxf-format.

Morphing the bohemiandome into the limpettorus did not make much sense. So I replaced the limpettorus with the shell mesh. And that made the images better.

The bow mesh is morphing into the shell mesh. Still very simple but interesting.

The bow mesh morphing into the kidney mesh. I think we are slowly getting somewhere.

The meadersowl morphing into the lemniscape. The full screen images are the best. Large amounts of surfaces and smaller points with complex geometry.

The maedersowl morphing into te trianguloid. This is a very lucky combination. Te shapes seem to be endless. But sometimes it’s almost getting over the top.

The maedersowl morphing in the superformula. A very fine combination. I could have continued with this for a while but I think this is enough for this assignment. It gave me 211 fine images. And it’s very odd that the last image seems to be one of the best if you ask me.

Generative Design Variations M.3.4.3 Deconstruct the forms with controls and buttons

In this part of the chapter we are using a tool to deconstruct all geometry. The Generative Design book describes this as follows: ‘A tool is also available for this kind of deconstruction with which the form can be changed using a few controls and buttons. What is new here is the parameter ‘randomScaleRange’ that defines how much the individual grid sections are scaled. Using the sliding control for ‘randomURange’ and randomUCenterRange’ (or ‘randomVRange’ and ‘randomVCenterRange’), the random values are set that specify how wide the grid sections can be and where these are placed.’ Until so far the Generative Design book. You can find the original code from the Generative Design book here.

After a week in Stockholm, Sweden and a week of photo-editing (photo’s here) we decided to combine the Generative Design Variations in a book. We are going to make a publication of this project which I started since November 11th, 2013. At this moment we are thinking about the concept and we will start with it when I have finished making variations on all examples of the Generative Design book. I think we will arrive at that point at the end of 2015. Back to today. I have prepared a Flickr Album which contains all the images I have created during this assignment. You can find that clicking the following link:

Because this is a tool and I did not change very much in the program itself I did not find the urge to put the code on the loftmatic website. You can download the program from the Generative Design website (as shown in the earlier paragraph). Clicking on the links below the descriptions on this page brings you to the specific Flickr pages. As a start I imported my light settings from the earlier examples. And I did some small changes in the program itself. Just as in the earlier assignments I go through all twenty-two forms. Starting with the plane mesh. This time it gives me the impression that the triangles are fully dissolved into a painting like pattern.

I changed the plane for a tube mesh. Completely forgot about the fact that I have a mesh count. Reduced the amount to 26 meshes. I also added a smooth (8). And I think that the mesh scale is not high enough. So I increased it from 300 to 400 in controlP5. In a way this work has a lot resemblance with photography. You have a subject (the form). And you have light. The only thing you have to do is search for a good viewpoint that makes an interesting image and a good composition. And that doesn’t work out always as you would like to expect. But sometimes it does. As it sometimes does work in photography and sometimes it doesn’t.

While working on the sphere mesh I found out how to make use of the mesh distortion. It is a strange option. You create an object in 3D space and then you can distort the geometry. In fact that is not what you always want. Especially if you go too far (what I did in this case) it doesn’t matter what kind of object you distort because you always end up with a cloud of triangles, rectangles, lines or dots. So I wonder how many times I will use this because the end result is always the same.

The torus mesh gave me a lot of interesting images. It is also very nice how you can work from the center of the image to create all kinds of different models. Again I did not use the mesh distortion. It leads too much to disorder or chaos. And the model is lost. And that is what I don’t want. But sometimes it could be handy.

The paraboloid mesh took me some time but finally I succeeded to find some interesting variations.

The steinbachscrew form is still an intriguing object. To create the first image I did nothing. Only turning the most interesting side to the camera view.

The sine mesh gave a lot of strips with interesting chaotic (but not too chaotic) lines. Could have going on for hours. If I would. But I did not.

Using the tool with the figure8torus I increased the u-count and v-count because I thought it was giving me not enough smoothness in the surfaces. So I increased it to 80. But that was too much. My system responded very slow. So I did a reset (back to 40). And increased the total meshCount to 800 in controlP5.

The elliptictorus mesh gave me some interesting images but they were difficult to find. Also the resolution was not high enough. Thats why I got these arcs which are not so smooth as I would like to see them.

The corkscrew mesh showed me a totally different images than I expected. In the beginning I thought it was a very simple mesh. Which might be a good thing but another thing is that you can make very strange patterns with it. You cannot recognize the corkscrew mesh anymore. But that leads to the question: do you want the form to be recognised or is an interesting image enough?

For the bohemiandome I used mesh distortion for the first time. It makes fluffy objects. Not sure if I am happy with that. But I never used it before. So… why not.

It seems that this assignment is a lot about deconstructing objects. When using the bow I thought it would be interesting to create space with as few as possible objects. What illusion of depth can you create with the use of just a few simple lines.

I did almost nothing with the maedersowl mesh. I just turned it with the standard settings and I have chosen some images which just looked good. That seems to be an option too.

The astroidalellipsoid is still an interesting object. It was an interesting object in the earlier examples I worked with. But as with all the others I like its appearance in a broken way instead of a totally filled surface.

Some variations with the triaxialtritorus mesh. I tried to keep the mesh visible but not too visible. Very vague… I know… but that is what I tried.

The limpettorus mesh (UFO) has lost its original geometry. In fact its geometry is still there but it is just partly filled in. Well that goes for a lot of those fine meshes.

The horn mesh is degraded to a whirlwind or hurricane-ish object. Instead of a fine smooth surfaces I ended up with curvy lines only.

The shell mesh delivered me some images which also could have been made with the horn mesh. Maybe it’s because of its curves.

The kidney mesh showed me that when using the paramextra (or the params as it is mentioned in the mesh class) it is possible to change the overall geometry. Paramextra (as the word indicates) is an array of parameters that change the appearance of some shapes. I did not know that. In fact you could make a kind of limpettorus from the kidney mesh. Well, sort of. But I do not know if that would make any sense.

The lemniscape mesh is absolutely an interesting mesh. But the general thing is that at the moment I don’t like any mesh which is totally filled with a surface. They are much more interesting when you fill them with lines or strokes. (at least when using this tool).

The trianguloid mesh is also very fluid mesh. Which gave me the idea to decrease the fluid lines until it were just straight. So every opportunity leads to the opposite (sometimes).

I find the superformula mesh still the least inspiring mesh. Hopefully I can come up with some surprising variants in the next assignment.

Generative Design Variations M.3.4.2 Multiple grid sections

I start with quoting the Generative Design book: ‘A second way to dissolve the grid is to generate a number of grids but only display them in sections on the mesh’s surface. In the following example, six instances of the mesh class are generated using the sphere formula. A mesh would generate an entire sphere if the value range for u and v extended from -Pi to Pi. If smaller random value ranges are now selected for each mesh, a kind of patchwork is generated as the overall shape. it is relatively easy to implement this in the program. Here, again, it is convenient that the entire functionality for the calculation and drawing of the mesh is encapsulated in the mesh class. The shape of the mesh class is no longer drawn in one piece but results from a large number of grid sections that can also overlap with each other.’ Until so far the generative Design book introduction. Here is the code I worked with:

I did not find it useful to put my code online because I did not change much about the original code. But I did prepare a Flickr Album which contains all the images I have made during this assignment. You can find that album clicking this link:

From here on I will link this text to the specific object image on Flickr. Again I imported my light settings from the earlier examples. And I did some small changes in the program itself. Such as a zoom function and I reserved the s-key for making screendumps. I will just go through all twenty-two meshes to let you know what I did. I started with the plane mesh. Which gives you (obviously) a plane. Except I changed the amount of planes to 2000. But during that session it seemed to be no problem to raise that amount to 20.000 planes. Oh… and I used the meshDitortion property to get some distance between them. Otherwise you get a flat plane which doesn’t look very interesting.

I changed the plane for a tube mesh. Completely unexpectedly it changed the planes also in the z-axis. What I mean is that they are not all on the same angle. All planes are now on different angles. But I lost the tube mesh. I lowered the mesh distortion and mesh count to 10.0. Coming back on my earlier examples in ‘Deconstructing the mesh’ I did not use the mesh distortion function much. I think there will be more distortion in these upcoming examples. Setting mesh distortion to a level of 0.01 gives an interesting patterns.

While working on the sphere mesh I wondered why we have no shadows in Processing 3D. Processing is using OpenGL. But it seems it does not support ray tracing. But for ray tracing, you need to trace the secondary rays and test for intersection with the geometry. That might be a bit too much to ask. But when I could export the geometry as a dxf-file than I could import the model into a 3D program which does support ray tracing. Alas the export dxf function gives me an error. I mentioned it to the guys of Generative Design. Hopefully they can solve the problem. Anyway for the time being I continue without shadows.

The torus mesh is a very compact mesh. But still it had some qualities which I did not see before.

The paraboloid mesh looks interesting from the top and from the bottom. It think that is true for a lot of meshes. It might have something to do with the balance between chaos and order. When you look at a mesh from the top and from the bottom these two (chaos and order) are much more balanced than when you look at the mesh from the sides.

The steinbachscrew stays an intriguing object (like it was in the earlier examples). Strange enough the mesh distortion does not work very well with it (if you ask me).

The sine mesh gave me a bit fewer possibilities in the beginning. But when I lowered the uMax, uMin, vMax, vMin variables there was suddenly a lot going on.

In the end I only used three figure8torus meshes. But even than it is a very fine mesh.

The elliptictorus mesh gave me also some interesting images. But I do not know why the resolution (which was on 200 for uCount and vCount) did not work out so well. I sometimes still see patterns in the objects.

The corkscrew mesh is still a bit difficult to handle. It’s a very long object so it is difficult to make interesting compositions without zooming in very deep.

The bohemiandome mesh gave me very different images than I got in the earlier examples. Even with seven meshes it still gives interesting compositions and angles of the object.

I was not finished with the bow mesh in the earlier assessment. And I am still not really finished with the bow mesh now. Let’s see what it delivers in the next assignment.

The maedersowl mesh is very interesting in a way that it receives very high contrast in light. It has very bright areas while at the same time it has very dark areas.

The astroidalellipsoid is even more interesting than it was in the earlier assignment. It combines large planes where almost nothing happens with complex geometry in one place.

Made some variations with the triaxialtritorus. These are not the best images but they are at least something I could not think off before I began working with the triaxialtritorus mesh.

In the previous examples the limpettorus mesh stayed in a way a UFO. That changed in these series when you can break up the mesh with multiple grid sections.

There is not much left of the original horn mesh. Although I think that long meshes are difficult to use in a good composition. To avoid a bad composition I mostly zoom in. The downside is that you have to increase uCount and vCount. Which makes your system very slow.

I did not do much do with the shell mesh. Increased the mesh count to 128 and then I zoomed in. From the other hand I could not do much because my system reacted terribly slow. It had a refresh rate of about 15 seconds after every mouse event.

The kidney mesh is hardly recognisable now. It’s just a collection of broken down sphere geometry.

The lemniscape mesh is fully unrecognisable as the original mesh. Maybe it’s because the original was also very mysterious.

The trianguloid mesh is also very interesting. All those different angles make it very unpredictable. You never know what kind of composition you get when you zoom in or click and drag to rotate it.

I found the superformula mesh still the least interesting. Maybe it’s because it’s not a sphere. It is sphere-ish. The shape is not fully clear to me. I also do not know why it is called a superformula. But maybe that will become clear in the next assignment.

Generative Design Variations M.3.4.01 Deconstructing the mesh | A single grid

I quote a piece of the introduction text from the Generative Design book: ‘Admittedly, the forms generated up to now (at least the simple ones) can be produced more quickly in any 3D program. The effort involved in calculating and drawing your own mesh pays off when you want to go beyond the usual representation methods. Until now we have generated contiguous connected grids. The variety of shapes can be expanded when the random function comes into play to dissolve the mesh. It is already laid out in the mesh class: a value can be set using setMeshDistortion (), ensuring that the mesh points will not be drawn on their calculated positions, but rather at a random distance from them.’ Until here the introduction. You can find the original tool here.

This program is presented as a tool. So I did not modify a lot at the program itself. Did not change the global variable names but I found it necessary to modify the lights. So I imported them from my earlier examples. I think it would be a good thing to get through all the meshes again. Since we have additional possibilities to navigate and to modify  I think this could lead to very different images than the program generated in the earlier sessions. And because I did not change much in the program I did not feel the need to put code on the loftmatic website this time. I did prepare a Flickr Album which contains all the images I have made during this assignment. You can find that clicking this link:

I just go through all meshes I have used. And I see that the plane mesh is skipped in the program so I start with the tube mesh. Increased the mesh scale to 500. And I added the smooth (8) function. Don’t know if that helps when using the OpenGL render engine.

Next is the sphere mesh. Spend a lot of time with modifying the sphere to a 2-dimensional object. How strange can it be. You have the opportunity to work in three dimensions and you spend most of your time working in two dimensions.

The torus mesh. Spend most of the time in the torus itself fiddling with the parameters.I did not feel the need to use the meshdistortion. Don’t know why. Looking back to all examples I have made I did not use it very much.

The paraboloid mesh was a real challenge. But I think the results are good. I begin to miss the fact that you only can rotate in the x- and y angle. But allas we don’t have a mouseZ function.

The steinbachscrew is an intriguing object. It gives you so much unexpected images. And when the object is interesting. And the lighting is good. The compositions grow from themself.

The sine mesh give me a bit fewer possibilities. Or maybe I did not take enough time to better check it out. But anyway if you run through it with the paramextra slider the objects you can create are almost endless.

I think I only scratched the surface of the figure8torus mesh. I would have had hundreds of images if I had continued. Now I have only 217. By the way. The need to deconstruct these objects is decaying the longer I work with them. Maybe its because it behaves too much as a filter.

The elliptictorus mesh had another kind of behavior. I could not get that line-pattern on the mesh. Do’nt know why this was not possible. You can use it on some of the meshes but not all meshes will allow you to do that.

The corkscrew mesh was a bit difficult to handle. But in the end there were a few  interesting results.

The bohemiandome gave me very different images than the previous examples. There was not much of a pattern or structure to look for. There just wasn’t any available. I am still not really finished with the bow mesh. The maedersowl mesh did give me several interesting shapes.

The longer I work with this tool the more I get the impression that it has endless possibilities. And I only came to vcount 7  (of 400) during working with the astroidalellipsoid. Anyway that 400 can easily changed to a higher number.

Made some variations with the triaxialtritorus. The limpettorus mesh stays in a way a UFO. The horn mesh gives interesting rounded shapes. Not ready yet with the shell mesh. The kidney mesh gave me some funny results. Which is also true for the lemniscape and the trianguloid mesh. I think I found the superformula mesh the least interesting. I could not get very interesting images from it. But maybe that will happen in the next session.

Generative Design Variations M.3.3 The mesh class

Here is the Generative Design book text: ‘The calculation and rendering of the grids for the rest of the additional examples in this chapter are encapsulated in a class. This means that all the parameters for the mesh and the functions for calculating and drawing it are summarized in a separate part of the program, making it easier to generate the mesh; the code is also clearer. In addition, many standard forms are predefined in the class. The following two lines, for example, suffice to generate and draw a mesh. Here is an example of the ‘Steinbach screw,’ a form that features 100 tiles in the u and v directions, a value range for u from -3 to 3, and a value range for v from -Pi to PI:

Mesh myMesh = new Mesh(Mesh.STEINBACHSCREW, 100, 100, -3, 3, -PI, PI);

The mesh class is also contained in the Generative Design library documented in detail at A short reference for the mesh class is located at the end of this chapter.’ Until here the Generative Design book. You can find the original code here:

I have prepared a Flickr Album which contains all the images I have made during this assignment. You can find that clicking this link:

And because these programs do not work in JavaScript I have put all code involved on my loftmatic page. When you click on the previews you get to see the Processing code only.

There are a few things which I had to make clear to myself. I have the impression that this example was made to get used and use the mesh class. Not everything in the mesh class is clear to me. So to make good use of it I tried to merge some of the functionality of the earlier examples. One is the screendump function. I don’t know why the choice is made for saveFrame in the original program. Using saveFrame means that every time you run the program a screendump is made. But maybe I am missing something. And I would like to rotate and zoom the object. Maybe I can find a solution for that. Ok… So it is not possible to get the key-functionality from the earlier examples into this program without modifying it a bit. I think it is because the draw-block is encapsulated into the mesh class. And I do not want to make any changes in the class. But does my lights setup of the previous examples work. No because the program has another light functionality. Its added in setup. And I am supposed to work alone in setup? So I could change the light settings in setup? Lets try that. What is lightSpecular? Sets the specular color for light. It is set to 230, 230, 230 that is a light grey in RGB. But the mesh class uses HSB. So I have imported the light settings of my earlier examples in the setup block. It seems not to be necessary to uncomment the HSB line in the mesh class. Another thing is that I found that the 5th parameter in myMesh.setColorRange gives a nice pattern when you make it lower than 90.

There are 22 predefined meshes in the mesh class. They are called: plane, tube, sphere, torus, paraboloid, steinbachscrew, sine, figure8torus, elliptictorus, corkscrew, bohemiandome, bow, maedersowl, astroidallipsoid, triaxialtritorus, limpettorus, horn, shell, kidney, lemniscape, trianguloid and the superformula. I started to experiment with the steinbachscrew. Just because it was already incorporated in the code. I took the time for  playing with the parameters in the steinbach screw. After working with it for a while it seems possible to break the mesh down to very simple shapes. Which gave me some unexpected images. I also made a draw block in the first tab. This solved a few things for me. I can get my zoomFactor back using my up and down keys. And I can use the s-key for saving a frame. And it seems that it is giving me a better image quality.

Ok. I have noticed that all other examples of this program are the same. Except for the fact that they load a new predefined mesh shape from the mesh-class. My idea is to explore all the predefined meshes. I will generally describe what I have done. So I will not describe every change per mesh. After working with the steinbachscrew I continued with the plane mesh. But after a while it did not look very interesting to me. It’s a plane mesh. So I played with a few parameters but than I replaced the object for a tube mesh. Rotated it on the x-angle because it seems that it doesn’t make any difference to rotate it on the y-angle. So I replace that by rotation on the z-angle. You can make a very narrow band (or ribbon) with it. You can make it larger or smaller. Or you could introduce more tubes.

Used the sphere mesh. Decreased the value range for v from -1 to 1. Which gives me a very thin ellipse. Increased the value range for v from -100 to 1. This gives me a kind of bowl. And it seems that there is a gap in the bottom. Ok… if you increase -100 to -180. The bowl is complete. The hole has gone. There are a lot of possibilities already available when you work with this sphere.

A torus (to say it rough) is a donut shaped object. I removed the top half of it. And I made a version in which I removed the top sides. Wich gives me another kind of bowl. looked from various angles to the mesh and finally I have cut away the bottom and a part of the sides.

Warszawa Ochota railway station and the Calgary Saddledome are an example of a hyperbolic paraboloid. We are working with an elliptic paraboloid. Which is shaped like an oval cup. Why I have two of them on top of each other is a mystery to me. Tried to look at it from different angles. And a few views from the top into the paraboloid. Rotated the paraboloid almost 360º and stripped the sides. Reduced the value range for v from -30 to 30.

I skipped the steinbach screw because I started with that. I will continue with the sine mesh. I increased the value range for u from -5000 to 5000. Decreased the value range for u from -50 to 50. Which renders a very odd object. A very strange object. It is difficult to judge how this object would look like when it was would be printed in 3d (or 3d-printed).

What is a figure8torus? Checked that and a figure 8 torus is also known as a figure eight torus. The figure eight torus is an immersion of the torus which has a single (circular) double curve down the middle. Hope that makes sense. Started with the plane object. No changed angles whatsoever. Rotated the object on the x-angle -1.5. No rotation on the x-angle. -1.0 on the y-angle. Rotated the object -1.5 on the x-angle, -2.5 on the y-angle and 0.5 on the z-angle. Changed the radians to -90 and 90. Rotated the object on the x-angle by -0.5.

An elliptictorus is a surface of revolution which is a generalization of the ring torus. In other words the object has an inside pointy cavity in an elliptic shape on the outside. I have rotated it -0.4 on the x-angle. Cut off the top and bottom of the elliptictorus. Looking from the top inside the object. Is it a coincidence that this object is rotated 3.14 (pi) degrees on the x-axis? Filled the bottom again which shows the point element better. One image shows the bottom (or the inside) of the object. And another image shows the top of the object. Which looks like an apple.

The corkscrew mesh gives me a corkscrew-ish image. It looks like there are two corkscrews involved which are tangled into each other. When you decrease the radians from -10 to 10 you can get very nice shaped ribbon-like objects. Making the ribbon thicker gives you other objects. Lowered the amount of tiles to -600. And decreased the radian value rage to -180 and 1 makes the ribbon thicker.

Next one is the bohemiandome. It’s quite simple: If you rotate a circle which is parallel to a plane in a circle that is perpendicular (a straight line at an angle of 90°) to the same plane, the resulting envelope is a bohemian dome. Well… it is not really clear to me yet. So we have this tube. I have cut a part of it. But it still doesn’t make a lot of sense. Ok. And than it folds inside on the lower part. And it folds over the upper part. Ah… got it. And those inner and upper foldings connect to each other in the final bohemian dome object.

The bow mesh. I think with bow they mean arc? A continuous part of the circumference of a circle (circular arc) of an other curve. Hmmm… think I am wrong here. This object doens’t look like a bow. It is a bow-ish object though (from the side (a little)). I’am now almost sure that rotating 3.14 on the x, y or z angle is a full circle round the object. Rotating 1.57 is half the circle. Cut away the lower part. The ends connect fine at 90º. Cut away the side parts.

The meadersowl mesh seems to be a flat object. Or it exists out of flat planes if you look at the object under a zero angle. But rotated on the y axis it seems it exists out of ellipses wich are sticked to each other but not in a random way. Decreased the v-value range radians to 0. Which seems not a good idea. So I increased it to 90. Made some examples with the same viewpoint. But I increased the v-value-range to -360. And decreased the v-value-range radians from -360 to -180.

I checked what an astroidal ellipsoid is. Again its very simple: The surface which is the inverse of the ellipsoid in the sense that it ‘goes in’ where the ellipsoid ‘goes out.’ Sounds logical. But what to imagen with that? Rotated the object on the x-axes for 1.0 degrees. Rotated the object on the y-axis for 0.785 degrees? This is a very strange object. It behaves totally unexpected on my input. I rotated it 3.57 degrees on the x and -0.785 degrees on the y axis.

I could not find any theoretical explanation about what a triaxialtritorus is. And it looked pretty complicated when it showed up for the first time in my display window. Rotated it on the y-axis for 1.57 degrees but that shows me just the opposite of the object which is still very complex. Rotated it 0.785 on the x-axis but the object stays a mystery to me. It is still not completely clear to me. I rotated the object now 0.5 on the x-axis and -0.2 on the y-axis. A kind of ashtray object. Is there anyone out there who knows what an ashtray is? I rotated the object on the y-axis – 0.785 degrees.

The limpet torus. I did not find any description. And when opening the object it doesn’t have a specific shape. Looks like an ellipse with a hole in the middle. I rotated the object 2.0 degrees on the x-axis. And now it looks very UFO-ish (seen from the bottom-side). Rotated it 3.14 degrees. I have cut away the bottom? And I have cut away some piece of the front.

The horn. But it looks like there are two horns involved. I have cut away the inside of the horns. And I have broken down both horns by decreasing the u value range to -1, 1. Ah… I have noticed that you also can use floats. It doesn’t have to be integers. That gives me some more freedom. Could make a not so perfect ‘c’. And a not so perfect ‘6’.

The shell mesh. It is possible to make the inner and outer swirl longer. But that is not endless because when you continue to make the outer swirl longer you end up with lesser and lesser points. It’s u and v direction value range is now -32 but if you double that amount the tiles are going to show up. I have cut away the top of the shell. Rotated the shell mesh -0.2 degrees on the x-axis. The value range for v is changed to -40, 30. I have increased the u-value range to -64.0, 6.3. And because the tiles showed up I had to increase the tiles to 1000 x 1000.

The kidney mesh looks like two squashed balls on top of each. Rotating it on the z-axis seems to make no difference. Except when yo cut a part of the object away. Decreased the value range for v from -50 to 180. Rotated the object 1.57 degrees on the y-axis.

The lemniscape mesh looks like a flattened four-leaf clover. The anti-aliasing doesn’t work well here. Specially in the middle it doesn’t do a good job. I’ve rotated the object 1.0 degrees on the x-axis. Which gives me a total different object. Rotated it again on the z-axis for 1.0 degrees. Yet another different object. Rotated it -2.0 on the x-axis and 2.0 on the z-axis. Again a totally different object. I don’t see how this object is related to the four-leaf clover. Tried to find an angle in which you can see the original four leaf clover but also the other shape it can have. It stays a mystery for me how this object behaves.

The trianguloid mesh is a kind of knot (I think). Hmmm… when you rotate it on the y-axis it is a very complicated knot. And when you cut away a lot you can see that the basic shape looks a bit like the Toyota logo. If you cut away a little less you can see how it all is related to the final object. I have added a bit more material. Don’t know if this makes sense for the recognition of the object.

And the last mesh is the superformula. It can be used to describe many complex shapes and curves that are found in nature. But I only see a not so perfect sphere. Eh… So I have cut away one-sixt part and I get a 3-dimensional-pacman-like object with a pointy head? When you look into the mouth of the pacman you see the inside of a sphere. Which seems straightforward to me. I have put the object on its side and made an opening in it. But there seems to be a copy of itself inside the object.

Generative Design Variations M.3.2.5 Optimizing the code

This is the fifth example of the ‘Formulated bodies’ chapter. The Generative Design book describes this example as follows: ‘Generally speaking, all three-dimensional forms defined by mathematical functions can be generated with the last version of the previous program. Since rendering with complicated functions or a very large number of grid points can be very CPU-intensive, a simple optimization of the code should be performed. At the moment, all the grid points are newly calculated for each frame (i.e., each time the grid is drawn). It would suffice, however, to calculate the x-, y-, and z-coördinates just once at the beginning. In addition, almost all points are calculated twice: the lower points of a tile row correspond in the end to upper tiles of the next row. It is therefore better to calculate the points at the beginning and to store them in a two-dimensional array..’ Here is the original code from the Generative Design book:

I have prepared a Flickr Album which contains all the images I have made during this assignment. You can find that clicking this url:

And because these programs do not work in JavaScript I have put all code involved on my loftmatic page. When you click on the previews you get to see the Processing code only.

Because this assignment is about optimizing code I will still try to make different shapes. Maybe I will repeat myself doing that. I started with adding the arrow down / up with: Zoom – / +. And I imported my light settings from the previous examples. Also changed the global variable names. I also closed the object which was open in the example. It’s now only open at the sides of the object. I definitely do need a screendump function. Used the s-key for that.

Used that single object to make a pattern with two for loops which I also used in the other assignments. And I used some of the functionality which was in the previous sketch series (M.3.2.4). I adjusted the H- & V-MinMaxValue Range during the initialization at the top the program. And I picked up my last bending possibility from M.3.2.4. using rotateX for a minimal bending of the total object.

Increased the amount of objects to a matrix of 32 x 32 objects.

Increased the amount of objects to 64 x 64. And I had to decrease the H & V GridDefinition to 10. Otherwise the sketch would react very lazy.

These are two equal objects. Except one of them is rotated an extra 90 degrees. 90 Degrees gave me better results than rotating it 180 degrees. This is now a matrix of 256 x 256 objects.

Decreased the H & V GridDefinition to 4. But I think at this moment the object gives me too much noise and moiré effects. This can be nice sometimes but it is not in this case.

Still a bit noisy but it’s getting better. Especially when you get up closer to the object. Decreased the H & V GridDefinition to 2. At this point you could ask yourself why still use objects. And that is a very relevant question which I cannot answer. Sometimes you arrive at points which are not really based on logic. But just by doing things step by step you accept that you have arrived at that moment in the process . Hopefully that makes sense. But I agree that this would work with ellipses or rectangles. Because the objects are now of such a size that it is almost only 1 pixel.

In this example I used a matrix of 512 x 512 objects. That makes a total of 262.144 objects. Both rotated by rotateX. But one of them is rotated 90 degrees extra.

In fact this is exactly the same sketch as the previous one. The only difference is that in the for loop (on line 122) j += 2 and on line 123 i++. Everything is copied and an extra rotation of 90 degrees is added. Than I replaced the vertices by the 3D Primitive box. Using 262.144 boxes is of course slowing down my machine. Fortunately I am not in a hurry. But I will half the amount of boxes. That seems not to be enough so I halved the amount again to a matrix of 64 x 64. Which is still 4096 boxes.

This is the same object as the previous sketch. I only modified the for loops.