extrudeTest.frink

View or download extrudeTest.frink in plain text format


/** This tests extruding an image or text to a 3-D VoxelArray for 3-D
    printing. */


g = new graphics
g.font["SansSerif", "bold", 10]
g.text["Alan", 0, 0]
img = new image[g, 800, 800].autocrop[]
//img.show[]

v = callJava["frink.graphics.VoxelArray", "extrudeZ", [img,20]]

//println["Max x is " + v.getMaxX[]]
println["Max z is " + v.getMaxZ[]]

// Rotate it up around its bottom
v = v.rotate[v.getMaxX[], 0, 0, 1, 0, 0, 70 deg]

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

filename = "extrudeTest.obj"
print["Writing $filename..."]
w = new Writer[filename]
w.println[v.toObjFormat["extrude"]]
w.close[]
println["done."]




View or download extrudeTest.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, 16 hours, 2 minutes ago.