Download or view embossCap.frink in plain text format
/** This renders a birdcage with an embossed pattern on it for 3-D printing.
*/
use Plot3D.frink
p = new Plot3D[]
res = 254/in
img = new image["file:spiraleggblack.bmp"]
img = img.gaussianBlur[10]
//img.show[]
thickness = 2.4 mm
radius = ((2.5/2 in) + thickness) res
height = 3 in res
v = callJava["frink.graphics.VoxelArray", "construct", [-radius, radius, -radius, radius, 0 in res, height, false]]
v.drawCappedCylinder[0,0,0,0,0,height-radius,radius]
pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
min = v.getMinimumSetPoints[]
max = v.getMaximumSetPoints[]
cx = (min.x + max.x) div 2
cy = (min.y + max.y) div 2
cz = (min.z + max.z) div 2
println["Minimum set points: " + min.toString[]]
println["Maximum set points: " + max.toString[]]
println["cx=$cx, cy=$cy, cz=$cz"]
cz = 2/3 cz
depth = 2 mm res
vangle = 180 deg
vcenter = 33.8 deg
emboss = v.sphericalEmboss[img, cx, cy, cz, 180 deg, 360 deg, vcenter, 180 deg - vcenter, 0, 175, depth, 0 mm res, -depth, 0 mm res, pixelTool, 0, 0, 0]
hole = v.makeCappedCylinder[0, 0, 0, 0, 0, (1.7 in) res, 2.5 in res/2]
//v.remove[emboss]
cap = v.union[emboss]
cap.remove[hole]
p.show[cap]
p.writeObj[cap,"embossCap"]
Download or view embossCap.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, eliasen@mindspring.com