Scripting API
Cabochon
from ArtisanPlugin.Scripting import CabochonApi as cabochon
A cabochon is a stone cut with a smooth domed top and no facets - the traditional cut for opal, turquoise, moonstone and star sapphire, and for any material whose colour or chatoyancy matters more than its sparkle. The tool builds the dome from a shape outline, a cut type and a girdle step, exactly as the ArtisanCabochon panel does.
Unlike the bezel, peghead or basket, CabochonApi is not wrapped around a mother gem: it is a standalone stone creator. It makes its own stone at the point you give it, so there is no gemId argument, no ForGem query, and MotherGemId on the handle is always empty.
Create
c = cabochon.Create(x = 0, y = 0, z = 0, shape = None, type = None,
angle = 0, girdleHeight = 0, plane = None) # -> ICabochon
| Parameter | Default | Meaning |
|---|---|---|
x | 0 -> tool default 4 | Stone width, mm |
y | 0 -> tool default 8 | Stone length, mm |
z | 0 -> tool default 2 | Dome height, mm |
shape | None -> Round | Outline: Round, Oval, Rectangular, Heart, Pear, Marquise, Diamond |
type | None -> Cabochon | Cut: Cabochon, FlatTopSingleBevel, FlatTopDoubleBevel, BuffTopSingleBevel, BuffTopDoubleBevel |
angle | 0 -> tool default 15 | Bevel angle, degrees |
girdleHeight | 0 -> tool default 1 | Height of the straight girdle band below the dome, mm |
plane | omitted -> world XY | The plane the stone is built on, as in the panel’s “add on plane” |
All dimensions are millimetres, and 0 keeps the tool default for that parameter - or the user’s saved cabochon defaults when they have any, since Create starts from the same model the ArtisanCabochon command does. shape and type are matched case-insensitively.
The stone is baked as a single cabochon object, gets the cabochon material and lands on the last gems layer, just like the panel’s add button. There are no metal children.
Create throws ArgumentException for an unknown shape or type name, and InvalidOperationException when the geometry fails to compute or the licence is invalid.
Edit
The cabochon is read-only after creation: the parametric engine has no regenerate step for cabochons, so ICabochon carries no setters. To change a dimension, create a new cabochon and Delete() the old one.
What the handle exposes for reading:
| Member | Meaning |
|---|---|
Shape | The CabochonShape name it was built with |
CutType | The CabochonType name |
SizeX, SizeY, SizeZ | Width, length and dome height, mm |
GirdleHeight | Girdle band height, mm |
Plus the shared Id, MotherGemId (always empty), ObjectType, LayerName, Position, Move(vector) and Delete(). Those two mutations belong inside a Transaction so the edit lands as one undo step.
from ArtisanPlugin.Scripting import CabochonApi as cabochon, Transaction
from Rhino.Geometry import Vector3d
c = cabochon.Create(x = 6, y = 10, z = 3, shape = "Oval", type = "BuffTopSingleBevel")
with Transaction.Begin("Shift cabochon"):
c.Move(Vector3d(0, 0, 1.5))
Queries
All(), Find(id), Count(), Selected(), ByLayer(name).
There is no ForGem - a cabochon has no mother gem.