Skip to content

Scripting API

Sprue spiral

from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing

The spiral is the flat cousin of the helix tree: the same chain-printing idea, but the feed wire is coiled flat, standing on legs above the plate, and each link hangs from a single vertical connector below the wire. It keeps the whole batch low and shallow - useful when the flask or the printer’s build height is the constraint. This is the ArtisanSprueSpiral tool, headless.

Usage

ids = manufacturing.SprueSpiral(linkMeshId, basePoint = (0,0,0), copies = 0,
                                maxDiameter = 0, wireDiameter = 0,
                                connectorLength = 0, clearanceMargin = 0,
                                showBase = False)      # -> [ids]
ParameterDefaultMeaning
linkMeshIdrequiredThe chain link to multiply - a mesh, or a SubD (meshed at default density)
basePoint(0,0,0)Centre of the spiral on the plate; the origin is the tool’s starting position
copies60How many copies of the link to hang from the wire
maxDiameter100The largest diameter the spiral may grow to, mm
wireDiameter3Diameter of the spiral feed wire, mm
connectorLength3.25Length of the vertical connector between wire and link, mm
clearanceMargin0Extra clearance added between neighbouring copies, mm
showBaseFalseTrue adds the honeycomb base plate under the legs (off by default, like the tool)

Every numeric parameter follows the house 0-keeps-default convention: 0 means “use the tool’s default”. For clearanceMargin the default is 0, so a positive value simply spaces the copies out further. There is no -1 sentinel.

As with the helix, you do not set the turns, the turn spacing or the inner eye: like the tool’s Generate button, the layout is auto-sized so the requested copies fit within maxDiameter, with the link hung from its Y axis - the tool’s starting orientation. This is a long operation; the auto-sizing searches for a collision-free layout. A layout can be feasible yet carry a warning - typically that fewer copies than requested fit cleanly - in which case the call still succeeds and the warning is printed to the Rhino command line, prefixed Sprue Spiral:, exactly as the tool surfaces it.

SprueSpiral returns the ids of all the meshes it adds: the spiral itself plus one mesh per copy. Everything is baked to the last user layer with the wax colour, like the tool’s Accept; the source link object is left untouched. 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 no layout is feasible, the call raises InvalidOperationException carrying the layout search’s own problem description; a geometry failure raises “Sprue spiral 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 spiral undoes in one step.