# Containment

This class is used to gather information about which paths contain other paths. It represents the containment hierarchy of a set of paths.

A path is contained within another path if every point on it lies inside, and it does not cross the other path.

## Constructors

Containment(contained)→[Containment](https://cuttle.xyz/learn/reference/Containment)

`contained`

`[PathContainment](https://cuttle.xyz/learn/reference/PathContainment)[]`

`[]`

Containment.fromPaths(paths)→[Containment](https://cuttle.xyz/learn/reference/Containment)

Constructs a containment from an array of paths. Paths are organized into a number of top level path containments, and paths that are contained within those paths.

A path is contained within another path if every point on it lies inside, and it does not cross the other path.

`paths`

`[Path](https://cuttle.xyz/learn/reference/Path)[]`

An array of non-overlapping paths

## Properties

.contained[PathContainment](https://cuttle.xyz/learn/reference/PathContainment)\[\]

Paths contained within this containment.

## Methods

.maximumDepth()→number

Returns the maximum depth of this containment. Depth indicates how deeply nested the hierarchy is. If depth is zero, nothing is contained within this containment.

.allPaths()→[Path](https://cuttle.xyz/learn/reference/Path)\[\]

Returns all paths contained within this containment and its contained, recursively.