# `<shape>`

[Canonical page](https://nothing.graphics/docs/format/reference/shape) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/docs/reference/shape.md)

Place and paint a single geometry as a drawable.



<!-- Generated by ncf/tools/reference/generate.mjs. -->

The `<shape>` element owns exactly one geometry child and carries its paint, transform and attachments. Set rotation on the shape and dimensions and registration on its geometry.

## Syntax [#syntax]

Translate the shape to (56, 8) and set both rectangle anchors to zero. The top-left corner of the white rectangle lands at (56, 8).

```xml
<shape translate-x="56" translate-y="8">
  <rect width="10" height="6" anchor-u="0" anchor-v="0"/>
  <fill><paint><solid color="#FFFFFFFF"/></paint></fill>
</shape>
```

[Complete .nothing source](https://github.com/gridaco/nothing/blob/main/ncf/conformance/boxed-geometry/centered-rectangle.nothing)

## Usage context [#usage-context]

Allowed parents are [`<scene>`](https://nothing.graphics/docs/format/reference/scene), [`<group>`](https://nothing.graphics/docs/format/reference/group), [`<sequence>`](https://nothing.graphics/docs/format/reference/sequence), [`<shape>`](https://nothing.graphics/docs/format/reference/shape), [`<boolean>`](https://nothing.graphics/docs/format/reference/boolean), [`<mask>`](https://nothing.graphics/docs/format/reference/mask).

The [spatial trial](https://github.com/gridaco/nothing/blob/main/ncf/rfcs/spatial-cameras.md) also allows [`<plane>`](https://nothing.graphics/docs/format/reference/plane).

Inherits from [Drawable](https://nothing.graphics/docs/format/reference/drawable).

Use at most one locator kind. `u` and `v` form one kind, `along` a second, and `vertex` a third. A locator uses the nearest enclosing shape or the scene viewport.

## Attributes [#attributes]

[Property animation](https://nothing.graphics/docs/format/spec/animation#property-types-and-exceptions)

### `translate-x` [#translate-x]

**Value** parent units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#translate-x)

Horizontal translation.

### `translate-y` [#translate-y]

**Value** parent units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#translate-y)

Vertical translation.

### `pivot-x` [#pivot-x]

**Value** local units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#pivot-x)

Horizontal coordinate of the transform pivot.

### `pivot-y` [#pivot-y]

**Value** local units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#pivot-y)

Vertical coordinate of the transform pivot.

### `scale-x` [#scale-x]

**Value** factor · **If omitted** `1` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#scale-x)

Local horizontal scale. Negative values reflect the axis.

### `scale-y` [#scale-y]

**Value** factor · **If omitted** `1` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#scale-y)

Local vertical scale. Negative values reflect the axis.

### `skew-x` [#skew-x]

**Value** degrees · **If omitted** `0` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#skew-x)

Horizontal shear angle, strictly between −90 and 90.

### `rotate` [#rotate]

**Value** degrees · **If omitted** `0` · **Keys** Scalar · **Declared by** [Transform](https://nothing.graphics/docs/format/reference/transform#rotate)

Rotation about the drawable pivot, clockwise in default scene coordinates.

### `u` [#u]

**Value** fraction of host width · **Keys** Scalar · **Declared by** [Locator](https://nothing.graphics/docs/format/reference/locator#u)

Horizontal share measured from the left of the host bounds. Values outside \[0, 1] select a point outside those bounds. A track requires an authored base. Omission leaves this axis at the parent origin.

### `v` [#v]

**Value** fraction of host height · **Keys** Scalar · **Declared by** [Locator](https://nothing.graphics/docs/format/reference/locator#v)

Vertical share measured from the top of the host bounds. Values outside \[0, 1] select a point outside those bounds. A track requires an authored base. Omission leaves this axis at the parent origin.

### `along` [#along]

**Value** fraction of contour length · **Keys** Scalar · **Declared by** [Locator](https://nothing.graphics/docs/format/reference/locator#along)

Share of the directed contour length. Open contours use \[0, 1]. Closed contours wrap across laps. A track requires an authored base.

### `vertex` [#vertex]

**Value** vertex index · **Keys** Scalar · **Declared by** [Locator](https://nothing.graphics/docs/format/reference/locator#vertex)

Zero-based vertex and fractional distance along its following segment. Open contours with n vertices admit \[0, n − 1]. Closed contours wrap every n vertices. A track requires an authored base.

### `orient` [#orient]

**Value** `none`, `auto` · **If omitted** `none` · **Keys** Held · **Declared by** [Locator](https://nothing.graphics/docs/format/reference/locator#orient)

Facing relative to the host contour. Auto facing requires along or vertex.

### `opacity` [#opacity]

**Value** fraction · **If omitted** `1` · **Keys** Scalar · **Declared by** [Blending](https://nothing.graphics/docs/format/reference/blending#opacity)

Opacity from 0 to 1, applied once to the completed visual result.

### `blend-mode` [#blend-mode]

**Value** `normal`, `multiply`, `screen`, `pass-through` · **If omitted** `normal` · **Keys** Held · **Declared by** [Blending](https://nothing.graphics/docs/format/reference/blending#blend-mode)

Blend the assembled drawable into its enclosing paint scope.

## Children [#children]

| Elements                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Cardinality           | Declared by                                                                         | Role and source order                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`<rect>`](https://nothing.graphics/docs/format/reference/rect), [`<circle>`](https://nothing.graphics/docs/format/reference/circle), [`<ellipse>`](https://nothing.graphics/docs/format/reference/ellipse), [`<line>`](https://nothing.graphics/docs/format/reference/line), [`<polyline>`](https://nothing.graphics/docs/format/reference/polyline), [`<polygon>`](https://nothing.graphics/docs/format/reference/polygon), [`<path>`](https://nothing.graphics/docs/format/reference/path), [`<boolean>`](https://nothing.graphics/docs/format/reference/boolean), [`<text>`](https://nothing.graphics/docs/format/reference/text) | Exactly one           | `<shape>`                                                                           | Select the host contour. Its position divides attached drawables into those painted below and above the host.                                                                                                                                             |
| [`<shape>`](https://nothing.graphics/docs/format/reference/shape), [`<group>`](https://nothing.graphics/docs/format/reference/group), [`<sequence>`](https://nothing.graphics/docs/format/reference/sequence)                                                                                                                                                                                                                                                                                                                                                                                                                         | Zero or more          | `<shape>`                                                                           | Drawables attached to this shape. Document order, below or above the host according to each child's position relative to geometry. [Attachment order and compositing](https://nothing.graphics/docs/format/spec/attached-drawables#order-and-compositing) |
| [`<fill>`](https://nothing.graphics/docs/format/reference/fill)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Optional, at most one | `<shape>`                                                                           | Paint the interior. Before all strokes. [Paint](https://nothing.graphics/docs/format/spec/graphics#paint)                                                                                                                                                 |
| [`<stroke>`](https://nothing.graphics/docs/format/reference/stroke)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Zero or more          | `<shape>`                                                                           | Paint a band along the contour. Document order after fill and inset shadows. [Paint](https://nothing.graphics/docs/format/spec/graphics#paint)                                                                                                            |
| [`<box-shadow>`](https://nothing.graphics/docs/format/reference/box-shadow)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Zero or more          | `<shape>`                                                                           | Shadow from the underlying rectangle. Document order within outer or inset shadows. Outers precede fill and insets follow fill. Requires rectangle geometry. [Outer box shadows](https://nothing.graphics/docs/format/spec/filters#outer-box-shadows)     |
| [`<filter>`](https://nothing.graphics/docs/format/reference/filter)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Optional, at most one | [Drawable effects](https://nothing.graphics/docs/format/reference/drawable-effects) | Source-image operations on the assembled drawable. Independent of its position among siblings.                                                                                                                                                            |
| [`<backdrop-filter>`](https://nothing.graphics/docs/format/reference/backdrop-filter)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Optional, at most one | [Drawable effects](https://nothing.graphics/docs/format/reference/drawable-effects) | Blur the accumulated picture at this drawable's paint position. Independent of its position among siblings. [Backdrop blur](https://nothing.graphics/docs/format/spec/filters#backdrop-blur)                                                              |
| [`<mask>`](https://nothing.graphics/docs/format/reference/mask)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Optional, at most one | [Drawable effects](https://nothing.graphics/docs/format/reference/drawable-effects) | Coverage from one source shape. Independent of its position among siblings. [Mask sources](https://nothing.graphics/docs/format/spec/graphics#mask-on-a-shape)                                                                                            |
| [`<animate>`](https://nothing.graphics/docs/format/reference/animate)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Zero or more          | Animation                                                                           | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation)                                      |

## Specifications [#specifications]

* [Shapes and geometry](https://nothing.graphics/docs/format/spec/graphics#shapes)
* [Local-to-parent transforms](https://nothing.graphics/docs/format/spec/spatial#local-to-parent)
* [Locators](https://nothing.graphics/docs/format/spec/attached-drawables#locators)
* [Compositing and coverage](https://nothing.graphics/docs/format/spec/spatial#compositing-and-coverage)
* [Attachment order and compositing](https://nothing.graphics/docs/format/spec/attached-drawables#order-and-compositing)
* [Paint](https://nothing.graphics/docs/format/spec/graphics#paint)
* [Outer box shadows](https://nothing.graphics/docs/format/spec/filters#outer-box-shadows)
* [Filters and shadows](https://nothing.graphics/docs/format/spec/filters)
* [Backdrop blur](https://nothing.graphics/docs/format/spec/filters#backdrop-blur)
* [Mask sources](https://nothing.graphics/docs/format/spec/graphics#mask-on-a-shape)
* [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation)
