Some more transformations

I admit that I didn’t know about these transformations until today, but i now think they are really useful.

Lets start with minkowski(){...}, this transformation takes two objects, and the result is to create the shape formed when you role one object around the other. This is probably best shown with an example, lets say you wanted to make a bar with rounded corners along the long side up to now we would have done this in using code similar to this :


As you can see this can be done but is a reasonably complicated object to create, the minkowski transformation enables us to create the same final object using the following code:

lets make note of a few things first, to get the rounded cube to end up the correct size we had to remember to reduce the original cubes dimensions by the diameter of the cylinder in x and y, and the cylinders height in z. To see why we did this lets imagine what the minkowski transformation is doing.

lets start with the base cube from before


Next we add the cylinders at each corner of the cube


Now if we were to join up these cylinders by sliding them along the edges of the cube you can see how the final minkowski shape is formed. ofcourse you dont need to use cylinders for this, we could also other shapes, like spheres if we wanted to round all the corners of the cube.

The next transformation is the hull(){...} transformation. This is used if you want to have a shape that transitions from one form to another. for example you want an object that at one side has a square cross section, and have that taper down to a round point with a fixed radius, like if you were drawing up a tool that had been sharpened from a square peice of metal.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *