21: v = callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[depth r]]]
91: // Calculate the voxel resolution that we printed the original at
124: v = callJava["frink.graphics.VoxelArray", "strokeZ", [wallPoly, floorThickness r , (wallHeight+floorThickness) r, wallThickness/2 r, true]]
127: f = callJava["frink.graphics.VoxelArray", "extrudeZ", [floorPoly, 0, floorThickness r]]
131: f = callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[floorThickness r], round[(floorThickness + emboss) r]]]
136: lw = callJava["frink.graphics.VoxelArray", "strokeZ", [lidWall, 0, lidWallHeight r, wallThickness/2 r, true]]
139: top = callJava["frink.graphics.VoxelArray", "extrudeZ", [lid, round[lidWallHeight r], round[(lidWallHeight + lidThickness) r]]]
24: v = callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[depth r]]]
93: // Calculate the voxel resolution that we printed the original at
126: v = callJava["frink.graphics.VoxelArray", "strokeZ", [wallPoly, floorThickness r , (wallHeight+floorThickness) r, wallThickness/2 r, true]]
129: f = callJava["frink.graphics.VoxelArray", "extrudeZ", [floorPoly, 0, floorThickness r]]
133: f = callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[floorThickness r], round[(floorThickness + emboss) r]]]
138: lw = callJava["frink.graphics.VoxelArray", "strokeZ", [lidWall, 0, lidWallHeight r, wallThickness/2 r, true]]
141: top = callJava["frink.graphics.VoxelArray", "extrudeZ", [lid, round[lidWallHeight r], round[(lidWallHeight + lidThickness) r]]]
18: v = callJava["frink.graphics.VoxelArray", "extrudeTapered", [pl, 0,0,0, 0,0,3 in r,cx,cy, 0.5, 1, 180 deg]]
19: v1 = callJava["frink.graphics.VoxelArray", "extrudeTapered", [pl, 0,0,0, 0,0,-3 in r,cx,cy, 0.5, 1, 180 deg]]
25: hub = callJava["frink.graphics.VoxelArray", "makeCylinder", [280/2, (hubHeight + 1.4 mm) r, 0, 280/2, (-hubHeight/2 - 3 mm) r, 0, hubRadius r]]
29: shaft = callJava["frink.graphics.VoxelArray", "makeCylinder", [280/2, 2 hubHeight r, 0, 280/2, -2 hubHeight r, 0, shaftRadius r]]
23: v = callJava["frink.graphics.VoxelArray", "extrudeTaperedRotated", [pl, 0,0,0, 0,0, 4.5 in r,cx,cy, 0.5, 1, rootAngle, tipAngle]]
24: v1 = callJava["frink.graphics.VoxelArray", "extrudeTaperedRotated", [pl, 0,0,0, 0,0,-4.5 in r,cx,cy, 0.5, 1, rootAngle, tipAngle]]
30: hub = callJava["frink.graphics.VoxelArray", "makeCylinder", [278/2, (hubHeight + 0 mm) r, 0, 278/2, (-hubHeight/2 - 3 mm) r, 0, hubRadius r]]
34: shaft = callJava["frink.graphics.VoxelArray", "makeCylinder", [278/2, 2 hubHeight r, 0, 278/2, -2 hubHeight r, 0, shaftRadius r]]
9: ring = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, ringHeight res, ringOuterRadius res]]
10: ring2 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, ringHeight res, (ringOuterRadius-ringThickness) res]]
25: text = callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[-textDepth res], round[textDepth res]]]
31: tick = callJava["frink.graphics.VoxelArray", "makeCappedCylinder", [x res, y res, ringHeight res, x res, y res, (ringHeight-tickHeight) res, tickRadius res]]
33: tick = callJava["frink.graphics.VoxelArray", "makeCappedCylinder", [x res, y res, 0, x res, y res, tickHeight res, tickRadius res]]
4: res = 254/inch // Resolution of model in voxels/inch
8: c = length res / sqrt[3] // Scaling factor to make voxels come out right
37: return callJava["frink.graphics.VoxelArray", "makeTaperedCappedCylinder", [0,0,0, tipx, tipy, tipz, baseRadius, 0]]
5: c1 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, 100, 787/2]]
8: cin = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 10, 0, 0, 100, 770/2]]
12: ch = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, 100, 50]]
16: c2 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, 100, 40]]
4: // The resolution of the object in voxels/length.
16: c1 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, height r, outerDiam/2 r]]
19: cin = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, topThickness r, 0, 0, height r, innerDiam/2 r]]
52: baseOuter = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0, baseHeight res, thickRadiusOuter res, thinRadiusOuter res]]
53: baseInner = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0, baseHeight res, thickRadiusInner res, thinRadiusInner res]]
57: ringOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,baseHeight res,0,0, (baseHeight+0.15 mm) res, thinRadiusOuter res]]
58: ringInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,baseHeight res,0,0, (baseHeight + 0.15 mm) res, thinRadiusInner res]]
95: topOuter = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [rc1, rc2, thinRadiusOuter res, topRadiusOuter res]]
96: topInner = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [rc1, rc2, thinRadiusInner res, topRadiusInner res]]
117: c1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [minX, minY+4.5 mm res, maxZ-4.5 mm res,maxX, minY+4.5 mm res, maxZ-4.5 mm res, 5.8 mm/2 res, 3.0 mm/2 res]]
120: c2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [minX, maxY-4.5 mm res, minZ+4.5 mm res, maxX, maxY-4.5 mm res, minZ+4.5 mm res, 5.8 mm/2 res, 3.0 mm/2 res]]
28: v = callJava["frink.graphics.VoxelArray", "extrudeZTapered", [polygon, 0 in res, length res, outerRadius/outerRadius, tipRadius/outerRadius]]
9: c1 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, h r, outerDiam r]]
12: cin = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 10, 0, 0, h r, innerDiam r]]
10: //v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,h/2 res,0,0,-h/2 res, r res]]
13: v = callJava["frink.graphics.VoxelArray", "cube", [-r res, r res,
32: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
10: v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,h/2 res,0,0,-h/2 res, r res]]
13: //v = callJava["frink.graphics.VoxelArray", "cube", [-r res, r res,
31: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
3: rotation of VoxelArrays, tapered cylinders, rounded cubes,
85: /** Extrude text and create a VoxelArray of it. */
95: return callJava["frink.graphics.VoxelArray", "extrudeZ", [img, depth]]
101: return callJava["frink.graphics.VoxelArray", "makeRoundedCube", [xmin, xmax, ymin, ymax, zmin, zmax, radius]]
107: return callJava["frink.graphics.VoxelArray", "makeCylinder", [x1, y1, z1,
115: return callJava["frink.graphics.VoxelArray", "makeTaperedCylinder",
38: return callJava["frink.graphics.VoxelArray", "makeCylinder", [x1, y1, z1,
46: return callJava["frink.graphics.VoxelArray", "makeTaperedCylinder",
5: // The resolution of the object in voxels/length.
22: holder = callJava["frink.graphics.VoxelArray", "construct", [-holderWidth/2 r, holderWidth/2 r, -(outerDiam/2 + holderDepth) r, 0, (height-holderHeight) r, (height) r, true]]
26: channel = callJava["frink.graphics.VoxelArray", "construct", [-holderWidth/2 r, holderWidth/2 r, -(outerDiam/2 + 3.1 mm) r, (outerDiam/2) r, (height-holderHeight) r, (height-2 mm) r, true]]
31: c1 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, height r, outerDiam/2 r]]
35: cin = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, topThickness r, 0, 0, height r, innerDiam/2 r]]
7: v = callJava["frink.graphics.VoxelArray", "makeSuperellipsoid", [.5 in r, .5 in r, .5 in r, .3, 1]]
29: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
2: /** This tests extruding an image or text to a 3-D VoxelArray for 3-D
11: v = callJava["frink.graphics.VoxelArray", "extrudeZ", [img,20]]
27: base = callJava["frink.graphics.VoxelArray", "construct", [minX, maxX, minY, maxY, minZ, minZ+10, true]]
2: /** This tests the "flood fill" routines in VoxelArray which can be used to
10: outer = callJava["frink.graphics.VoxelArray", "makeSphere", [(innerDiam/2 + thickness) res]]
11: inner = callJava["frink.graphics.VoxelArray", "makeSphere", [innerDiam/2 res]]
24: println["Volume is $vol voxels"]
18: v = newJava["frink.graphics.VoxelArray", [w1,h1,h1,true]]
16: // This sets the resolution of the final object in voxels.
23: v = newJava["frink.graphics.VoxelArray", [w1,h1,h1,true]]
21: v = newJava["frink.graphics.VoxelArray", [w1,h1,h1,true]]
18: v = newJava["frink.graphics.VoxelArray", [w1,h1,h1,true]]
25: voxels in the .obj file larger.
50: // Change the doublings to vary the number of voxels. This is the number
54: // Be warned that increasing the doublings by 1 makes 8 times as many voxels!
56: r = 2^doublings // Number of voxels on each axis
100: v = callJava["frink.graphics.VoxelArray", "construct", [xmin sx, xmax sx, ymin sy, ymax sy, zmin sz, zmax sz, false]]
105: // To convert from voxel coordinate v to original coordinate x,
109: // println["Center of mass (in voxel coords): " + v.centerOfMass[].toString[]]
22: disc = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0, 0, 0, 0, 0, discHeight res, discDiamBase/2 res, discDiamTop/2 res]]
24: cupOuter = callJava["frink.graphics.VoxelArray" , "makeSpheroid", [outerSpheroidDiam/2 res, outerSpheroidDiam/2 res, outerSpheroidHeight/2 res]]
27: cupInner = callJava["frink.graphics.VoxelArray" , "makeSpheroid", [innerSpheroidDiam/2 res, innerSpheroidDiam/2 res, innerSpheroidHeight/2 res]]
38: screwHole = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, screwHeight res, screwDiam/2 res]]
20: bottom = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,-bottomHeight res, bottomDiamOuter/2 res]]
22: outerSides = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,topHeight res, bottomDiamOuter/2 res, topDiamOuter/2 res]]
23: innerSides = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,topHeight res, bottomDiamInner/2 res, topDiamInner/2 res]]
8: v = callJava["frink.graphics.VoxelArray", "makeSphere", [s]]
41: /** This draws a "line" (a capped cylinder) into the specified VoxelArray */
15: // The resolution of the object in voxels/length.
44: /** Extrude text and create a VoxelArray of it. */
52: return callJava["frink.graphics.VoxelArray", "extrudeZ", [img, depth]]
59: c1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0, 0, 0, 0, 0, chamferHeight, radius-chamferHeight, radius]]
62: c2 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, chamferHeight, 0, 0, height-chamferHeight, radius]]
65: c3 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0, 0, height-chamferHeight, 0, 0, height, radius, radius-chamferHeight]]
6: // Resolution of the model in voxels/inch
34: outerSphere= callJava["frink.graphics.VoxelArray", "makeSphere", [r res]]
37: sphere1 = callJava["frink.graphics.VoxelArray", "makeSphere", [r1 res]]
40: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
52: outerCylinder = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, (r + .3 cm) res, 0, 0, (r - .3 cm) res, (innerCylinderDiam/2 + cylinderThickness) res]]
61: innerCylinder = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, (r + .3 cm) res, 0, 0, (r - .3 cm) res, (innerCylinderDiam/2) res]]
16: res = 254 / in // Resolution of the model in voxels/inch (0.1 mm)
65: v = callJava["frink.graphics.VoxelArray", "construct", [-r res, r res, -r res, r res, -r res, r res, false]]
68: tool = newJava["frink.graphics.VoxelArray", [1,1,1,true]]
16: res = 254 / in // Resolution of the model in voxels/inch (0.1 mm)
61: v = callJava["frink.graphics.VoxelArray", "construct", [-r res, r res, -r res, r res, -r res, r res, false]]
65: baseSphere = callJava["frink.graphics.VoxelArray", "makeSphere", [baseRadius]]
70: tool = newJava["frink.graphics.VoxelArray", [1,1,1,true]]
11: c1 = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, 0, 0, 0, h r, outerRadius r]]
14: cin = callJava["frink.graphics.VoxelArray", "makeCylinder", [0, 0, lidThickness r, 0, 0, h r, innerRadius r]]
18: v = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [r res, rx res, ry res, rz res, 1, 1]]
21: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
2: /** This program tests the VoxelArray.paintAlong hull method for 3D printing.
15: v = callJava["frink.graphics.VoxelArray", "extrudeZTapered", [polygon, 0 in res, 1 in res, 1, .5]]
21: t1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,th res, tr res, 0]]
22: t2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,-th res, tr res, 0]]
26: sphereTool = callJava["frink.graphics.VoxelArray", "makeSphere", [.1 in res]]
32: t1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,flatHeight/2 res,0,0,(th+flatHeight/2) res, tr res, 0]]
33: t2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,-flatHeight/2 res,0,0,-(th + flatHeight/2) res, tr res, 0]]
34: flat = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,flatHeight/2 res,0,0,-flatHeight/2 res, tr res]]
29: instantiated into a 3-D model using VoxelArray.paintAlongPath
69: // Check to see if the voxel didn't move or if it moved by more than
11: pixelTool = newJava["frink.graphics.VoxelArray", [0,1,0,1,0,1,true]]
14: sphereTool = callJava["frink.graphics.VoxelArray", "makeSphere", [.025 in res]]
19: t1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,th res, tr res, 0]]
20: t2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,-th res, tr res, 0]]
27: t1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,flatHeight/2 res,0,0,(th+flatHeight/2) res, tr res, 0]]
28: t2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,-flatHeight/2 res,0,0,-(th + flatHeight/2) res, tr res, 0]]
29: flat = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,flatHeight/2 res,0,0,-flatHeight/2 res, tr res]]
37: v = callJava["frink.graphics.VoxelArray", "paintAlongPath", [p, doubleConeWithFlatSidesTool, 0,0,0]]
5: r = 254/in // Voxel resolution
38: //tool = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0, 0,0,wallHeight r, br r, tr r]]
39: //v = callJava["frink.graphics.VoxelArray", "strokeZ", [poly, tool, 0,0,wallHeight/2 r, true]]
42: v = callJava["frink.graphics.VoxelArray", "strokeZTapered", [poly, 0, wallHeight r, br r, tr r, true]]
10: //v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,h/2 res,0,0,-h/2 res, r res]]
14: v = callJava["frink.graphics.VoxelArray", "cube", [-r/2 res, r/2 res,
20: v = callJava["frink.graphics.VoxelArray", "makeSphere", [r/2 res]]
36: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
25: voxels in the .obj file larger.
50: // Change the doublings to vary the number of voxels. This is the number
54: // Be warned that increasing the doublings by 1 makes 8 times as many voxels!
60: /** Plots the function (specified as a string) and returns a VoxelArray. */
93: numVoxels = 2^doublings
96: sx = numVoxels / (xmax-xmin)
97: sy = numVoxels / (ymax-ymin)
98: sz = numVoxels / (zmax-zmin)
100: v = callJava["frink.graphics.VoxelArray", "construct", [xmin sx, xmax sx, ymin sy, ymax sy, zmin sz, zmax sz, false]]
108: /** Shows an already-rendered VoxelArray on the screen. */
119: // To convert from voxel coordinate v to original coordinate x,
123: // println["Center of mass (in voxel coords): " + v.centerOfMass[].toString[]]
141: /** Write a rendered VoxelArray to a Wavefront .obj file. */
222: /** Sets the voxel resolution for printing in either
247: /** Sets the number of doublings. The number of voxels rendered will be
17: v = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], true]]
20: c1 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
25: c2 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
11: v = callJava["frink.graphics.VoxelArray", "makeSuperellipsoid", [r res, r res, 1.3 r res, 1, 1]]
17: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
4: v = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [20, 150, -20, 140, -30, 110, 50]]
6: /** Makes a single-pixel tool for testing. This returns a VoxelArray with a
10: return newJava["frink.graphics.VoxelArray", [0,1,0,1,0,1,true]]
13: /** Makes a spherical tool. This returns a VoxelArray with a sphere of the
17: return callJava["frink.graphics.VoxelArray", "makeSphere", [radius res]]
21: This returns a VoxelArray with a double cone of the
26: t1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,halfHeight res, radius res, 0]]
27: t2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,0,0,0,-halfHeight res, radius res, 0]]
32: This returns a VoxelArray with a double cone of the
37: t1 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,flatHeight/2 res,0,0,(coneHeight+flatHeight/2) res, radius res, 0]]
38: t2 = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,-flatHeight/2 res,0,0,-(coneHeight + flatHeight/2) res, radius res, 0]]
39: flat = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,flatHeight/2 res,0,0,-flatHeight/2 res, radius res]]
47: instantiated into a 3-D model using VoxelArray.paintAlongPath
61: v = callJava["frink.graphics.VoxelArray", "paintAlongPath", [path, tool, 0,0,0]]
35: malePipeOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(turns pitch + pilot) res, minorRadius res]]
36: malePipeInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(turns pitch + pilot) res, (minorRadius-2.4 mm) res]]
41: femalePipeOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(turns pitch) res, (femaleRadius + 2.4 mm) res]]
42: femalePipeInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(turns pitch) res, femaleRadius res]]
41: malePipeOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(3 turns pitch + pilot) res, minorRadius res]]
42: malePipeInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(3 turns pitch + pilot) res, (minorRadius-2.4 mm) res]]
51: femalePipeOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(3 turns pitch) res, (femaleRadius + 2.4 mm) res]]
52: femalePipeInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,-1/4 in res,0,0,(3 turns pitch) res, femaleRadius res]]
21: malePipeInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,1/4 in res, minorRadius res]]
22: malePipeOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,1/4 in res, (minorRadius+2.4 mm) res]]
23: v = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [centerRadius r, ringThickness/2 r, ringThickness/2 r, ringWidth/2 r, .5, 1]]
27: signet = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,centerRadius r,0,0,(centerRadius+signetThickness) r, signetRadius r, signetRadius r]]
30: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
10: // v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,h/2 res,0,0,-h/2 res, r res]]
13: /*v = callJava["frink.graphics.VoxelArray", "cube", [-r/2 res, r/2 res,
19: v = callJava["frink.graphics.VoxelArray", "makeSphere", [r res]]
35: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
10: //v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,h/2 res,0,0,-h/2 res, r res]]
13: /*v = callJava["frink.graphics.VoxelArray", "cube", [-r res, r res,
18: v = callJava["frink.graphics.VoxelArray", "makeSphere", [r res]]
31: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
19: v = callJava["frink.graphics.VoxelArray", "construct" , [0 mm r, 10 mm r, -armDepth r, armDepth r, 0 mm r, height r, true]]
22: a1 = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [9 mm r, (9 mm + armLength) r, gap/2 r, armDepth r, 0 mm r, height r, 1 mm r]]
23: a2 = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [9 mm r, (9 mm + armLength) r, -armDepth r, -gap/2 r, 0 mm r, height r, 1 mm r]]
28: r1out = callJava["frink.graphics.VoxelArray", "makeCylinder", [rcx r, rcy r, 0 mm r, rcx r, rcy r, height r, ((1/2 ring1Diam) + ringThickness) r]]
29: r1in = callJava["frink.graphics.VoxelArray", "makeCylinder", [rcx r, rcy r, 0 mm r, rcx r, rcy r, height r, (1/2 ring1Diam) r]]
36: r2out = callJava["frink.graphics.VoxelArray", "makeCylinder", [rcx r, rcy r, 0 mm r, rcx r, rcy r, height r, ((1/2 ring2Diam) + ringThickness) r]]
37: r2in = callJava["frink.graphics.VoxelArray", "makeCylinder", [rcx r, rcy r, 0 mm r, rcx r, rcy r, height r, (1/2 ring2Diam) r]]
63: /** Extrude text along a plane and create a VoxelArray of it. */
70: return callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[depth]]]
20: v = callJava["frink.graphics.VoxelArray", "construct" , [0 mm r, 10 mm r, -armDepth r, armDepth r, 0 mm r, height r, true]]
23: a1 = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [9 mm r, (9 mm + armLength) r, gap/2 r, armDepth r, 0 mm r, height r, 1 mm r]]
24: a2 = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [9 mm r, (9 mm + armLength) r, -armDepth r, -gap/2 r, 0 mm r, height r, 1 mm r]]
27: r1 = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [(1/2 ring1Diam + 1/2 ringThickness) r, 1/2 ringThickness r, 1/2 ringThickness r, 1.001 height/2 r, .5, 1]]
34: r2 = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [(1/2 ring2Diam + 1/2 ringThickness) r, 1/2 ringThickness r, 1/2 ringThickness r, 1.001 height/2 r, .5, 1]]
62: /** Extrude text along a plane and create a VoxelArray of it. */
69: return callJava["frink.graphics.VoxelArray", "extrudeZ", [img, round[depth]]]
3: frink.graphics.VoxelArray.makeSupertoroid )
9: https://frinklang.org/3d/ (especially the VoxelArray class)
30: outer = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [r, rx, ry, rz, eSmall, eLarge]]
19: // numbers to feed to the dimensionless integer VoxelArray class
22: v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,z0 r, 0,0,z1 r, stopDiam/2 r]]
25: v = v.union[callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,z0 r, 0,0,2 in r, cylDiam/2 r]]]
17: v = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], true]]
20: c1 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
25: c2 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
17: v = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], true]]
20: c1 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
25: c2 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
17: v = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], true]]
20: c1 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
25: c2 = newJava["frink.graphics.VoxelArray", [round[-width res/2], round[width res], round[-depth res/2], round[depth res], 0, round[height res], false]]
13: outer = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,height res, outerDiam / 2 res]]
15: inner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,height res, innerDiam / 2 res]]
17: cap = callJava["frink.graphics.VoxelArray", "makeSphere", [outerDiam / 2 res]]
18: outer = callJava["frink.graphics.VoxelArray", "construct", [-thickness r, (width+thickness) r, -thickness r, (depth+thickness) r, 0 mm r, height r, true]]
21: inner = callJava["frink.graphics.VoxelArray", "construct", [0 mm r, width r, 0 mm r, depth r, 0 mm r, height r, true]]
32: outer = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [-thickness r, (width+thickness) r, -thickness r, (depth+thickness) r, -thickness r, (height+thickness) r, (radius + thickness) r]]
35: inner = callJava["frink.graphics.VoxelArray", "makeRoundedCube", [0 mm r, width r, 0 mm r, depth r, 0 mm r, height r, radius r]]
7: v = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [1 in r, .2 in r, .2 in r, .4 in r, .5, 1]]
10: v = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,h/2 res,0,0,-h/2 res, r res]]
19: pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]
32: baseOuter = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,baseHeight res, (baseRadius+baseThickness) res]]
33: baseInner = callJava["frink.graphics.VoxelArray", "makeCylinder", [0,0,0,0,0,baseHeight res, (baseRadius) res]]
37: taperOuter = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,baseHeight res,0,0,(baseHeight+taperLength) res, (baseRadius+baseThickness) res, baseThickness res]]
38: taperInner = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,baseHeight res,0,0,(baseHeight+taperLength) res, baseRadius res, 0]]
45: nozzleOuter = callJava["frink.graphics.VoxelArray", "construct", [(-nozzleOuterX/2) res, (nozzleOuterX/2) res, (-nozzleOuterY/2) res, (nozzleOuterY/2) res, bottom res,top res,true]]
46: nozzleInner = callJava["frink.graphics.VoxelArray", "construct", [(-nozzleInnerX/2) res, (nozzleInnerX/2) res, (-nozzleInnerY/2) res, (nozzleInnerY/2) res, bottom res,top res,true]]
// This is a simple test to make a VoxelArray and output it as a Wavefront
v = newJava["frink.graphics.VoxelArray", [9,9,9,true]]
v = callJava["frink.graphics.VoxelArray", "extrudeZ", [polygon, round[0 in res], round[1 in res]]]
filename = "VoxelPolygonTest.obj"
v = callJava["frink.graphics.VoxelArray", "makeSphere", [1 in res]]
v = v.union[callJava["frink.graphics.VoxelArray", "extrudeTapered", [polygon, x res in, y res in, z res in, 2x res in, 2y res in, 2z res in, 0, 0, 0, 1, 0 deg]]]
filename = "VoxelRotatedPolygonTest.obj"
/** This program tests the rotation of a VoxelArray. */
v = callJava["frink.graphics.VoxelArray", "construct", [-10, 10, -20, 20, -30, 30, true]]
filename = "VoxelRotateTest.obj"
// Extrude the bitmap as a one-voxel-thick layer.
v = callJava["frink.graphics.VoxelArray", "extrudeZ", [img,1]]
base = callJava["frink.graphics.VoxelArray", "construct", [minX, maxX, minY, maxY, minZ-15, minZ, true]]
v = callJava["frink.graphics.VoxelArray", "strokeZ", [polygon, round[0 in res], round[1 in res], 1.5 mm res, true]]
filename = "VoxelStrokePolygonTest.obj"
v = callJava["frink.graphics.VoxelArray", "extrudeZTapered", [polygon, 0 in res, 1 in res, 1, .5]]
filename = "VoxelTaperedPolygonTest.obj"
v = callJava["frink.graphics.VoxelArray", "extrudeZTapered", [polygon, 0 in res, 1 in res, 1, 0]]
filename = "VoxelXYZRotateTest.obj"
Alan Eliasen was born 20217 days, 15 hours, 59 minutes ago.
Back to Frink Sample Programs