Scripting API
Sprue helix
from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing
The helix tree is how casters print a whole chain’s worth of links in one flask: a conical base, a vertical trunk, and a helical feed wire climbing around it with copies of the link hung along the wire on short connectors. One tree, one investment, dozens of identical links. This is the ArtisanSprueHelix tool, headless.
Usage
ids = manufacturing.SprueHelix(linkMeshId, basePoint = (0,0,0), copies = 0,
wireDiameter = 0, trunkDiameter = 0,
connectorLength = 0, connectorDiameter = 0,
clearanceMargin = 0) # -> [ids]
| Parameter | Default | Meaning |
|---|---|---|
linkMeshId | required | The chain link to multiply - a mesh, or a SubD (meshed at default density) |
basePoint | (0,0,0) | Where the tree stands on the plate; the origin is the tool’s starting position |
copies | 125 | How many copies of the link to hang along the wire |
wireDiameter | 3 | Diameter of the helical feed wire, mm |
trunkDiameter | 10 | Diameter of the central trunk, mm |
connectorLength | 3.25 | Length of the short connector between wire and link, mm |
connectorDiameter | 1.5 | Diameter of that connector, mm |
clearanceMargin | 0 | Extra clearance added between neighbouring copies, mm |
Every numeric parameter follows the house 0-keeps-default convention: 0 means “use the tool’s default”. For clearanceMargin the default is 0 - no extra clearance - so there is nothing to distinguish; a positive value simply pushes the copies further apart. There is no -1 sentinel.
You do not set the helix’s turns, diameter or trunk length: like the tool’s Generate button, the layout is auto-sized so the requested copies fit without collisions, with one support arm added per turn. The link is chained along its longest bounding-box axis, the same orientation the tool picks initially. This is a long operation - the auto-sizing searches for a collision-free layout - so expect Rhino to stay busy for larger trees.
SprueHelix returns the ids of all the meshes it adds: the tree itself plus one mesh per copy. Everything is baked to the last user layer with the wax colour, exactly like the tool’s Accept; the source link object is left untouched in the document. This is a licensed mutation and needs an active document - it throws “No active document.” otherwise. A linkMeshId that is neither a mesh nor a SubD raises ArgumentException “Object {id} is not a mesh.”. When the requested copies cannot be laid out, the call raises InvalidOperationException carrying the layout search’s own problem description; a geometry failure raises “Sprue helix computation failed with the given parameters.” (with the underlying detail appended in brackets when there is one) and nothing is added. Wrap the call in a Transaction so the whole tree undoes in one step.