Module

Geometry

Shape and space

Geometry describes shapes and how they are placed in space: rectangles, paths, and transforms. Coordinates follow the convention recorded on the value, so a point means the same thing in a UI, an illustration, and a 3D view.

Use this module when You need an explicit shape, path, or transform instead of implying it from a picture.

Keep in mind. A transform is a list of operations. Order matters. Do not collapse it into a single mystery matrix unless that is the source of truth.

Raw schema:/schema/1.0/modules/geometry.schema.json · https://visualspec.dev/schema/1.0/modules/geometry.schema.json

How to read a definition.The paragraphs say what to write and why. “Exact constraints” opens the schema keywords (type, pattern, bounds) for people checking a validator. A sample at the bottom of each definition is the smallest JSON that shows the required shape. Values such as $ref inside a sample point at another definition. They are not fields you copy into a document.

geometry

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You must include type.

You may omit bounds, width, height, depth, radius, path, points, closed, assetRef, segments, text, and extensions. Leave a field out when you have nothing to say. Do not invent a placeholder.

Exact constraints
type
object
additional properties
forbidden
typerequired"rectangle" | "rounded-rectangle" | "ellipse" | "circle" | "line" | "polygon" | "polyline" | "path" | "text" | "plane" | "box" | "sphere" | "cylinder" | "cone" | "torus" | "mesh" | "custom"

Pick one of the 17 listed values. Any other value is invalid. The list is closed on purpose so tools agree on the same words.

Exact constraints
Allowed values
  • "rectangle"
  • "rounded-rectangle"
  • "ellipse"
  • "circle"
  • "line"
  • "polygon"
  • "polyline"
  • "path"
  • "text"
  • "plane"
  • "box"
  • "sphere"
  • "cylinder"
  • "cone"
  • "torus"
  • "mesh"
  • "custom"
boundsbounds

This is not a new shape. It reuses bounds from the common module. Open that definition for the fields you can write.

widthsize

This is not a new shape. It reuses size from the common module. Open that definition for the fields you can write.

heightsize

This is not a new shape. It reuses size from the common module. Open that definition for the fields you can write.

depthsize

This is not a new shape. It reuses size from the common module. Open that definition for the fields you can write.

radiussize

This is not a new shape. It reuses size from the common module. Open that definition for the fields you can write.

pathstring

SVG-compatible path data.

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
pointsarray<vector2 | vector3>

Write a list. Each item follows the shape described under items.

The list needs at least 2 items.

Exact constraints
type
array
min items
2
itemsvector2 | vector3

More than one shape is accepted. Use exactly one of the 2 alternatives below. They are different ways to say the same kind of value.

anyOf 1vector2

This is not a new shape. It reuses vector2 from the common module. Open that definition for the fields you can write.

anyOf 2vector3

This is not a new shape. It reuses vector3 from the common module. Open that definition for the fields you can write.

closedboolean

Write true or false.

Exact constraints
type
boolean
assetRefid

This is not a new shape. It reuses id from the common module. Open that definition for the fields you can write.

segmentsinteger

Write a whole number.

The number must be at least 3.

Exact constraints
type
integer
minimum
3
textstring

Write a text value.

An empty string is not allowed.

Exact constraints
type
string
min length
1
extensionsextensions

This is not a new shape. It reuses extensions from the common module. Open that definition for the fields you can write.

Smallest example

Required fields only, with placeholder values. Replace them with the real intent.

geometryJSON
{  "type": "rectangle"}

transformOp

One step in an ordered transform list. Order is significant.

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You must include type.

You may omit x, y, z, and angle. Leave a field out when you have nothing to say. Do not invent a placeholder.

Exact constraints
type
object
additional properties
forbidden
typerequired"translate" | "scale" | "rotate" | "skew" | "perspective"

Pick one of the 5 listed values. Any other value is invalid. The list is closed on purpose so tools agree on the same words.

Exact constraints
Allowed values
  • "translate"
  • "scale"
  • "rotate"
  • "skew"
  • "perspective"
