dropperHolder.frink

Download or view dropperHolder.frink in plain text format


/** This makes a 3-D model for a eyedropper holder with a hook that hangs
    in a refrigerator. */


// The resolution of the object in voxels/length.
r = 254/in

// Configure these for your cap.  Note that your slicer software may force
// minimum wall thicknesses that override these.
innerDiam = 24 mm
sidewallThickness = 1.5 mm
outerDiam = innerDiam + 2 sidewallThickness
topThickness = 2 mm
height = 46 mm + topThickness

holderWidth = 1.5 cm
holderDepth = 6 mm
holderHeight = 1 cm

// The holder that clips to the refrigerator shelf.  This is a cuboid that
// reaches to the center of the cylinder (and will be cut out later.)
holder = callJava["frink.graphics.VoxelArray", "construct", [-holderWidth/2 r, holderWidth/2 r, -(outerDiam/2 + holderDepth) r, 0, (height-holderHeight) r, (height) r, true]]

// The channel inside the holder that goes over the shelf.  Remove it from
// the holder.
channel = callJava["frink.graphics.VoxelArray", "construct", [-holderWidth/2 r, holderWidth/2 r, -(outerDiam/2 + 3.1 mm) r, (outerDiam/2) r, (height-holderHeight) r, (height-2 mm) r, true]]

holder.remove[channel]

// Outer main cylinder
c1 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, height r, outerDiam/2 r]]
c1 = c1.union[holder]

// Inner main cylinder.  Remove it from outer cylinder.
cin = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, topThickness r, 0, 0, height r, innerDiam/2 r]]
c1.remove[cin]

c1.projectX[undef].show["X"]
c1.projectY[undef].show["Y"]
c1.projectZ[undef].show["Z"]   

filename = "dropperHolder.obj"
print["Writing $filename..."]
w = new Writer[filename]
w.println[c1.toObjFormat["test", 1/(r mm)]]
w.close[]
println["done."]


Download or view dropperHolder.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20145 days, 13 hours, 33 minutes ago.