Statements & Settings
An .fsl file is simply a sequence of statements read from top to bottom. Usually you write one statement per line, though you can split a long command across several lines for readability or put two short statements on the same line separated by a semicolon (;).
Besides Facet Cut Commands, here are the statements you can use in your recipes.
1. Project & Machine Settings
Configuration lines set the stone's title, optical properties, and faceting machine setup. You normally place them at the very top of the file:
| Setting | Example | What It Controls |
|---|---|---|
name | name = "Portuguese Oval" | The title shown in the 3D viewer, file list, and printed cutting sheet. |
ri | ri = 1.76 | Refractive index of the gem material (used by the raytracer, Analyzer, and Optimizer). Can also be read back inside math formulas! |
gear | gear = 96 | Tooth count of the index gear (64, 80, 96, 120, etc.) for all cuts below this line. |
cw | cw = true | Index gear numbering direction (true for clockwise, false for counter-clockwise). |
color | color = "#ffd166" | Material tint color (hex string) for raytraced previews. |
absorption | absorption = 1.2 | How strongly the material absorbs light in renders (1.0 is natural; higher values deepen the color). |
cube | cube = 5.0 | Resets the starting uncut blank to a cube of edge length 5.0 (handy for tall cuts like briolettes that need extra starting rough). |
notes | notes = "Cut in pale amethyst" | General notes saved with the design metadata. |
tags | tags = "oval, brilliant" | Keywords to help you filter and search your designs in the Open... dialog. |
2. Variables & Lists (=)
Store any number, 3D point, or list in a variable using = so you can reuse it on later lines. (Unlike JavaScript or Lua, you don't write let, const, or local in FSL—just write the name directly.)
name = "Variables & Arrays"
gear = 96
// Store a single number or optimizable angle
main_angle = 41.8 +/- 1.0
// Store a list (array) of numbers using square brackets (0-indexed)
crown_angles = [35.0, 28.5, 21.0]
P1 0 @ main_angle : cp() x8
G1 0 @ 90 : size x8
C1 0 @ crown_angles[0] : mp(P1, G1) + girdle x8
C2 0 @ crown_angles[1] : gp() x8
-- lua script
name("Variables & Arrays")
gear(96)
local girdle = Point(0, 0, 0.04)
local main_angle = val(41.8, 1.0)
local crown_angles = {35.0, 28.5, 21.0}
TierAP("P1", 0, main_angle, cp(), "x8")
TierAD("G1", 0, 90, 1.0, "x8")
TierAP("C1", 0, crown_angles[1], mp("P1", "G1"):add(girdle), "x8")
TierAP("C2", 0, crown_angles[2], gp(), "x8")
Zero-Based Indexing: In FSL, lists start at index
0(crown_angles[0]is35.0). In Lua, tables follow Lua's standard convention and start at1(crown_angles[1]).
3. show() — Drop Visual Markers in 3D
When you are building a complex stone—especially one that uses edge interpolation (ep) or crossover lines (fred)—it helps enormously to see the points you are aiming at.
show(point, color?) places a bright colored dot in the 3D viewer at that exact 3D coordinate:
name = "Visualizing Points & Edges"
gear = 96
P1 0 @ 41.8 : cp() x8
// Highlight the culet meetpoint in red
show(mp(P1), "red")
// Grab the edge between adjacent facets P1:0 and P1:12 and mark both ends
e = edge(P1:0, P1:12)
show(e[0], "orange")
show(e[1], "cyan")
-- lua script
name("Visualizing Points & Edges")
gear(96)
TierAP("P1", 0, 41.8, cp(), "x8")
show(mp("P1"), "red")
local e = edge("P1:0", "P1:12")
show(e[1], "orange")
show(e[2], "cyan")
You can pass standard color names ("red", "cyan", "orange", "green", "purple", "white", "yellow") or any hex color string like "#ffe422".
4. print() — Log Numbers & Coordinates
Use print(...) whenever you want to inspect a calculated angle, check the 3D coordinates of a meetpoint, or verify stone() metrics. Output appears directly in the console panel alongside the playground (and in the browser console in the studio):
name = "Print Demo"
gear = 96
P1 0 @ 41.8 : 0.18 x8
print("Culet point:", mp(P1))
print("Midpoint of P1 edge:", ep(edge(P1:0, P1:12), 0.5))
-- lua script
name("Print Demo")
gear(96)
TierAD("P1", 0, 41.8, 0.18, "x8")
print("Culet point:", mp("P1"))
print("Midpoint of P1 edge:", ep(edge("P1:0", "P1:12"), 0.5))
5. return; — Pause Execution Partway Through a Stone
When you are debugging a 15-tier stone and something goes wrong around tier 7, you don't have to comment out the bottom half of your file.
Just drop return; on a line by itself. ProFacet stops executing right at that line and shows the partially cut stone as it stands at that moment, while leaving all the lines below return; untouched until you're ready for them:
name = "Return Demo"
P1 0 @ 41.8 : 0.18 x8
return;
// Everything below return; is paused for now:
P2 0 @ 43.0 : 0.18 x8
-- lua script
name("Return Demo")
TierAD("P1", 0, 41.8, 0.18, "x8")
do return end
TierAD("P2", 0, 43.0, 0.18, "x8")