Core Concepts
Before we dive into individual commands, it helps to understand how the studio reads an .fsl file. Think of the interpreter as a very patient cutter: it reads a line, applies the change, then moves to the next line without skipping ahead or rearranging anything.
How the studio reads your file
- The file is a simple list of statements. Each line happens in the order you write it.
- Blank lines and comments are ignored, so feel free to add notes with
//whenever it helps future-you.
Here is a tiny program you can paste into the studio to see the order in action:
set name "Order Matters"
P 0 @ 45 : cp x 4
G 0 @ 90 : size
C 0 @ 28 : mp(G, P) +girdle // Depends on G and P already existing
T 0 @ 0 : 0.2
The crown (C) tier uses a meet point created by the P and G, so the line with the crown tier must come after P and G.
What the studio remembers for you
While it reads the file, the studio tracks a handful of details in the background:
- Stone metadata –
set name,set ri, and friends. - Machine setup –
set gear 96 cwsticks until you change it, so every later facet uses the same gear and rotation. - Variables –
letstatements store numbers or points that you can reuse later. Edge helpers always return two endpoints, so you must bind them with destructuring (let a, b = edge(...)) rather than assigning the whole edge to a single name. - Last side and symmetry – if you cut a pavilion facet (
down) and the next line starts with a tier name, the interpreter keeps usingdownunless you say otherwise. Same story for symmetry; once you typex8, the next command will still be single unless you repeat the modifier.
If anything goes wrong—maybe a meet point cannot be found—the interpreter stops right there and the diagnostics panel shows the line and message.
Crown versus pavilion (and everything between)
downfacets belong to the pavilion and tilt toward negative Z.upfacets belong to the crown and tilt toward positive Z.- Tier labels are just names.
P1,C1,Break, andStarall work.
Symmetry in plain language
Add xN after a facet command to copy it around the stone every 360 / N degrees. Use xxN when you want mirrored N-fold symmetry (each pair becomes a left/right mirror). The count must be a positive whole number:
P3 12 @ 38.2 : 0.16 x 8 // eight pavilion mains
G1 0 @ 90 : size x 16 // sixteen girdle facets (90° so size works)
There is no need to specify the symmetry for the next tier if there is no change in symmetry.
Numbers, points, and edges
Most expressions boil down to one of three value types:
- Number – plain angles, depths, or calculations like
deg2rad(32). - Point – created with helpers such as
mp(P1),gp(G1), orfred(...). These mark locations in space. - Edge – less common but handy for advanced macros, created with
edge(tier:index, tier:index).
You can store numbers or points in variables. Edge helpers always produce two points, so capture them with a destructuring assignment instead of storing the edge itself:
let table = mp(P1)
let safety = 0.05
let first, second = edge(P1:0, P1:12)
C2 up 0 @ 29.5 : table + girdle x16
Variables live until the end of the file (or until a macro finishes, if you are inside one).
With these basics in mind, continue to Statements to see every command you can type.