Scripting API
Martini
from ArtisanPlugin.Scripting import MartiniApi as martini
The martini setting: four prongs that taper down from the girdle and meet in a point below the stone, so the head reads as a cone - the classic stud and solitaire mount that keeps as little metal as possible under the gem. RhinoArtisan adds an optional upper rail wrapping the girdle and two lateral side gems, and bakes the result as the ArtisanMartini tool does.
A martini is built around a mother gem and stays its parametric child.
Create
m = martini.Create(gemId, prongHeight = 0, prongDiameterTop = 0,
prongDiameterBottom = 0, upperRail = None,
sideGems = None, sideGemSize = 0) # -> IMartini
| Parameter | Default | Meaning |
|---|---|---|
gemId | - | The mother gem |
prongHeight | 0 -> 5.40 | Height of the prongs, mm |
prongDiameterTop | 0 -> 1.30 | Prong diameter at the girdle, mm |
prongDiameterBottom | 0 -> 1.30 | Prong diameter where the prongs meet, mm |
upperRail | None -> enabled | The rail running under the girdle |
sideGems | None -> enabled | The two lateral side stones |
sideGemSize | 0 -> 1.40 | Size of those side stones, mm |
Millimetres throughout; 0 (or None on the booleans) keeps the tool default, or your saved Martini defaults when you have some.
Not every stone qualifies. Create rejects TRIANGLE and COFFIN gems - every other shape is martini-friendly. A gemId that is not a gem is rejected too.
As in the panel, the prongs’ face-tangent behaviour is seeded from the gem’s symmetry, the upper rail keeps a circular cross-section unless its mode is custom (height locked to width), and the side-gem drill cutter is always applied. The metal is baked as IIBrep objects; the two side gems go onto the secondary gems layer.
Edit
Create, Find and All return an IMartini handle. It exposes two setters; each regenerates the martini in place, keeping its Guid and undo intact:
| Setter | What it changes |
|---|---|
SetProngHeight(h) | Prong height in mm. Must be > 0 |
SetSideGemSize(s) | Size of the lateral side gems in mm. Must be > 0 |
The rest is read-only after creation: ProngHeight, ProngDiameterTop, ProngDiameterBottom, UpperRailEnabled, SideGemsEnabled, SideGemSize, the gem properties GemShape, GemMaterial and GemCaratWeight, and the structural Id, MotherGemId, LayerName, Position, Move(vector) and Delete(). Toggling the rail or the side gems means recreating the martini.
from ArtisanPlugin.Scripting import MartiniApi as martini, Transaction
m = martini.Selected()[0]
with Transaction.Begin("Lower martini"):
m.SetProngHeight(4.8)
m.SetSideGemSize(1.2)
Queries
All(), Find(id), Count(), Selected(), ByLayer(name), ForGem(gemId).