Skip to content

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
ParameterDefaultMeaning
gemId-The mother gem
prongHeight0 -> 5.40Height of the prongs, mm
prongDiameterTop0 -> 1.30Prong diameter at the girdle, mm
prongDiameterBottom0 -> 1.30Prong diameter where the prongs meet, mm
upperRailNone -> enabledThe rail running under the girdle
sideGemsNone -> enabledThe two lateral side stones
sideGemSize0 -> 1.40Size 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:

SetterWhat 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).