# Function: assemble()

[**lifecycle-kit**](https://jonbogaty.com/lifecycle-kit/api/readme/index.md)

***

[lifecycle-kit](https://jonbogaty.com/lifecycle-kit/api/readme/index.md) / [assemblage](https://jonbogaty.com/lifecycle-kit/api/assemblage/readme/index.md) / assemble


# Function: assemble() {#function-assemble}


> **assemble**(`shapes`, `light?`): readonly [`AssembledPart`](https://jonbogaty.com/lifecycle-kit/api/assemblage/interfaces/assembledpart/index.md)[]

Defined in: [assemblage/assemble.ts:115](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/assemblage/assemble.ts#L115)

Place each shape in depth, light it, and let the near parts shade the far.

Returned back to front, so a consumer draws in order and the near parts land
on top without needing a z-buffer.

Repetitions of the same part are separated by their tag index, which is the
reason `PartTag` carries one. Six legs from a `pair` rule are not six copies
in one plane — the near ones occlude the far ones, and that occlusion is
most of what makes a creature look three-dimensional at this scale.

Occlusion is computed after every part has a depth, because a caster has to
know it is in front before it can cast. That ordering is the reason this is
two passes rather than one map.


## Parameters {#parameters}



### shapes {#shapes}


readonly [`Shape`](https://jonbogaty.com/lifecycle-kit/api/forms/type-aliases/shape/index.md)[]


### light? {#light}


[`Light`](https://jonbogaty.com/lifecycle-kit/api/assemblage/interfaces/light/index.md) = `DEFAULT_LIGHT`


## Returns {#returns}


readonly [`AssembledPart`](https://jonbogaty.com/lifecycle-kit/api/assemblage/interfaces/assembledpart/index.md)[]
