# Function: groupByPart()

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

***

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


# Function: groupByPart() {#function-groupbypart}


> **groupByPart**(`path`): `object`[]

Defined in: [forms/path.ts:307](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/forms/path.ts#L307)

Group a path's shapes into parts, preserving draw order.

This is what the assemblage stage calls to assign a depth band per part
and light each one against the parts behind it. Shapes with no tag are
grouped under `untagged`, so a path built by a rule that says nothing about
anatomy still round-trips through the assembler rather than vanishing.

Order is preserved twice over: the parts come back in the order their first
shape appears, and each part's shapes stay in their original relative order.
Both matter, because order is draw order and draw order is what a
directional light reads as depth.


## Parameters {#parameters}



### path {#path}


[`Path`](https://jonbogaty.com/lifecycle-kit/api/forms/interfaces/path/index.md)


## Returns {#returns}


`object`[]
