OpenSCAD Modules for Automatic Fillets (and Radii)

before_after

Fillets in OpenSCAD are not a straight forward endeavor.  There have been many posts about the subject and many proposed solutions including libraries of generic fillet parts to be added to models.  The fillet type that I have been experimenting with uses minkowski sums to achieve the task on a model of any geometry.  Well, theoretically any model anyways.  The use of two minkowski sums in the process makes the procedure unpractical for models of significant complexity because of the time required to produce the result.  I do provide a partial solution to this limitation.  My partial solution is to isolate an area of a larger model for local fillet generation.  At the end of this BLOG post I provide a file containing modules for producing global or local fillets and radii within OpenSCAD.  If you want to know more about the steps taken to generate the fillets continue reading otherwise you can jump to the end to download the SCAD file with the modules.

The following steps are performed automatically by the modules included in the file at the end of this post.  These detailed steps and illustrations are provided for information purposes.

Original sample part: Here is our sample part, the second image shows the sample part with a transparent overlay of the sample part for reference.  The transparent part overlay will be included in the following steps for a visual reference of the original shape.

auto_fillet_step0a (Custom)auto_fillet_step0 (Custom)

STEP 1:  Perform a minkowski sum of the sample part with a sphere (or cylinder if only rounding one axis of the part).  (The image shows a slice of the minkowski sum for illustration purposes.  The full minkowski sum completely encloses the sample part.)

auto_fillet_step1 (Custom)

 

STEP 2:  Subtract the result from STEP 1 from a very large cube using a difference operation.  The large cube needs to be larger than the object being worked on.  This is analogous to inverting the normals on the model making a negative volume.  (CGAL and OpenSCAD do not support negative volumes so this is a work around)

auto_fillet_step2 (Custom)

 

STEP 3:  Perform a second Minkowski sum of the results from STEP 2 and the same sphere (or cylinder) used in STEP 1. NOTE: This is the most computationally intense step in the filleting process.

auto_fillet_step3 (Custom)

STEP 4:  Perform a difference operation to subtract the result from STEP 3 from a large cube.  The cube used in this step is slightly smaller than the cube used in STEP 2.  The remaining object has internal fillets with a radius equal to the radius of the sphere (or cylinder) used in the previous steps.  The top picture shows the object with the original shape shown transparent.  The lower image has the transparent original shape removed.

auto_fillet_step4 (Custom)auto_fillet_step5 (Custom)

This procedure works in the generalized 3D case with the size limitations I mentioned earlier. Additionally there is an analogous procedure to produce radii on external corners.  Below are images of a sample three dimensional parts with fillets and radii generated automatically using the module file I provide below.

Base 3D part:

3D_fillets_base_shape

3D part with Fillets (31 minute build time):

3D_fillets_31min

3D part with rounds (<1 minute build time):

3D_rounds_Xmin

3D part with fillets and rounds (80 minute build time):

3D_fillets_n_rounds_80min

As I mentioned earlier there is a partial solution to the model size limitation of this procedure.  This partial solution involves selecting a specific region of the model to be operated on and removing that region from the model while performing the operations.  After the operations are complete the removed section of the model is inserted back into the larger model via a union command.  This removal and re-installation of the sub-model is incorporated in the modules  provided in the .scad file linked at the end of this BLOG post.  To use the sub-modeling you just need to include a second object (child) in the module call to indicate the region to be operated on.  For example using the SCAD file provided if the module add_fillets is called on an object alone all of the internal corners will be filleted

add_fillets(R=sample_R)
{
    sample_object();
}

