signetRing.frink

Download or view signetRing.frink in plain text format


/** This creates a signet ring for 3-D printing.
*/


r = 254 * 2/in

innerCircumference = size10ring
innerDiameter = innerCircumference / pi
innerRadius = innerDiameter / 2

ringThickness = 2 mm
ringWidth = 5 mm

centerRadius = innerRadius + (ringThickness / 2)
outerRadius = centerRadius + (ringThickness / 2)

signetThickness = 3 mm
signetDiameter = 15 mm
signetRadius = signetDiameter / 2
embossDepth = 2 mm

// Make the ring
v = callJava["frink.graphics.VoxelArray", "makeSupertoroid", [centerRadius r, ringThickness/2 r, ringThickness/2 r, ringWidth/2 r, .5, 1]]

v1 = v.rotate[0,0,0,1,0,0,90 deg]

signet = callJava["frink.graphics.VoxelArray", "makeTaperedCylinder", [0,0,centerRadius r,0,0,(centerRadius+signetThickness) r, signetRadius r, signetRadius r]]

img = new image["https://frinklang.org/frinksamp/tnslogo.png"]
pixelTool = newJava["frink.graphics.VoxelArray", [0,2,0,2,0,2,true]]

emboss = signet.planarEmboss[img, 0, .6 mm r, .89 signetDiameter r, .89 signetDiameter r, 0, 250, 0, 0, embossDepth r, 0, pixelTool, 0, 0, 0]

v = v1.union[signet]
v.remove[emboss]

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

outfile = "signetRing.obj"
w = new Writer[outfile]
print["Writing $outfile..."]
w.println[v.toObjFormat["signetRing", 1/(r mm)]]
w.close[]
println["done."]


Download or view signetRing.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 20143 days, 11 hours, 57 minutes ago.