Scripting API
Sprue inner branches
from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing
An inner-branches sprue feeds a ring from the inside: a central post rises through the finger hole and thin branches reach out from it to the inner wall, one per contact point. Feeding from the inside keeps the sprue marks off the visible outer surface, so clean-up after casting stays on the bore where a polishing mandrel reaches anyway. This is the ArtisanSprueInnerBranches tool, headless - its two interactive picks become explicit arguments.
Usage
ids = manufacturing.SprueInnerBranches(meshId, basePoint, contactPoints,
height = 0, topDiameter = 0,
branchContactDiameter = 0,
symmetry = 0) # -> [ids]
| Parameter | Default | Meaning |
|---|---|---|
meshId | required | The closed mesh to sprue - a mesh only, not a SubD |
basePoint | required | Where the central post stands; the tool seeds it under the mesh centre at Z = 0 |
contactPoints | required | Points on the mesh where the branches attach - at least one |
height | mesh centre | Height of the central post, mm; 0 = the mesh bounding-box centre height, what the tool seeds on selection |
topDiameter | 3 | Diameter at the top of the post, mm |
branchContactDiameter | 0.8 | Diameter of each branch where it meets the mesh, mm |
symmetry | 0 | 0 = none, 1 = vertical mirror (X), 2 = horizontal mirror (Y), 3 = quad - the tool’s Symmetry combo, which multiplies each contact point |
The numeric parameters follow the house 0-keeps-default convention, with one twist: height = 0 does not mean a fixed tool number but the mesh’s own bounding-box centre height, recomputed per mesh - and when you have saved defaults for this tool in the panel, the diameters start from those rather than the factory values. symmetry = 0 is a meaningful zero (no symmetry, the default), not a keep-default sentinel. There is no -1 sentinel.
SprueInnerBranches returns the ids of the sprue meshes it adds, baked to the last user layer with the wax colour, like the tool’s Accept; the ring mesh itself is left untouched. This is a licensed mutation and needs an active document - it throws “No active document.” otherwise. Passing a non-mesh raises ArgumentException “Object {id} is not a mesh.”; an empty contactPoints raises “At least one contact point on the mesh is required.”; a symmetry outside 0-3 raises “Symmetry must be 0 (none), 1 (vertical), 2 (horizontal) or 3 (quad).”. When the geometry cannot be built, the call raises InvalidOperationException “Sprue computation failed. Check that the contact points lie on the mesh.” (or “Sprue inner branches computation failed with the given parameters.” with the underlying detail when the kernel rejects the numbers) and nothing is added. Wrap the call in a Transaction so the whole sprue undoes in one step.