toiletScrew.frink

Download or view toiletScrew.frink in plain text format


/** This prints a Johnni-bolt extender for toilet fixtures to help alignment.
*/


res = 254/inch

innerDiam = 6.5 mm
height = 2 in
wallThickness = 0.8 mm

outerDiam = innerDiam + 2 wallThickness

outer = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,height res, outerDiam / 2 res]]

inner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,height res, innerDiam / 2 res]]

cap = callJava["frink.graphics.VoxelArray", "makeSphere", [outerDiam / 2 res]]
cap.translate[0,0,round[height res]]

v = outer.union[cap]    // This gives a cap.
//v = outer             // This gives no cap
v.remove[inner]

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

filename = "toiletScrew" + format[innerDiam,mm,1] + "x" + format[height,in, 1] + ".obj"
print["Writing $filename..."]
w = new Writer[filename]
w.println[v.toObjFormat["toiletScrew", 1/(res mm)]]
w.close[]
println["done."]


Download or view toiletScrew.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 20217 days, 23 hours, 35 minutes ago.