dreidelShaft.frink

View or download dreidelShaft.frink in plain text format


/** This constructs a shaft for a dreidel for 3-D printing.  See
    dreidel.frink for the rest of the dreidel.  */


r = 254*2 / in

// The hole in dreidel.frink is 1.2 cm in diameter.  Make the diameter of the
// part that fits into the hole to be 0.15 mm smaller for a nice fit. Your
// printer may vary.  You may also want to vary the shaftHoleDepth in this
// program to be slightly smaller for a flush fit.
shaftHoleDepth = 3 mm
shaftHoleDiam = 1.2 cm - 0.15 mm

shaftLength = 1.5 cm

// This is the part of the shaft that fits the hole in the dreidel
v = cylinder[0,0,0, 0,0,-shaftHoleDepth r, shaftHoleDiam/2 r]

// This is the long part of the shaft.
s = taperedCylinder[0,0,0, 0,0,shaftLength r, 2.5 mm r, 1.5 mm r]

v = v.union[s]

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

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

/** Create a cylinder */
cylinder[x1, y1, z1, x2, y2, z2, radius] :=
{
   return callJava["frink.graphics.VoxelArray", "makeCylinder", [x1, y1, z1,
                                                                 x2, y2, z2,
                                                                 radius]]
}

/** Create a tapered cylinder */
taperedCylinder[x1, y1, z1, x2, y2, z2, radius1, radius2] :=
{
   return callJava["frink.graphics.VoxelArray", "makeTaperedCylinder",
            [x1, y1, z1,
             x2, y2, z2,
             radius1,
             radius2]]
}


View or download dreidelShaft.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 18863 days, 4 hours, 46 minutes ago.