Slots
A slot is an input of a component that takes another component. The component with the slot, the
host, places copies of whatever is in the slot. LatticeFill has one slot, item: it places a
copy of the component in it at every site of its lattice. With the built-in Pillar in the slot
the fill draws round pillars; with a component you drew it draws your shape.
Only built-in and script components have slots. A component you draw cannot declare one, but it can be put into the slot of a component it places.
What fits a slot
A slot says what a component needs to go into it:
- The fill it sits in.
itemtakes components that sit in a void, such as Pillar or a component of your own whose Sits in is Void. - The parameters the host sets. A slot may set some parameters on every copy. A component
fits only if it has a parameter of each of those names, of a kind that takes the value.
itemsets none. - The pins the host connects to. A slot may name pins its host runs channels to. A component
fits only if it exposes them.
itemnames none.
A component also cannot go into a slot of a component it places itself, since that would place the component inside its own copies.
The slot group
Select the placed host. In the inspector, each slot is a group after the host’s own args,
headed with the slot’s name and the component in it: item · Diamond.
- The default. A slot you have not filled holds its default component, and its header says so: item · Pillar · default. The rows under it show the default component’s values, dimmed.
- Component. The first row picks the component in the slot. The list holds only the components that fit, your own components first and then each library’s, and ends with one line counting the rest, such as 12 components don’t fit: they sit in material. Hover that line to see every reason. Picking a component keeps each value the new one also has, and the status bar says how many values were dropped. One undo brings back the old component and all its values.
- ↗ opens the component in the slot, when it is one of yours. Edit it there, and every copy follows when you go back.
- The component’s
args. Under the picker sit theargsrows of the component in the slot, which work as a placed component’s do. A ticked row overrides the value, and its ƒ takes an expression over the parameters of the component you are editing, not the host’s. Ticking a row on a slot at its default fills the slot with its default component and that value, in one undo step. - Set by the host. A parameter the host sets on every copy has no checkbox. It reads set by and the host’s name.
- ↺ on the header empties the slot, so it holds its default again, and clears its values.
A component in a slot may have slots of its own. Their groups sit inside its group.
The host’s layout
The host lays out its copies from its own parameters alone. It does not know the size or shape of
the component in its slot. If the copies touch, cross the wall of their chamber or leave a gap
below the process’s minimum, the copies are still drawn and the
Problems list reports each fault. On a LatticeFill, size the
lattice to the pillar: pitch less the pillar’s width is the gap between neighbours, and
wall_clearance less half its width the gap to the wall.
A broken slot
A slot breaks when a library edit makes the component in it unusable: the component is renamed or removed, a value you set is for a parameter it no longer has, or it no longer fits the slot. The host still draws, and its copies are left out. The slot’s group shows a warning row naming the problem, with Reset slot to default, which empties the slot. The same problem is a row of the Problems list, and selecting the row offers the same button in the inspector.
See also
- Components, parameters & pins, for LatticeFill and Pillar.
- Script components, for writing a component that has slots.
- Inspector.