Scripting API
Sprue curve
from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing
The perimeter-frame sprue surrounds the piece with a closed pipe running round its silhouette, tapered connectors reaching in from the frame to the piece, and a horizontal injection post on the front — the layout used for flat or delicate pieces where a single feed would distort the casting, and the standard feed system for vulcanised mould injection. This is the ArtisanSprueCurve tool run headless.
Usage
ids = manufacturing.SprueCurve(meshId, curveId = Guid.Empty,
offset = 0, smooth = -1, width = 0, height = 0,
connectionCount = 0, connectionDiameter = 0,
symmetry = None) # -> [ids]
| Parameter | Default | Meaning |
|---|---|---|
meshId | required | The piece mesh |
curveId | automatic silhouette | Optional closed perimeter curve; Guid.Empty or omitted builds the frame from the piece’s silhouette |
offset | 2 | How far the automatic silhouette is pushed outwards, mm |
smooth | -1 = default (8) | Smoothing iterations on the silhouette; 0 is a real value (no smoothing), so the sentinel is -1 |
width | 1 | Frame section width, mm |
height | 1 | Frame section height, mm |
connectionCount | 4 | Number of connectors from the frame to the piece |
connectionDiameter | 0.3 | Connector diameter at the piece, mm |
symmetry | "None" | Connector layout symmetry: "None", "X", "Y" or "Quad", case-insensitive |
The other numeric parameters follow the 0-keeps-default convention; this tool has no saved defaults, so 0 always means the factory default. The injection post is not parameterised — it keeps the tool defaults (external diameter 3 mm, length 5 mm). Connectors are seeded equidistant along the frame, exactly the tool’s initial layout before any manual edit.
It returns an IReadOnlyList<Guid> — the ids of the meshes added: frame, injection post and connectors, baked to the last user layer with the wax preview colour, same as the tool’s Accept. The piece mesh (and the perimeter curve, if given) are only read, never modified.
It needs a valid licence and fails with “No active document.” when there is none. If meshId does not resolve to a mesh it raises “Object {id} is not a mesh.”; a curveId that is not a curve raises “Object {id} is not a curve.”; an unrecognised symmetry raises “Unknown symmetry ’…’.”; if the automatic silhouette cannot be traced it raises “Could not build the silhouette perimeter. Pass a perimeter curve instead.”; and if the frame cannot be built it raises “Sprue curve computation failed. Check the perimeter is a closed curve around the piece.”, or “Sprue curve computation failed with the given parameters (…).” when the kernel rejects the numbers. Nothing is added on failure. Wrap the call in a Transaction to get one-step undo.