Skip to content

Scripting API

Sprue cluster tree

from ArtisanPlugin.Scripting import ManufacturingApi as manufacturing

The cluster tree is the high-density alternative to the radial tree: a cylindrical cage woven from two crossed families of helical wires, forming rhombic cells, with an anchor node at every crossing. Casters use it to pack many small pieces — charms, findings, light rings — onto one flask, each held by a short wire connector. This is the ArtisanSprueClusterTree tool run headless.

Usage

ids = manufacturing.SprueClusterTree(meshIds = None, basePoint = Point3d.Origin,
                                     copiesPerMesh = 0, diameter = 0,
                                     height = 0, cellsAround = 0,
                                     rows = 0, wireDiameter = 0)      # -> [ids]
ParameterDefaultMeaning
meshIdscurrent selectionThe model meshes to distribute; None or empty uses whatever is selected
basePointworld originWhere the base sits
copiesPerMesh0 = automaticCopies of each mesh; 0 fills the free nodes, the tool’s automatic mode
diameter65Cylinder diameter, mm
height90Cylinder height, mm
cellsAround8Rhombic cells around the circumference
rows7Rows of cells up the cylinder
wireDiameter3Helix wire diameter, mm

Numeric parameters follow the 0-keeps-default convention, but like the radial tree this tool has no saved defaults0 always means the factory default. copiesPerMesh = 0 is a meaningful zero: automatic fill.

Copies are placed on the crossing nodes in round-robin, each anchored by the bottom-centre of its bounding box (the tool’s default pick) and held by a mini-connector of diameter 1 mm and length 6 mm — those two are fixed, not parameters.

It returns an IReadOnlyList<Guid> — the ids of all the meshes added: grid, base, connectors and every model copy, in bake order, not grouped. The first object routes through the layer service to the last user layer and the rest follow it; the structure takes the wax preview colour and the model copies keep their own model colour. The source meshes are only read, never modified. This is a long operation.

It needs a valid licence and fails with “No active document.” when there is none. If nothing resolves to a mesh it raises “No meshes to work with: select (or pass) at least one mesh.”; if the cage cannot be built it raises “Sprue cluster tree computation failed.”, or “Sprue cluster tree computation failed with the given parameters (…).” when the kernel rejects the numbers, and nothing is added. Wrap the call in a Transaction to get one-step undo.