Examples / minimal-scene

minimal-scene.json

targets v0.8.0 12 entities 14 schemas

A specimen sheet of the geometry vocabulary: rounded rectangle, circle, regular polygons (triangle, hexagon), star, parent/child hierarchy under a root rig.spatial.vertex (world), closed and open polygons, line, and a quad mesh. Rendered to site/scene.svg by tools/render-svg.mjs. Note what is absent: fill-only shapes carry just fillRgba and stroke-only shapes just strokeRgba - 0.8.0 defaults cover the rest.

minimal-scene drawn by tools/render-svg.mjs
Same document, drawn by the in-repo SVG fulfillment.

Speaks

rig.geometry.ellipse · rig.geometry.line · rig.geometry.mesh · rig.geometry.polygon · rig.geometry.rectangle · rig.geometry.regular_polygon · rig.geometry.star · rig.interact.selectable · rig.meta.named · rig.paint.fill_stroke · rig.paint.stroke_style · rig.spatial.relationship · rig.spatial.transform · rig.spatial.vertex

Document

Validates under npm run checkraw file.

{
  "rig": "0.8.0",
  "document": {
    "title": "Minimal scene",
    "defaultUnit": "px"
  },
  "entities": [
    {
      "id": "world",
      "components": {
        "rig.meta.named": {
          "name": "world",
          "stableId": "world"
        },
        "rig.spatial.vertex": {},
        "rig.spatial.transform": {
          "position": [
            0,
            0,
            0
          ]
        }
      }
    },
    {
      "id": "demo-rect",
      "components": {
        "rig.meta.named": {
          "name": "demo-rect",
          "stableId": "demo-rect"
        },
        "rig.spatial.transform": {
          "position": [
            20,
            65,
            0
          ],
          "rotation": [
            0,
            0,
            0,
            1
          ],
          "scale": [
            1,
            1,
            1
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.rectangle": {
          "x": 0,
          "y": 0,
          "width": 140,
          "height": 90,
          "cornerRadius": 10
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.25,
            0.65,
            1,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-circle",
      "components": {
        "rig.meta.named": {
          "name": "demo-circle",
          "stableId": "demo-circle"
        },
        "rig.spatial.transform": {
          "position": [
            270,
            110,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.ellipse": {
          "centerX": 0,
          "centerY": 0,
          "radiusX": 48,
          "radiusY": 48
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            1,
            0.45,
            0.3,
            1
          ],
          "strokeRgba": [
            1,
            1,
            1,
            1
          ],
          "strokeWidth": 2
        },
        "rig.paint.stroke_style": {
          "cap": "round",
          "join": "round"
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-tri",
      "components": {
        "rig.meta.named": {
          "name": "demo-tri",
          "stableId": "demo-tri"
        },
        "rig.spatial.transform": {
          "position": [
            450,
            118,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.regular_polygon": {
          "centerX": 0,
          "centerY": 0,
          "radius": 55,
          "sides": 3,
          "rotationDegrees": -90
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.95,
            0.8,
            0.2,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-hex",
      "components": {
        "rig.meta.named": {
          "name": "demo-hex",
          "stableId": "demo-hex"
        },
        "rig.spatial.transform": {
          "position": [
            630,
            110,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.regular_polygon": {
          "centerX": 0,
          "centerY": 0,
          "radius": 52,
          "sides": 6,
          "rotationDegrees": 0
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.35,
            0.85,
            0.55,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-star",
      "components": {
        "rig.meta.named": {
          "name": "demo-star",
          "stableId": "demo-star"
        },
        "rig.spatial.transform": {
          "position": [
            810,
            112,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.star": {
          "centerX": 0,
          "centerY": 0,
          "radius": 55,
          "innerRadius": 22,
          "points": 5,
          "rotationDegrees": -90
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.95,
            0.4,
            0.7,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-parent",
      "components": {
        "rig.meta.named": {
          "name": "demo-parent",
          "stableId": "demo-parent"
        },
        "rig.spatial.transform": {
          "position": [
            30,
            260,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.rectangle": {
          "x": 0,
          "y": 0,
          "width": 120,
          "height": 80,
          "cornerRadius": 8
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.55,
            0.35,
            0.9,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-child",
      "components": {
        "rig.meta.named": {
          "name": "demo-child",
          "stableId": "demo-child"
        },
        "rig.spatial.transform": {
          "position": [
            40,
            30,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "demo-parent"
        },
        "rig.geometry.rectangle": {
          "x": 0,
          "y": 0,
          "width": 70,
          "height": 50,
          "cornerRadius": 6
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.95,
            0.55,
            0.2,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-gem",
      "components": {
        "rig.meta.named": {
          "name": "demo-gem",
          "stableId": "demo-gem"
        },
        "rig.spatial.transform": {
          "position": [
            270,
            300,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.polygon": {
          "points": [
            [
              -45,
              0
            ],
            [
              0,
              -35
            ],
            [
              45,
              0
            ],
            [
              0,
              35
            ]
          ]
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.2,
            0.8,
            0.85,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-line",
      "components": {
        "rig.meta.named": {
          "name": "demo-line",
          "stableId": "demo-line"
        },
        "rig.spatial.transform": {
          "position": [
            450,
            300,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.line": {
          "x1": -50,
          "y1": 40,
          "x2": 50,
          "y2": -40
        },
        "rig.paint.fill_stroke": {
          "strokeRgba": [
            0.92,
            0.94,
            0.97,
            1
          ],
          "strokeWidth": 3
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-quad",
      "components": {
        "rig.meta.named": {
          "name": "demo-quad",
          "stableId": "demo-quad"
        },
        "rig.spatial.transform": {
          "position": [
            630,
            300,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.mesh": {
          "positions": [
            -60,
            -60,
            0,
            60,
            -60,
            0,
            60,
            60,
            0,
            -60,
            60,
            0
          ],
          "indices": [
            0,
            1,
            2,
            0,
            2,
            3
          ],
          "mode": "triangles"
        },
        "rig.paint.fill_stroke": {
          "fillRgba": [
            0.55,
            0.55,
            0.95,
            1
          ]
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    },
    {
      "id": "demo-wave",
      "components": {
        "rig.meta.named": {
          "name": "demo-wave",
          "stableId": "demo-wave"
        },
        "rig.spatial.transform": {
          "position": [
            810,
            300,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.geometry.polygon": {
          "points": [
            [
              -50,
              20
            ],
            [
              -25,
              -20
            ],
            [
              0,
              20
            ],
            [
              25,
              -20
            ],
            [
              50,
              20
            ]
          ],
          "closed": false
        },
        "rig.paint.fill_stroke": {
          "strokeRgba": [
            0.75,
            0.8,
            0.9,
            1
          ],
          "strokeWidth": 3
        },
        "rig.interact.selectable": {
          "enabled": true
        }
      }
    }
  ]
}