Skip to content

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 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 = ...)
VariantShape
CreateClosedFull circle at the finger size
CreateOpenCircle with a gap, for open/adjustable rings
CreateBypassCrossed-ends rail (the “toi et moi” style), with angle, X/Y offsets and tangent control
CreateShapeCircle 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")
ParameterDefaultMeaning
curveId, textThe curve to follow and what to write (required)
height1.5Letter height, mm
thickness0Extrusion depth; 0 = outline curves only, > 0 = solid letters
spacing0.5Letter spacing
font"Bienchen"Any installed font name
rotation, moveZ0Letter rotation (degrees) and lift above the curve (mm)
horizontalAlign"LEFT"LEFT, CENTER, RIGHT, JUSTIFY
verticalAlign"CENTER"TOP, CENTER, BOTTOM
flipHorizontal, flipVerticalfalseMirroring

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)
ParameterMeaning
thresholdThe black/white cut (0–1, exclusive): lower keeps more dark detail
ignoreAreaDrops speckles up to that many pixels
cornerThresholdControls sharp vs. round corners
toleranceThe 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.