Scripting API
Curves & Text
from ArtisanPlugin.Scripting import RingCurveApi as ringcurve, TextOnCurveApi as text
from ArtisanPlugin.Scripting import RasterToVectorApi as trace
All dimensions are millimeters; angles are degrees. Creation methods return plain Rhino object Guids, so the results compose directly with rhinoscriptsyntax and serve as input to other Artisan tools.
Ring curveThe parametric ring rail: closed, open, bypass or shaped.
Text on curveFlow text along an existing curve — outlines or solid letters.
Raster to vectorTrace a bitmap image into curves.
Ring curve
RingCurveApi creates the parametric ring rail curve — the foundation that curve shanks and gems-on-curve build on. Four variants, one per curve type in the ring-curve tool:
ringcurve.CreateClosed(fingerDiameter = 0, plane = Plane.WorldXY, profile = None)
ringcurve.CreateOpen(openingLength = 5, fingerDiameter = 0, plane = ..., profile = ...)
ringcurve.CreateBypass(openingLength = 14, angle = 0, offsetX = 2, offsetY = 2,
tangent = 1, fingerDiameter = 0, plane = ..., profile = ...)
ringcurve.CreateShape(shapeType = "ROUND", diameter = 5, width = 6, height = 4,
offset = 1, moveInZ = 2, openingLength = 14,
fingerDiameter = 0, plane = ..., profile = ...)
| Variant | Shape |
|---|---|
CreateClosed | Full circle at the finger size |
CreateOpen | Circle with a gap, for open/adjustable rings |
CreateBypass | Crossed-ends rail (the “toi et moi” style), with angle, X/Y offsets and tangent control |
CreateShape | Circle blended with a top shape: shapeType is "ROUND" (uses diameter) or "ELLIPSE" (uses width × height), plus offset, Z-lift and opening length |
In all of them, fingerDiameter = 0 means “use the document’s configured finger size”, an omitted plane means Plane.WorldXY, and profile picks a named RING_PROFILE asset (default asset when omitted).
All four are licensed mutations and return the Guid of the new curve. Overriding fingerDiameter never changes the document’s finger-size setting.
Text on curve
TextOnCurveApi flows text along an existing curve — the text-on-curve tool, headless:
ids = text.Create(curveId, "Forever", height = 1.5, thickness = 0.4, font = "Bienchen")
| Parameter | Default | Meaning |
|---|---|---|
curveId, text | — | The curve to follow and what to write (required) |
height | 1.5 | Letter height, mm |
thickness | 0 | Extrusion depth; 0 = outline curves only, > 0 = solid letters |
spacing | 0.5 | Letter spacing |
font | "Bienchen" | Any installed font name |
rotation, moveZ | 0 | Letter rotation (degrees) and lift above the curve (mm) |
horizontalAlign | "LEFT" | LEFT, CENTER, RIGHT, JUSTIFY |
verticalAlign | "CENTER" | TOP, CENTER, BOTTOM |
flipHorizontal, flipVertical | false | Mirroring |
Returns the Guids of the created objects. Solid letters land on the primary metal layer (ready to boolean and print); outline curves land on the primary user layer. The output is plain geometry — it does not stay linked to the curve.
Raster to vector
RasterToVectorApi traces a bitmap image into curves with the embedded Potrace engine — the raster-to-vector tool without the panel:
ids = trace.Create(path, threshold = 0.51, ignoreArea = 2,
cornerThreshold = 1.0, tolerance = 0.2, targetWidth = 12)
| Parameter | Meaning |
|---|---|
threshold | The black/white cut (0–1, exclusive): lower keeps more dark detail |
ignoreArea | Drops speckles up to that many pixels |
cornerThreshold | Controls sharp vs. round corners |
tolerance | The curve-optimization budget |
targetWidth | > 0 scales the result so its total width is exactly that many model units — the easy way to fit a motif to, say, 12 mm. 0 keeps the tool’s native sizing |
Returns the Guids of the traced curves, placed on the world XY plane starting at the origin, on the primary user layer.