Draw a sphere: Difference between revisions

Frink
(Frink)
Line 2,555:
200 draw</lang>
 
=={{header|Frink}}==
This program not only draws a sphere and renders it onscreen projected on the x,y, and z axes but also outputs a .stl file for 3-D printing. Frink has [https://frinklang.org/3d/frink/graphics/package-summary.html built-in routines for 3-D modeling].
<lang frink>res = 254 / in
v = callJava["frink.graphics.VoxelArray", "makeSphere", [1/2 inch res]]
 
v.projectX[undef].show["X"]
v.projectY[undef].show["Y"]
v.projectZ[undef].show["Z"]
 
filename = "sphere.stl"
print["Writing $filename..."]
w = new Writer[filename]
w.println[v.toSTLFormat["sphere", 1/(res mm)]]
w.close[]
println["done."]</lang>
 
=={{header|FutureBasic}}==
494

edits