Point Helper Reference
Point helpers turn the geometry you have already cut into reusable coordinates. They power angle + point cuts, point-pair slices, macros, and optimizer targets. Most helpers resolve to a 3D point once the referenced tiers exist; pt(x, y, z) is the outlier that simply returns the literal coordinate you supply.
Literal point (pt)
pt(x, y, z) returns an explicit point without relying on any cut geometry. Coordinates share the same frame as other helpers: origin at the stone center, +Z toward the crown.
Note:
ptshould be used sparingly, as it is absolute and not sensitive to the geometry of the cut. One good use is in macros: it is used in the$Oval()system macro.
set name "Literal Anchor"
let anchor = pt(0, 0, 1.1)
show anchor orange
P1 0 @ 42 : anchor
Center point (cp)
cp sits on the stone's centre axis. It always returns (0, 0, 1) when the active side is the crown (up) and (0, 0, -1) when the active side is the pavilion (down).
set name "Center Anchors"
// Mark the culet to check alignment
show cp blue
P1 0 @ 41 : cp x8
Girdle points (gp)
gp scans the vertical girdle facets and returns the vertex that sits “in front” of the requested index/angle. Inside a cut command it borrows the current index/angle automatically; elsewhere you must supply at(index, angle) (angle optional) so the helper knows where to search.
set name "Girdle Pickup"
set gear 96
P1 0 @ 45 : cp x8
G1 0 @ 90 : size x16
C1 6 @ 34 : MP(P1,G1) + girdle x16
show gp at (0) cyan
show gp at (24) orange
For uneven girdle lines, there is some extra logic that decides if a point can be a true girdle point. If this fails for some reason, the user can use the mp() function, explained next.
Meet points (mp)
mp searches for the intersection of tiers you name. Pass one or more tiers to include, prefix a tier with ! to exclude it, and ProFacet finds the point that is the first to satisfy the filters. Think of an initial cutting plane far from the stone, that moves towards the center until a valid point is found.
mp respects the current index and angle context, when used inside a cut command. When used outside of a cut command, you can add at (explained later) to jump to a specific tooth and perform the meetpoint search at that tooth.
Matching tiers vs. explicit indices
Think of mp as a facet filter: every positive tier you list must participate in the actual meet, while negated tiers must be absent. There are often several equivalent ways to describe the same vertex.
// A few common patterns
mp(C1) // single-tier meet
mp(C1, G1) // multiple tiers
mp(C1, C1) // requires C1 to be part of the meet at least twice
mp(C1, G1, !C2) // exclude an unwanted tier
mp(C1:12, C2:16) // insist on specific cut indices
mp(C1) at (3, 45.0) // explicit tooth/angle override
Symmetry means those filters can match multiple physical points. That’s usually fine inside a facet command because the base index and angle narrow the choice. Outside of a cut—show mp(C1) or let helper = mp(G1)—add an at(index, angle) clause to keep things deterministic:
Relying on explicit indices like mp(C1:12, C2:16) ties the design to a particular gear/symmetry combination, so prefer tier filters without indices when you can.
Examples
set name "Meetpoint Examples"
set gear 96
P1 3 @ 41.0 : cp xx 8
G1 3 @ 90.0 : size
P2 0 @ 39.8 : gp
C1 3 @ 50.0 : mp(P1, P2) +girdle
C2 0 @ 38.0 : gp
C3 6 @ 26.0 : mp(C1)
T 0 @ 0 : mp(C2) x1
show mp(C1) green
show mp(C2) blue
show mp(C1, G1) purple
show mp(C1, C1, !C2) orange
show mp(P1, P2, P2) red
Edge references (edge)
edge returns the shared edge between two previously cut facets. You pass tier/index pairs (edge(C1:0, C1:6)), and the helper returns both endpoints so other helpers can work with them.
C1 0 @ 32 : 0.08 x6
let _, edge_pt = edge(C1:0, C1:16)
show edge_pt
Use edge only after both referenced facets exist; otherwise the interpreter raises an error telling you which tier/index is missing.
Edge interpolation (ep)
ep walks along an edge or between two arbitrary points. Supply either edge(...) plus a factor between 0.0 and 1.0, or two point helpers and the factor. Zero sticks to the first point, one sticks to the second, and any other value interpolates in between.
set name "Edge Interpolation"
C1 0 @ 32 : 0.08 x16
G1 0 @ 90: size
let start_p, end_p = edge(C1:0, C1:6)
let mid_edge = ep(start_p, end_p, 0.5)
show start_p red
show end_p blue
show mid_edge purple
ep(mp(...), mp(...), 0.25) is equally valid when you want a point partway between two meetpoints.
Projected crossover (fred)
In GemCad, holding down the Shift key limits the movement of the selected point so that it aligns vertically or horizontally with the previous point. 'fred' is a generalization of this idea. It solves more complex intersections—ideal when we need a reference that depends on multiple moving parts. Conceptually it projects two line segments onto the XY plane, finds their intersection, then lifts that XY intersection back onto one of the original segments. The helper was named in honor of Fred Van Sant—one of the most inventive gem designers the lapidary world has ever seen—whose many masterpieces lean on these projections in one way or another.
fred(p1, p2, p3, p4)intersects the XY projections ofp1–p2withp3–p4and returns the point that lives along thep3–p4segment.fred(p1, p2, edge(F1, F2))is shorthand that uses the shared edge betweenF1andF2for the second segment.
This helper is crucial for elaborate parametrized patterns such as Honeycomb FVS or Round Trichecker-1, where you have to drop points onto the exact crossover of two projected paths.
Projected reference (prz)
prz drops an existing point onto either a reference line or an existing facet. It mirrors the projection math used by fred, but instead of intersecting two lines it projects the target straight to the chosen guide and returns the corresponding 3D point.
-
prz(p_target, line_start, line_end)works with any combination of point helpers or variables that resolve to points and projects in the XY plane (so the projected point can fall outside the original segment if your geometry demands it). -
prz(p_target, facet_ref)uses a facet reference such asP1:12and projects onto the live plane of that facet. The facet must already exist in the current geometry—the interpreter will raise a clear error if it has been cut away or is degenerate. When you build tiers withconcat(...)you can reuse that same helper inside this reference (prz(mp(C1), concat(C, i) : 0)), so loops that name tiers dynamically remain easy to target later.When projecting onto a facet the interpreter keeps the target’s original XY coordinates and only recomputes Z as long as the facet’s normal isn’t nearly vertical. For very steep facets we fallback to the perpendicular planar projection so the result still lies on the surface.
Index and Angle override (at)
at is a trailing clause—not a separate function—that pins a helper to a specific index and optional angle: mp(P1) at (12, 39.4). The first number is the index (integer), and the second is the angle override. If you omit the angle (mp(P1) at (12)), the helper keeps the current angle context.
set name "Attachments"
set gear 96
P1 0 @ 41.5 : 0.18 x8
let tooth_12 = mp(P1) at (12, 41.5)
show tooth_12 green
C1 0 @ 32.2 : tooth_12 + girdle x8
Fred and prz Example
We are going to create a simple 3x3 checkerboard, practically identical to "Checkpoint (Tabled)" designed by Tom Herbst.
So the question is how to cut C2. We will do this by drawing lines, find out the intersection point and project this onto a facet. We will select four points, creating two (imaginary) lines:
...
show gp at (84) blue
show gp at (12) blue
show gp at (4) orange
show gp at (44) orange
In this case all four points are on the girdle, so we can easily select them using the at() clause, where we specify a close-enough index.
It should be clear that our desired meetpoint, when looked at from above, is where the line between the blue dots intersects with the line between the orange dots. This can be achieved by:
...
let f1 = fred(gp at (84),
gp at (12),
gp at (4),
gp at (44))
show f1 red
Now, since all blue and orange points are on the same height, the red one will be on that height as well. We need to project that red dot onto the facet above. For this we can use prz().
set ri 1.54
set gear 96
set name "Fred Demo"
P1 0 @ [41.2434] : cp x 12
G1 0 @ 90.00 : size
C1 8 @ [46.196] : mp(P1) +girdle xx 4
show gp at (84) blue
show gp at (12) blue
show gp at (4) orange
show gp at (44) orange
let f1 = fred(gp at(12), gp at (84),
gp at (4), gp at(44))
let f2 = prz(f1, C1:8)
show f2 green
Note how the green point is on facet C1 and exactly on the lines between the blue and orange dots (when looked at from above). We can now cut C2 and C3.
...
C2 0 :gp : f2
C3 12 :gp : f2
For the remaining facets we will need to compute one additional point, similar to the green one.
set ri 1.54
set gear 96
set name "Fred Demo"
P1 0 @ [41.2434] : cp x 12
G1 0 @ 90.00 : 1.0480
C1 8 @ [46.196] : mp(P1) +girdle xx 4
show gp at (84) blue
show gp at (12) blue
show gp at (4) orange
show gp at (44) orange
let f1 = fred(gp at(12), gp at (84),
gp at (4), gp at(44))
let f2 = prz(f1, C1:8)
show f2 green
C2 0 :gp : f2
C3 12 :gp : f2
show gp at (20) purple
show gp at (76) purple
let f3 = fred(gp at(20), gp at (76), gp at (4), gp at(44))
let f4 = prz(f3, C3:12)
show f4 magenta
C4 0 : f2 : f4
T 0 @ 0 :f4