gripper.frink

Download or view gripper.frink in plain text format


/** This makes a gripper cup for a long-reach grabber for 3-D printing out
    of flexible material like TPU.
*/


res = 254/in

// The disc that screws into the gripper.
discDiamBase = 18 mm
discDiamTop = 28 mm
discHeight = 9 mm

outerSpheroidDiam = 37.6 mm
outerSpheroidHeight = 21 mm

wallThickness = 2.4 mm
innerSpheroidDiam = outerSpheroidDiam - 2 wallThickness
innerSpheroidHeight = outerSpheroidHeight - 2 wallThickness

shiftUp = 5 mm

disc = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0, 0, 0, 0, 0, discHeight res, discDiamBase/2 res, discDiamTop/2 res]]

cupOuter = callJava["frink.graphics.VoxelArray" , "makeSpheroid", [outerSpheroidDiam/2 res, outerSpheroidDiam/2 res, outerSpheroidHeight/2 res]]
cupOuter.translate[0, 0, (outerSpheroidHeight/2 + shiftUp) res]

cupInner = callJava["frink.graphics.VoxelArray" , "makeSpheroid", [innerSpheroidDiam/2 res, innerSpheroidDiam/2 res, innerSpheroidHeight/2 res]]
cupInner.translate[0, 0, (outerSpheroidHeight/2 + shiftUp) res]

slicePlane = newJava["frink.graphics.Plane3DFloat", [0, 0, 15.1 mm res, 0, 0, 1]]

v = disc.union[cupOuter]
v.removeOutside[slicePlane]
v.remove[cupInner]

screwDiam = 2.2 mm
screwHeight = 7 mm
screwHole = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, screwHeight res, screwDiam/2 res]]

v.remove[screwHole]

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

filename = "gripper.obj"
print["Writing $filename..."]
w = new Writer[filename]
w.println[v.toObjFormat["gripper", 1/(res mm)]]
w.close[]
println["done."]


Download or view gripper.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 19354 days, 4 hours, 18 minutes ago.