## OpenSCAD Intermediates: How to Make Organic Shapes

In this OpenSCAD tutorial series we’ve covered the basics of the OpenSCAD interface, how to make 2D forms, how to make some basic 3D forms, how to position those forms in 3D space, the different ways to combine forms, how to create mashups of one or more existing STL’s and OpenSCAD forms, how to use modules to reuse your code to make your life easier, how to extrude flat 2D forms into 3D forms, and how to fix design problems. Although I described a few of the last tutorials as “intermediate” levels, that’s really only because you learned the basics so quickly from the first few tutorials.

Today I’d like to show you how easy it is to make some neat organic looking forms with OpenSCAD. The secret behind doing so are two functions, “hull” and “minkowski.” Let’s learn a little bit about what each of these functions do and try out some code. More, after the break!

**Hull**- The “hull” function essentially connects two or more 2D shapes, almost as if they were “shrink-wrapped” together. Suppose you wanted to create an pear-shape, you could do this by creating two circles – one larger than another – and tracing around the both of them. Let’s see what these two circles would look like without the hull function first:
- translate([0,50,0]) circle(30);
- circle(50);

- What you should expect to see is the two circles, somewhat overlapping. Now, let’s see how the hull function automatically connects these two shapes into just one shape:
- “hull()
- {
- translate([0,40,0]) circle(30);
- circle(50);
- }”

- By using hull to connect squares and circles, anyone can easily create extremely organic seeming shapes. One interesting way to use this function is to create just the major points of your desired complex organic 2D object, and then apply the hull function as we did above. This way you can be sure the final object created by hull would have all the important features you were trying to create.
- Pro Tip: The hull function can be used with more than one 2D shape.
- Pro Tip: Since a complex object created with hull is also a 2D shape, you can make another 2D shape by using hull around other 2D shapes and other complex shapes created by a hull function.

- The “hull” function essentially connects two or more 2D shapes, almost as if they were “shrink-wrapped” together. Suppose you wanted to create an pear-shape, you could do this by creating two circles – one larger than another – and tracing around the both of them. Let’s see what these two circles would look like without the hull function first:
**Minkowski**- The “minkowski” function basically takes one 2D shape and traces it around the edge of another 2D shape. As with “hull”, the best way to understand how this function works is to see how the two objects appear without, and then with, the minkowski function around them. So, first try:
- square(50);
- circle(10);

- You should see a square and a circle overlapping at the origin point. Now, let’s try it again with the minkowski function around those two 2D objects:
- minkowski()
- {
- square(50);
- circle(10);
- }

- You should now see a square with rounded corners!

- The “minkowski” function basically takes one 2D shape and traces it around the edge of another 2D shape. As with “hull”, the best way to understand how this function works is to see how the two objects appear without, and then with, the minkowski function around them. So, first try:
- Wait, wait… I promised you organic, right? Try this on for size:
- minkowski()
- {
- circle(4);
- for(i=[0:5])
- {
- rotate([0,0,360/5 * i])
- hull()
- {
- translate([20,0,0]) square(10);
- square(2);
- }
- }
- }

**Conclusion**- Hull and Minkowski functions let you combine two or more 2D shapes in ways that would be really difficult in other methods. Using these two interesting functions in conjunction make even more amazing organic appearing shapes possible. Once you’ve created a complex shape by using hull, or several hull objects combined, being able to trace another shape around that complex object can make interesting, and sometimes slightly unpredictable results.

- Hull and Minkowski functions let you combine two or more 2D shapes in ways that would be really difficult in other methods. Using these two interesting functions in conjunction make even more amazing organic appearing shapes possible. Once you’ve created a complex shape by using hull, or several hull objects combined, being able to trace another shape around that complex object can make interesting, and sometimes slightly unpredictable results.
**Homework Assignment**- Now that you’ve learned how to use hull and minkowski functions, show everyone what you can do! Use what you’ve learned today to either (a) create one 2D object using hull and one 2D object using minkowski or (b) one object that uses both hull and minkowski, then upload your your OpenSCAD file and the STL to Thingiverse.
**Extra credit:**If you want to make me*extra*proud, please tag it with “openscadtutorial.” That way anyone who clicks that link will be able to see all of our hard work!

- Last but not least, today’s gold star goes to… rvanchie for their OpenSCAD tutorial homework. I’d like to include a picture of
*your*homework next time – so don’t forget your homework!

- OpenSCAD Basics: The Setup
- OpenSCAD Basics: 2D Forms
- OpenSCAD Basics: 3D Forms
- OpenSCAD Basics: Manipulating Forms
- OpenSCAD Intermediates: Combining Forms
- OpenSCAD Intermediates: Mashups
- OpenSCAD Intermediates: Modularity
- OpenSCAD Intermediates: Extruding 2D Objects
- OpenSCAD Intermediates: Fixing Design Problems
- OpenSCAD Intermediates: How to Make Organic Shapes
- OpenSCAD Design Tips
- OpenSCAD Design Tips: How to Make a Customizable Thing

The topic of the next tutorial is up to you. What would you like to learn next? Is there something you’d like to learn how to make? Is there something more you’d like to learn about some of the topics we’ve covered?

Error - could not find Thing 20790.

Tagged with | 2d, 2d forms, design, homework, hull, minkowski, openscad, openscad tutorial, openscad tutorials, organic, rvanchie, tutorial, tutorials | 3 comments |

## 3 Comments so far

## Brad Pitcher

Don’t forget the latest release now supports hull() over 3D shapes!

## Triffid Hunter

minkowski and hull work in 3d as well.

there’s actually a bug in openscad regarding minkowski on 2d shapes, it removes all holes!

## Alexander Hosford

I would literally steal the Pope if someone could write a tutorial on the rounding of vertices, whilst leaving the edges straight. I’ve been trying a few methods and they all blow.

Serious, I will steal the Pope and deliver him to you.