Examples / cad-solids

cad-solids.json

targets v0.42.0 4 entities 7 schemas

A revolved vase from a path profile and a sphere knob - the two solid primitives the boolean example does not cover.

Speaks

rig.cad.revolve · rig.cad.sphere · rig.geometry.path · rig.meta.named · rig.spatial.relationship · rig.spatial.transform · rig.spatial.vertex

Document

Validates under npm run check — raw file · open in RigPlayer — drop it in, press play, remix it, share the link.

{
  "rig": "0.42.0",
  "document": {
    "title": "CAD solids - revolve and sphere",
    "defaultUnit": "mm"
  },
  "entities": [
    {
      "id": "world",
      "components": {
        "rig.meta.named": {
          "name": "world",
          "stableId": "world"
        },
        "rig.spatial.vertex": {},
        "rig.spatial.transform": {
          "position": [
            0,
            0,
            0
          ]
        }
      }
    },
    {
      "id": "vase-profile",
      "components": {
        "rig.meta.named": {
          "name": "vase profile",
          "stableId": "vase-profile"
        },
        "rig.geometry.path": {
          "commands": [
            {
              "type": "move-to",
              "point": [
                0,
                0
              ]
            },
            {
              "type": "line-to",
              "point": [
                24,
                0
              ]
            },
            {
              "type": "line-to",
              "point": [
                30,
                40
              ]
            },
            {
              "type": "line-to",
              "point": [
                14,
                80
              ]
            },
            {
              "type": "line-to",
              "point": [
                18,
                110
              ]
            }
          ]
        }
      }
    },
    {
      "id": "vase",
      "components": {
        "rig.meta.named": {
          "name": "vase",
          "stableId": "vase"
        },
        "rig.spatial.transform": {
          "position": [
            0,
            0,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.cad.revolve": {
          "profile": "vase-profile",
          "revolveDegrees": 360,
          "circularSegments": 48
        }
      }
    },
    {
      "id": "knob",
      "components": {
        "rig.meta.named": {
          "name": "knob",
          "stableId": "knob"
        },
        "rig.spatial.transform": {
          "position": [
            90,
            0,
            0
          ]
        },
        "rig.spatial.relationship": {
          "parent": "world"
        },
        "rig.cad.sphere": {
          "radius": 25,
          "circularSegments": 32
        }
      }
    }
  ]
}