Skip to content

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
ParameterDefaultMeaning
x0 -> tool default 4Stone width, mm
y0 -> tool default 8Stone length, mm
z0 -> tool default 2Dome height, mm
shapeNone -> RoundOutline: Round, Oval, Rectangular, Heart, Pear, Marquise, Diamond
typeNone -> CabochonCut: Cabochon, FlatTopSingleBevel, FlatTopDoubleBevel, BuffTopSingleBevel, BuffTopDoubleBevel
angle0 -> tool default 15Bevel angle, degrees
girdleHeight0 -> tool default 1Height of the straight girdle band below the dome, mm
planeomitted -> world XYThe 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:

MemberMeaning
ShapeThe CabochonShape name it was built with
CutTypeThe CabochonType name
SizeX, SizeY, SizeZWidth, length and dome height, mm
GirdleHeightGirdle 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.