Core Concepts
Before we look at individual commands, it helps to understand how ProFacet reads an .fsl file.
Think of the interpreter as a patient cutter sitting at a faceting machine. It reads the first line, makes that cut on the stone, and only then moves on to the second line. It never skips ahead or rearranges your steps.
1. Cut Order Matters
Because each line happens in order, you must cut a tier before you can aim a later tier at its corners.
Click ▶ Run Code on this tiny four-tier stone to see how each line builds on the one before it:
name = "Order Matters"
size = 1.0
gear = 96
girdle = Vector(0, 0, 0.03)
P1 0 @ 45 : cp() x4
G1 0 @ 90 : size
C1 0 @ 28 : mp(P1, G1) + girdle // Uses the corner created by P1 and G1
T 0 @ 0 : 0.2 x1
-- lua script
name("Order Matters")
gear(96)
local girdle = Point(0, 0, 0.04)
TierAP("P1", 0, 45, cp(), "x4")
TierAD("G1", 0, 90, 1.0)
TierAP("C1", 0, 28, mp("P1", "G1"):add(girdle))
TierAD("T", 0, 0, 0.2, "x1")
Here, the crown tier C1 aims at mp(P1, G1)—the meetpoint where P1 and G1 touch. That only works because P1 and G1 were cut on the lines above it. If you moved C1 to the top of the file, the interpreter would stop and tell you that P1 and G1 don't exist yet.
Blank lines and comments starting with // are ignored, so feel free to leave yourself notes anywhere in the file.
2. What the Machine Remembers Between Lines
To save you from typing the same settings over and over, the virtual faceting machine remembers a few things as it walks down your file:
- Stone & machine setup: Once you set
gear = 96orri = 1.76, every tier below uses that gear and refractive index unless you change it later. - Which side of the stone is active (
upvs.down):- Any tier whose name starts with
Pautomatically cuts on the pavilion (down, tilting toward negative Z). - Any tier whose name starts with
CorTautomatically cuts on the crown (up, tilting toward positive Z). - Any other name (like
G1orBreak) simply stays on whichever side the previous line used, unless you writeupordownexplicitly (e.g.Break up 0 @ 42 : gp()).
- Any tier whose name starts with
- The last symmetry (
xN/xxN): Look back atG1 0 @ 90 : sizein the example above. Notice it doesn't havex4at the end! BecauseP1right above it usedx4,G1automatically reusesx4symmetry. Whenever you want a new symmetry, just write it at the end of the line (likex1on the tableT).
3. Symmetry in Plain Language
Adding xN at the end of a cut line rotates that facet around the stone N times, spacing the cuts evenly every 360 / N degrees.
Adding xN m M treats your base index IDX as the mirror axis (center) and applies a ±M delta index (axis - M and axis + M) at each of the N symmetry stops, producing 2 × N mirrored facets.
Adding xxN is the zero-axis mirror shorthand: here IDX is an actual cut tooth, repeated N times around the stone and reflected across the 0-axis (gear - index, i.e., 0 ± IDX). Therefore, P2 3 @ 41.0 : gp() xx8 is 100% equivalent to P2 0 @ 41.0 : gp() x8 m 3 (whereas P2 3 @ 41.0 : gp() x8 m 3 centers the mirror axis at 3 and cuts 3 ± 3 = 0, 6!).
P1 12 @ 38.2 : 0.16 x8 // 8 facets evenly spaced around the stone
P2 0 @ 41.0 : gp() x8 m 3 // 8 mirrored pairs around axis 0 with ±3 delta (3, 9, 15, 21...)
P2 3 @ 41.0 : gp() xx8 // 100% equivalent zero-axis shorthand for 0 @ 41.0 : gp() x8 m 3
-- lua script
TierAD("P1", 12, 38.2, 0.16, "x8") -- 8 facets evenly spaced
TierAP("P2", 0, 41.0, gp(), "x8 m 3") -- 8 mirrored pairs around axis 0 with ±3 delta
TierAP("P2", 3, 41.0, gp(), "xx8") -- 100% equivalent zero-axis shorthand
What if a cut isn't symmetrical at all? You can bypass symmetry on any line by listing the exact gear teeth inside square brackets:
P1 [3, 27, 44] @ 90 : size
When you give an explicit bracket list like [3, 27, 44], ProFacet cuts those exact three teeth in order and ignores symmetry (so you don't write xN on that line). If that line also uses a helper like mp() or gp(), ProFacet aims the helper at the first tooth in your list (3).
4. Numbers, Points, and Edges
When you store values in variables or pass them into helpers, you are almost always working with one of three things:
- Numbers: Plain angles, depths, or math results like
41.8orMath.toDegrees(0.5). - Points: 3D locations on or around the stone, returned by helpers like
cp(),gp(),mp(P1), or created directly withPoint(x, y, z). - Edges: The shared line segment between two adjacent facets, returned by
edge(TierA:IndexA, TierB:IndexB). An edge is simply a two-element list[startPoint, endPoint]containing the two corners at the ends of that crease.
Here is a quick example that grabs both a meetpoint and an edge, prints their 3D coordinates to the output panel, and uses the point to cut a crown tier:
name = "Edge Example"
size = 1.0
gear = 96
girdle = Vector(0, 0, 0.03)
P1 0 @ 45 : cp() x8
pt1 = mp(P1)
print("Meetpoint:", pt1)
e = edge(P1:0, P1:12)
first = e[0]
second = e[1]
print("Edge endpoints:", first, second)
C2 up 0 @ 29.5 : pt1 + girdle x16
-- lua script
name("Edge Example")
gear(96)
local girdle = Point(0, 0, 0.04)
TierAP("P1", 0, 45, cp(), "x8")
local pt1 = mp("P1")
print("Meetpoint:", pt1)
local e = edge("P1:1", "P1:13")
local first = e[1]
local second = e[2]
print("Edge endpoints:", first, second)
TierAP("C2", 0, 29.5, pt1:add(girdle), "x16", {side = "up"})
With those basics in hand, let's look closely at how a facet cut works in Facets & Tiers.