xnumber

Write a number. Decimals are allowed.

Exact constraints
type
number
ynumber

Write a number. Decimals are allowed.

Exact constraints
type
number
znumber

Write a number. Decimals are allowed.

Exact constraints
type
number
anglenumber

Write a number. Decimals are allowed.

Exact constraints
type
number

Smallest example

Required fields only, with placeholder values. Replace them with the real intent.

transformOpJSON
{  "type": "translate"}

transform

More than one shape is accepted. Use exactly one of the 2 alternatives below. They are different ways to say the same kind of value.

anyOf 1object

Write an object. Only the fields named below are allowed. Unknown fields are rejected so a typo cannot hide inside the document.

You may omit translate, rotate, scale, origin, matrix, operations, and coordinateSpace. Leave a field out when you have nothing to say. Do not invent a placeholder.

Exact constraints
type
object
additional properties
forbidden
translatevector2 | vector3

More than one shape is accepted. Use exactly one of the 2 alternatives below. They are different ways to say the same kind of value.

anyOf 1vector2

This is not a new shape. It reuses vector2 from the common module. Open that definition for the fields you can write.

anyOf 2vector3

This is not a new shape. It reuses vector3 from the common module. Open that definition for the fields you can write.

rotatenumber | vector3 | quaternion

More than one shape is accepted. Use exactly one of the 3 alternatives below. They are different ways to say the same kind of value.

anyOf 1number

Write a number. Decimals are allowed.

Exact constraints
type
number
anyOf 2vector3

This is not a new shape. It reuses vector3 from the common module. Open that definition for the fields you can write.

anyOf 3quaternion

This is not a new shape. It reuses quaternion from the common module. Open that definition for the fields you can write.

scalenumber | vector2 | vector3

More than one shape is accepted. Use exactly one of the 3 alternatives below. They are different ways to say the same kind of value.

anyOf 1number

Write a number. Decimals are allowed.

Exact constraints
type
number
anyOf 2vector2

This is not a new shape. It reuses vector2 from the common module. Open that definition for the fields you can write.

anyOf 3vector3

This is not a new shape. It reuses vector3 from the common module. Open that definition for the fields you can write.

originvector2 | vector3

More than one shape is accepted. Use exactly one of the 2 alternatives below. They are different ways to say the same kind of value.

anyOf 1vector2

This is not a new shape. It reuses vector2 from the common module. Open that definition for the fields you can write.

anyOf 2vector3

This is not a new shape. It reuses vector3 from the common module. Open that definition for the fields you can write.

matrixarray<number>

Write a list. Each item follows the shape described under items.

More than one shape is accepted. Use exactly one of the 2 alternatives below. They are different ways to say the same kind of value.

Exact constraints
type
array
itemsnumber

Write a number. Decimals are allowed.

Exact constraints
type
number
anyOf 1-

The list needs at least 6 items.

The list allows at most 6 items.

Exact constraints
min items
6
max items
6
anyOf 2-

The list needs at least 16 items.

The list allows at most 16 items.

Exact constraints
min items
16
max items
16
operationsarray<transformOp>

Write a list. Each item follows the shape described under items.

The list needs at least 1 item.

Exact constraints
type
array
min items
1
itemstransformOp

This is not a new shape. It reuses transformOp from the geometry module. Open that definition for the fields you can write.

coordinateSpacecoordinateSpace

This is not a new shape. It reuses coordinateSpace from the common module. Open that definition for the fields you can write.

anyOf 2array<transformOp>

Write a list. Each item follows the shape described under items.

The list needs at least 1 item.

Exact constraints
type
array
min items
1
itemstransformOp

This is not a new shape. It reuses transformOp from the geometry module. Open that definition for the fields you can write.

Smallest example

Required fields only, with placeholder values. Replace them with the real intent.

transformJSON
{  "translate": {    "$ref": "common#vector2"  },  "rotate": 0,  "scale": 0,  "origin": {    "$ref": "common#vector2"  }}