If you call the add_fillets module and you include a second object only the areas of the first object that intersect the second object will be filleted.  (in the example below the second object is a 10x10x10 cube.

add_fillets(R=sample_R)
{
    sample_object();
    cube([10,10,10])
}

Below are a couple of pictures of our sample object with localized region fillets and radii.  All of the pictures below used a sphere with $fn=20 for the radius generation.  The default in the module file provided is $fn=6 to ensure reasonable run times for the example object.

Local region illustrated by a transparent box:

3D_local_box

3D part with local fillets:

3D_local_fillets_41min

3D part with local radii:

3D_local_rounds_Xmin

3D part with local fillets and radii:

3D_local_fillets_n_rounds_67min

Finally, below is the link to the the .scad file containing the modules for fillets and radii.  The file also contains the simple examples shown in this post.  In addition to generalized fillets and radii the modules can be used to do single axis fillets and radii.  The single axis options (“x”,”y” and “z”) are much faster than the general option (“xzy”) so if you are only looking for a fillet in one axis it is better to use the specific axis you need.  Play with the examples to see how each option works.  The default “fn” value is 6 to keep the render time low.  To get more usable results that number will need to be increased.  (The sample images above used an fn=20).

Get the file here: fillets_and_rounds.scad

 

Stick Bomb Fixture

fixture2 (Custom)

I made a quick little 3D printable fixture to aid in the construction of stick bombs.  The type of bomb this fixture makes is my favorite.  If the bomb is long enough a wave forms along its length as the bomb explodes.  Below is an embedded video showing how it all works.  The fixture is available for download on Thingiverse (Stick bomb Fixture)

Lego model of a 3D Printer (Printrbot Simple Metal)

OLYMPUS DIGITAL CAMERA

My two boys love having a 3D printer in the house.  I have made a variety of items for them.  My 9 year old, Derek, came up with a great little Lego build.  He made a tiny Lego version of the Printrbot simple metal 3D printer that we have.

OLYMPUS DIGITAL CAMERA

He really captured the essence of the simple metal with incredibly few Lego pieces.  It is even sized about right to put it in the workshop in their Lego city.

OLYMPUS DIGITAL CAMERA

The parts you will need to build your own and an instructional video by Derek are below.

OLYMPUS DIGITAL CAMERA

CNC Lithophane Jack-O-Lantern

jackolantern

Halloween is approaching so I thought I would share the Jack-o-lantern that I made for Halloween last year (2014).   I carved an image, lithophane style, into a pumpkin.  The pumpkin is cut deeper where the image is lighter and less deep where the image is darker. This makes the image appear when the pumpkin is back-lit with a candle.  Various programs are available to generate g-code from an image in this way.  I used Dmap2gcode to generate g-code for my jack-o-lantern.

The g-code generated by Dmap2gcode is suitable for a flat surface but a pumpkin is not flat.  In order to cut the image onto the uneven surface of the pumpkin an additional step is needed.  I used  G-Code Ripper to add an automatic probing sequence to compensate for the non-flat pumpkin surface.  A makeshift probe consisting of a piece of aluminum foil and some alligator clips was used for probing the pumpkin (see video below).  Since the pumpkin was soft I was afraid that any other kind of probe might dent the surface before registering the probe data.

In order to hold the pumpkin I cut the bottom off of an ice cream pail and fastened it to the CNC machine table.  A ring of scrap wood kept the bucket from flexing to much when the pumpkin was placed in it.  Once the bucket was secure I simply placed the pumpkin in the cut pail.  Cutting the pumpkin didn’t generate any large forces because the pumpkin was so soft.  I didn’t have any problem with the pumpkin shifting during the probing/cutting process.  No large forces were generated but a lot of pumpkin flesh was flying around so I covered my machine with plastic sheeting.

OLYMPUS DIGITAL CAMERA

OLYMPUS DIGITAL CAMERA

If you didn’t recognize it the picture I used was a picture of Linda Blair from the the movie “The Exorcist”.  Below is a short video of the pumpkin being cut.

If you are interested in trying this process here are some of the details of my process:

  • I set the maximum cut depth to 3/8 inches in Dmap2gcode
  • I edited the picture so everything that was not of interest was black.  That way I can un-select “Cut Top Surface” in Dmap2gcode and the cutter will leave unimportant parts of the image untouched
  • I used a grid of 10×10 points for probing the pumpkin only a few of the probed points are shown in the video
  • After carving with the CNC machine I did some additional scraping of the inside of the pumpkin until I was happy with how much light was being let through in the image

 

V-Carve Inlays and More with F-engrave 1.50

F-Engrave 1.50 has been released and is now available on the F-Engrave page. Here are a few of the highlights from this release:

  •  Modified helper program (ttf2cxf_stream) and F-Engrave interaction with it to better control the line segment approximation of arcs.
  • Added straight cutter support (cutter will follow design inside or outside of lines)
  • Added option to create prismatic cuts (inverse of v-carve).  This option opens the possibility of making v-carve inlays.
  • Added option for radius format g-code arcs when arc fitting.  This will help compatibility with g-code interpreters that are missing support for center format arcs.  (I think GRBL will accept the radius format arcs)

One of the most exciting new things you can do with F-Engrave now is v-carve inlays.  Below is a video I put together showing the process of making an inlay with F-Engrave.

Here is an example of an inlay that i made during testing of the new features.  The eagle is a slightly modified version of an eagle I found on WikiMedia.

eagle_inlay (Custom)

Here are the parts before gluing them together to form the inlay.

KIMG0034 (Custom) KIMG0033 (Custom)

Kansas City Maker Faire Trip

This year I took my two boys to the Kansas City Maker Faire for the second year in a row.  We once again had a great time.  This year we attended both days of the faire.  We learned last year that one day was not long enough for us.

KIMG0137 (Custom)

We live in Minnesota so our adventure starts long before we get to Kansas City.  On our way to the faire we managed to find a couple of interesting items.  First was the large art display of buffalo silhouettes cut from steel plate.  These buffalo were located at the first rest stop in Missouri as we drove south on I-35.  It was a bit of a surprise because they were not visible until we were already at the rest stop.  It was a great place to get out and walk around a bit.

KIMG0139 (Custom)

Our second surprise was an antique store in Bethany, MO.  We were stopping for the day in Bethany to stay in a hotel since it was much cheaper than staying in Kansas City.  We had a bunch of time to kill so I took the kids to Jim’s Antiques just east of I-35 (Exit 92).  My kids loved it.  The antique store had a whole yard full of rusty tools, including some old propane tanks plasma cut with various designs including the local high school team logos.  Inside the store there was a vast array of items.  We didn’t escape before my little blacksmith bought an anvil shaped aftershave bottle for $2.  They had some real anvils and a blacksmith vice but they were too expensive for my 9 year old to afford.

KIMG0196 (Custom)KIMG0199 (Custom)

The next morning we headed to Moon Marble Company to see marbles being made live in the store.  The Moon Marble company store had a lot of games, skill toys (throwing tops, yo-yos, puzzles, etc.) and novelty items.  We had plenty to keep us busy while waiting for the marble making demonstration to start.  We were able to stay and watch Bruce Breslow (the store owner) make a marble from start to finish (I would guess it took about 45 minutes).  Bruce did a great job describing what he was doing and keeping the audience interested.  It was a great addition to our “making” themed trip.

KIMG0142 (Custom) KIMG0147 (Custom)

After the marble making demonstration we finally headed to the maker faire.  As usual we had a great time at the maker faire.  There was a lot of variety and a bunch of new things that were not there last year.  The kids had a chance at a variety of activities.  They Flambé-ed someone, checked out their entries in the Make A Robot Challange and were able to try tying a fly for fly fishing (Thanks to Donfishin).

KIMG0165 (Custom) KIMG0156 (Custom)

We were glad we spent two days at the faire.  The items in this post are only a sliver of what we saw and did at the faire.  Check out some of the Make posts and many other blog posts on the faire itself to see the other great many things that were at the 2015 Kansas City Maker Faire.

Owen and Derek discuss their trip in this video

Preparing for Minneapolis St. Paul Mini Maker Faire

OLYMPUS DIGITAL CAMERA

We are continuing the tradition of custom Maker Faire hitch covers for our Maker Faire road trips.  Since the Minneapolis St. Paul Mini Maker Faire doesn’t have a graphic logo I made up my own.  My design is a play on the Minnesota Twins logo with “Makey Minneapolis” and “Makey St. Paul” meeting over the Mississippi.

I am also piling up everything we need for our first time displaying at a Maker Faire.  The kids wore out a couple of sleds last winter so I have been cutting the sleds up to feed the injection molder.

OLYMPUS DIGITAL CAMERA

Everything we injection mold for a while will be blue and or orange.  If all goes well we will be injection molding live at the Minneapolis St. Paul Mini Maker Faire This Saturday.

One Day Foundry – For Aluminum Casting

As a challenge to myself I decided to make a very simple foundry setup for melting and casting aluminum.  I have a larger more involved equipment but I thought it would be interesting to revisit some of the methods I used for my first castings.  I also wanted to explore some new ideas I had for setting up a simple aluminum foundry.

If you have ever thought that you might like to try doing some aluminum casting “One Day” my “One Day Foundry” web page and the accompanying video may be of some help.  The steps I used to accomplish the task were intended to get to the end result quickly with few tools.  There are many ways to accomplish the same end result, I present only one.

I carefully selected my supplies and hand tools before I started and took the picture shown below.  After I had the necessary items I did all of the preparation work using only hand tools and an electric drill.  When I started casting aluminum I did not have much more than those simple tools in my possession.  Below is a picture of the tools and equipment I started with.  The only items that I did not have laying around the house were the two 8 foot 2×2 boards, fire clay and fine sand.  Wood and sand were obtained at a big box home improvement store.  The fire clay is a little more difficult.  I went to Continental Clay in Minneapolis and purchased the clay (Hawthorn-50 mesh fire clay).  They do sell by mail order but finding a local source is probably worth the trouble for most people.

One Day Foundry

I was able to complete the project in less than one day.  I captured the build in the video embedded  below.  More details, including tools/parts list, can be found on the project page: One Day Foundry project page.

And the resulting casting.

OLYMPUS DIGITAL CAMERA

 

High Speed Spindle (Router) Mount for a CNC Mill

I find myself doing CNC work on wood about half of the time so I thought it would be nice to have a high speed spindle.  I decided to mount my existing router to my CNC milling machine.  This is the same router I had previously mounted to my Poor Man’s Milling Machine before I bought the CNC machine (a Grizzly G0463 with the CNCfusion conversion kit).  After doing a little bit of Internet research I settled in on attaching a mount to the quill of my CNC machine.  The best source I found of similar mounts is found on this CNC Cookbook page: High Speed Secondary Spindle.

First I started by casting the rough shape in aluminum.  Below is a picture of the wood pattern that I made and the aluminum part in the as cast condition (after the casting sprue and riser were removed).

OLYMPUS DIGITAL CAMERA

After I had the cast part I bored out the two holes to closely fit the quill on the mill and the outer diameter of the router motor I planned to use.  Then I cut slots in the ends and a clearance scallop for the existing gear rack on one side of the router body.  Next I added fastener holes that are clearance fit on one side of the slot and threaded on the other side of the slot.  Fasteners tighten the mount onto the quill and router body to hold them securely.

OLYMPUS DIGITAL CAMERA

Finally the router motor is installed in the mount and the mount is installed on the milling machine quill.  This configuration added a lot of mass to the head stock so I also added a gas spring (not shown) to compensate for the added mass.

OLYMPUS DIGITAL CAMERA

With the addition of the router motor I am able to cut wood at a much faster rate and get a better finish.  Below is a picture of a couple of plaques that I made for my brother with the new high speed spindle.  (The picture was taken before the edges of the plaques were finished).

OLYMPUS DIGITAL CAMERA

The plaques were made to commemorate PHD Baseball’s Worlds Longest Baseball Game that took place in August 2014.

 

 

3D Printed Lithophanes

Ever since I first saw a lithophane in a YouTube video I have thought they were really cool.  I have made cylindrical lithophanes previously with my CNC machine.  When I bought my 3D printer I thought I would give printing lithophanes a shot.  I tried working lithophanes into Christmas ornaments with marginal success (See some of the ornaments here).  After a little refining I printed some pictures on a cylinder and a night light cover.  I removed the original night light cover and replaced it with a 3D printed version.  The nightlight worked out well since it was a purposeful back light for the lithophane.  Below are some pictures of the results.  The cylinder is back lit by a battery operated tea light candle (the pictures are the front and back of the same cylinder).  I spent a bunch of time making the STL file only to find that there are utilities that other people have made available for making cylindrical lithophanes.  Here is a link to one I found on Thingiverse: Customizable Cylinder Lithophane Lamp.