# Adding a passive margin with variable depth#

Although we have hinted towards it before, there is also an area feature called `continental plate`

. It works as you would expect based on what you have seen with the oceanic plate, but we are going to use it to do something very cool in our model: have variable depths of a feature or even of layers within a given feature!

To showcase this, we will be adding a passive margin to our model at the overriding plate side of our model. To start out, we need to know that both the `min depth`

and `max depth`

accept two types of values: a number and an array of values at points.

Note

For an example of what this looks like in technical terms, see /features/items/oneOf/1/max depth.

The number input we have seen before, and just sets the maximum depth to a single value. The value at points system works a bit differently, but can be used to achieve the same result. To start out easy, this is exactly what we are going to to for the `max depth`

of the continental feature.

The value at points system creates a list of points, which at least include all the edge points of an object and assigns a value to them. Then to get the actual value at the rest of the points, `max depth`

in our case, an interpolation between some close points is performed to get the value at that point.

Below are two examples of how to first set the depth of two points to 200 km, and then an example of how to also set a third point to a value of 100 km.

```
1 "max depth":[[200e3, [[10e3,0],[20e3,10e3]]]],
2
3 "max depth":[[200e3, [[10e3,0],[20e3,10e3]]],[100e3,[[15e3,0]]]]
```

A common operation is to set all the corners to a single value, and then maybe overwrite individual corners. To make life easy, there is a quick way to (re)set the value at the corner points: just pass a value with no points. This is what is done in the code sample below at the emphasized lines. The first entry is a value without points. That means that all the corner points are set to that value.

Note

If you provide a point twice, explicitly, or implicitly through the use of the corner values shortcut (e.g. `[200]`

), the last defined value is used. This follows the painting analogy used before, where you overpaint older values.

```
16 {
17 "model":"continental plate", "name":"Passive margin", "max depth":[[200e3]],
18 "coordinates":[[-1000e3,0],[-1000e3,1000e3],[0,1000e3],[0,0]],
19 "temperature models":
20 [
21 {"model":"linear", "max depth":[[100e3],[200e3,[[-250e3,0],[-750e3,1000e3]]]]}
22 ],
23 "composition models":
24 [
25 {"model":"uniform", "compositions":[3],
26 "max depth":[[100e3],[200e3,[[-250e3,0],[-750e3,1000e3]]]]},
27 {"model":"uniform", "compositions":[1],
28 "min depth":[[100e3],[200e3,[[-250e3,0],[-750e3,1000e3]]]]}
29 ]
30 },
```

```
1{
2 "version": "0.6",
3 "coordinate system":{"model":"cartesian"},
4 "features":
5 [
6 {
7 "model":"oceanic plate", "name":"Overriding Plate", "max depth":100e3,
8 "coordinates":[[0,0],[0,1000e3],[1500e3,1000e3],[1600e3,350e3],[1500e3,0]],
9 "temperature models":
10 [
11 {"model":"half space model", "max depth":100e3, "spreading velocity":0.04,
12 "ridge coordinates":[[[400e3,-1],[-100e3,2000e3]]]}
13 ],
14 "composition models":[{"model":"uniform", "compositions":[0], "max depth":50e3}]
15 },
16 {
17 "model":"continental plate", "name":"Passive margin", "max depth":[[200e3]],
18 "coordinates":[[-1000e3,0],[-1000e3,1000e3],[0,1000e3],[0,0]],
19 "temperature models":
20 [
21 {"model":"linear", "max depth":[[100e3],[200e3,[[-250e3,0],[-750e3,1000e3]]]]}
22 ],
23 "composition models":
24 [
25 {"model":"uniform", "compositions":[3],
26 "max depth":[[100e3],[200e3,[[-250e3,0],[-750e3,1000e3]]]]},
27 {"model":"uniform", "compositions":[1],
28 "min depth":[[100e3],[200e3,[[-250e3,0],[-750e3,1000e3]]]]}
29 ]
30 },
31 {
32 "model":"oceanic plate", "name":"Subducting Oceanic plate", "max depth":100e3,
33 "coordinates":[[2000e3,0],[2000e3,1000e3],[1500e3,1000e3],[1600e3,350e3],[1500e3,0]],
34 "temperature models":[{"model":"linear", "max depth":100e3}],
35 "composition models":[{"model":"uniform", "compositions":[3], "max depth":50e3},
36 {"model":"uniform", "compositions":[1], "min depth":50e3}]
37 }
38 ]
39}
```