TOP SEARCH TERMS
CANCEL
TOP SEARCH TERMS
Subtotal:

Reorder

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:
      1. translate([0,50,0]) circle(30);
      2. 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:
      1. “hull()
      2. {
      3. translate([0,40,0]) circle(30);
      4. circle(50);
      5. }”
    • 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.
  • 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:
      1. square(50);
      2. 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:
      1. minkowski()
      2. {
      3. square(50);
      4. circle(10);
      5. }
    • You should now see a square with rounded corners!
  • 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.
  • 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!

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 , , , , , , , , , , , , 3 comments
 

3 Comments so far

  • Brad Pitcher
    April 30, 2012 at 4:14 pm
     

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

     
  • Triffid Hunter
    May 1, 2012 at 8:31 pm
     

    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
    December 27, 2012 at 8:07 pm
     

    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.

     
 

Leave your comment

 
 
 

xhtml: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

 
 

12 months special financing on new
MakerBot 3D printer hardware purchases
with Dell Preferred Account on Dell.com.


Limited-time offer for qualified customers.
Offer Details

12 months special financing on new MakerBot 3D printer hardware purchases is a no interest if paid in full by November, 2015 financing promotion. Interest will be charged to your account from the purchase date if the purchase balance is not paid in full by your payment due date in November, 2015 or if you make a late payment. Minimum monthly payments are required during the promotional period. If not paid by end of promotional period, account balance and new purchases will be subject to the Standard APR rates, which range from 19.99% - 29.99% variable APR, as of 8/30/2014, depending on creditworthiness. Offers subject to credit approval and may be changed without notice.

Dell Preferred Account offered to U.S. residents by WebBank, who determines qualifications for and terms of credit. Promotion eligibility varies and is determined by WebBank. Taxes, shipping, and other charges are extra and vary. Payments equal 3% of your balance or $20, whichever is greater. Minimum Interest Charge is $2.00.

All products in your cart at the time of purchase will qualify for the special financing promotion if purchased with Dell Preferred Account between 11-26-2014 through 12/30/2014.

New MakerBot 3D printer hardware purchases are eligible! Refurbished and/or used purchases do not qualify for promotions. Eligible e-value/order codes: A7516721, A7629818, A7598495, A7617635.

Chat
What can we help you with today?
I want to chat with Sales.
I have a question about an existing order.
I have a technical question about my device.
Continue
Existing Orders
For faster service, enter your order number
(found in your confirmation e-mail)
Skip
Submit