Download or view squeezy2.frink in plain text format
/** This program makes a squeezer to squeeze the last drops out of a liquid
packet. It renders a file for 3-D printing. This extends the design by
using new supertoroids for making more comfortable scissor holes.
*/
r = 254/in
height = 7 mm
armLength = 5.5 in
armDepth = 7 mm
ringThickness = 4 mm
ring1Diam = 23 mm
ring2Diam = 26 mm
gap = 0.3 mm
// The hinge
v = callJava["frink.graphics.VoxelArray", "construct" , [0 mm r, 10 mm r, -armDepth r, armDepth r, 0 mm r, height r, true]]
// Arms
a1 = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [9 mm r, (9 mm + armLength) r, gap/2 r, armDepth r, 0 mm r, height r, 1 mm r]]
a2 = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [9 mm r, (9 mm + armLength) r, -armDepth r, -gap/2 r, 0 mm r, height r, 1 mm r]]
// Ring1 (finger)
r1 = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [(1/2 ring1Diam + 1/2 ringThickness) r, 1/2 ringThickness r, 1/2 ringThickness r, 1.001 height/2 r, .5, 1]]
rcx = (9 mm + armLength - (1/2 ring1Diam))
rcy = armDepth + (1/2 ring1Diam)
r1.translate[round[rcx r], round[rcy r], round[height/2 r]]
a1 = a1.union[r1]
// Ring2 (thumb)
r2 = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [(1/2 ring2Diam + 1/2 ringThickness) r, 1/2 ringThickness r, 1/2 ringThickness r, 1.001 height/2 r, .5, 1]]
rcx = (9 mm + armLength - 1cm - (1/2 ring2Diam))
rcy = -armDepth - (1/2 ring2Diam)
r2.translate[round[rcx r], round[rcy r], round[height/2 r]]
a2 = a2.union[r2]
v = v.union[a1]
v = v.union[a2]
// Add text
t1 = text["Over hill, over dale...", .8 armDepth r, 1.4 mm r]
t1.translate[round[(9 mm + armLength/2) r], round[armDepth/2 r] , round[height r]]
v=v.union[t1]
t2 = text["Korean clamp will never fail!", .8 armDepth r, 1.4 mm r]
t2.translate[round[(9 mm + armLength/2) r], round[-armDepth/2 r] , round[height r]]
v=v.union[t2]
v.projectX[undef].show["X"]
v.projectY[undef].show["Y"]
v.projectZ[undef].show["Z"]
filename = "squeezy2.obj"
print["Writing $filename..."]
w = new Writer[filename]
w.println[v.toObjFormat["squeezy", 1/(r mm)]]
w.close[]
println["done."]
/** Extrude text along a plane and create a VoxelArray of it. */
text[str, textHeight, depth] :=
{
g = new graphics
g.font["SansSerif", "bold", 10]
g.text[str, 0, 0]
img = g.toImage[undef, round[textHeight]].autocrop[]
return callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[depth]]]
}
Download or view squeezy2.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 20203 days, 10 hours, 54 minutes ago.