Schemas / Geometry / paint

rig.geometry.regular_polygon

v0.31.0 · draft 5 fields 4 required

Fields

FieldTypeMeaning
centerX float required Centre X, local space
centerY float required Centre Y, local space
radius float required Centre to vertex, not centre to edge
sides integer3 – * required Vertex count; at least 3
rotationDegrees float optional Optional. Absent = 0; first vertex at angle 0 points along +X

Equilateral n-gon about a centre. Format when present.

A triangle is sides: 3. There is no separate triangle schema.

rotationDegrees exists so the shape's own phase survives independently of the entity's rotation in rig.spatial.transform. A host that has only one of the two composes them. Local (0,0) is the authored centre - see rig.spatial.anchor.

Appearance: rig.paint.fill_stroke.

JSON Schema

Resolves at https://rig.works/schemas/rig.geometry.regular_polygon.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.geometry.regular_polygon.schema.json",
  "title": "rig.geometry.regular_polygon",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "centerX": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "centerY": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "radius": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "sides": {
      "type": "integer",
      "minimum": 3
    },
    "rotationDegrees": {
      "$ref": "./_defs.schema.json#/$defs/float"
    }
  },
  "required": [
    "centerX",
    "centerY",
    "radius",
    "sides"
  ]
}

Seen in

minimal-scene.json