tongsRounded.frink

View or download tongsRounded.frink in plain text format


/** This makes a rounded tongs holder for 3-D printing. */

// The model resolution
r = 254/in

/*
// Longer Alton Brown tongs
thickness = 2 mm
radius = 4 mm
width = 18.8 mm
depth = 24.3 mm
height = 1 inch + 2 radius
*/


// shorter tongs
thickness = 2 mm
radius = 5 mm
width = 17 mm
depth = 25.8 mm
height = 1 inch + 2 radius

// Outer wall
outer = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [-thickness r, (width+thickness) r, -thickness r, (depth+thickness) r, -thickness r, (height+thickness) r, (radius + thickness) r]]

// Inner wall
inner = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [0 mm r, width r, 0 mm r, depth r, 0 mm r, height r, radius r]]

outer.remove[inner]

// Cut off with a top plane
p1 = newJava["frink.graphics.Plane3DFloat", [0 mm r, 0 mm r, (height-radius) r, 0, 0, 1]]
outer.removeOutside[p1]

// Cut off with a bottom plane
p2 = newJava["frink.graphics.Plane3DFloat", [0 mm r, 0 mm r, radius r, 0, 0, -1]]
outer.removeOutside[p2]

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

filename = "tongsRound" + (width->mm) + "x" + (depth->mm) + ".obj"
print["Writing $filename..."]
w = new Writer[filename]
w.println[outer.toObjFormat["tongs", 1/(r mm)]]
w.close[]
println["done."]


View or download tongsRounded.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 18888 days, 17 hours, 6 minutes ago.