VoxelStrokePolygonTest.frink

View or download VoxelStrokePolygonTest.frink in plain text format


/** This program tests the extrusion of a polygon for 3D printing. */

polygon = newJava["frink.graphics.Point2DFloatList"]

sides = 7
sideAngle = circle/sides
angle = 90 deg  // Point at top

outerRadius = .5 in

res = 254/in

polygon = callJava["frink.graphics.Point2DFloatList", "makeRegularPolygon", [sides, outerRadius res, angle]]

v = callJava["frink.graphics.VoxelArray", "strokeZ", [polygon, round[0 in res], round[1 in res], 1.5 mm res, true]]

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

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


View or download VoxelStrokePolygonTest.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 19100 days, 8 hours, 13 minutes ago.