{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.3",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.3.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"CapsuleGenerator.x3d"
          },
          {
            "@name":"description",
            "@content":"Capsule has top and bottom hemispheres with connected sides, with adjustable parameters in the contained Script fields. A Script node computes all coordIndex and Coordinate point values. X3D source for the produced capsule also appears on the player console."
          },
          {
            "@name":"created",
            "@content":"13 October 2014"
          },
          {
            "@name":"modified",
            "@content":"20 October 2019"
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"reference",
            "@content":"CapsuleGenerator.log.txt"
          },
          {
            "@name":"reference",
            "@content":"CapsuleComparison.x3d"
          },
          {
            "@name":"info",
            "@content":"InstantReality and BSContact work"
          },
          {
            "@name":"TODO",
            "@content":"H3DViewer: missing Script appinfo and new SFInt32 when running CapsuleGenerator.js; got bugtracker?"
          },
          {
            "@name":"reference",
            "@content":"https://en.wikipedia.org/wiki/Capsule_(geometry)"
          },
          {
            "@name":"reference",
            "@content":"https://en.wiktionary.org/wiki/capsule"
          },
          {
            "@name":"info",
            "@content":"This tessellation is not geodesic because the polygons are computed using rectangular quadrilaterals and vertical levels rather than triangulated shortest paths."
          },
          {
            "@name":"reference",
            "@content":"https://en.wiktionary.org/wiki/geodesic"
          },
          {
            "@name":"reference",
            "@content":"https://en.wiktionary.org/wiki/geodesic_dome"
          },
          {
            "@name":"reference",
            "@content":"https://en.wikipedia.org/wiki/Geodesic"
          },
          {
            "@name":"reference",
            "@content":"https://en.wikipedia.org/wiki/Geodesic_grid"
          },
          {
            "@name":"reference",
            "@content":"https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/tools/X3dEdit3.3/X3D/src/org/web3d/x3d/NsidedPolygon.java"
          },
          {
            "@name":"reference",
            "@content":"https://savage.nps.edu/Savage/CommunicationsAndSensors/HalfDome/HemisphereExample.x3d"
          },
          {
            "@name":"reference",
            "@content":"https://savage.nps.edu/Savage/CommunicationsAndSensors/HalfDome/HemispherePrototype.x3d"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/CapsuleGenerator.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"16 April 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@title":"CapsuleGenerator.x3d"
            }
          },
          { "Background":
            {
              "@skyColor":[0.5,1,0.9]
            }
          },
          { "Viewpoint":
            {
              "@description":"Capsule Generator",
              "@position":[0,0,4]
            }
          },
          { "Shape":
            {
              "@DEF":"Capsule",
              "-children":[
                {
                  "#comment":"Polygonal Capsule consisting of 2 Hemispheres with connected sides"
                }
              ],
              "-geometry":
                { "IndexedFaceSet":
                  {
                    "@DEF":"COMPUTED_IFS",
                    "@creaseAngle":0.785398,
                    "-coord":
                      { "Coordinate":
                        {
                          "@DEF":"COMPUTED_COORDINATE"
                        }
                      }
                  }
                },
              "-appearance":
                { "Appearance":
                  {
                    "-material":
                      { "Material":
                        {
                          "@emissiveColor":[0.2,0.5,0]
                        }
                      }
                  }
                }
            }
          },
          { "Script":
            {
              "@DEF":"CapsuleGeneratorScript",
              "@url":["CapsuleGenerator.js","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/GeometricShapes/CapsuleGenerator.js"],
              "field": [
                {
                  "@name":"height",
                  "@accessType":"initializeOnly",
                  "@appinfo":"total height, includes top and bottom hemispheres",
                  "@type":"SFFloat",
                  "@value":2.0
                },
                {
                  "@name":"radius",
                  "@accessType":"initializeOnly",
                  "@appinfo":"for cylinder and hemispherical end caps",
                  "@type":"SFFloat",
                  "@value":0.5
                },
                {
                  "@name":"numberOfPoints",
                  "@accessType":"initializeOnly",
                  "@appinfo":"horizontal resolution for cylinder and hemispherical end caps",
                  "@type":"SFInt32",
                  "@value":36
                },
                {
                  "@name":"numberOfLevels",
                  "@accessType":"initializeOnly",
                  "@appinfo":"vertical resolution for cylinder and hemispherical end caps",
                  "@type":"SFInt32",
                  "@value":10
                },
                {
                  "@name":"horizontalScale",
                  "@accessType":"initializeOnly",
                  "@appinfo":"radial scale factor",
                  "@type":"SFFloat",
                  "@value":1.0
                },
                {
                  "@name":"verticalScale",
                  "@accessType":"initializeOnly",
                  "@appinfo":"vertical scale factor",
                  "@type":"SFFloat",
                  "@value":1.0
                },
                {
                  "@name":"top",
                  "@accessType":"initializeOnly",
                  "@appinfo":"whether to draw top hemisphere",
                  "@type":"SFBool",
                  "@value":true
                },
                {
                  "@name":"side",
                  "@accessType":"initializeOnly",
                  "@appinfo":"whether to draw side cylinder",
                  "@type":"SFBool",
                  "@value":true
                },
                {
                  "@name":"bottom",
                  "@accessType":"initializeOnly",
                  "@appinfo":"whether to draw bottom hemisphere",
                  "@type":"SFBool",
                  "@value":true
                },
                {
                  "@name":"pointsComputed",
                  "@accessType":"outputOnly",
                  "@appinfo":"points for Coordinate node",
                  "@type":"MFVec3f"
                },
                {
                  "@name":"indicesComputed",
                  "@accessType":"outputOnly",
                  "@appinfo":"index values for IFS",
                  "@type":"MFInt32"
                },
                {
                  "@name":"traceEnabled",
                  "@accessType":"initializeOnly",
                  "@appinfo":"whether to trace output values on X3D browser console",
                  "@type":"SFBool",
                  "@value":false
                },
                {
                  "@name":"geometryType",
                  "@accessType":"initializeOnly",
                  "@appinfo":"determines console output node type: polygons=IndexedFaceSet, lines=IndexedLineSet, points=PointSet",
                  "@type":"SFString",
                  "@value":"polygons"
                }
              ]
            }
          },
          { "ROUTE":
            {
              "@fromField":"indicesComputed",
              "@fromNode":"CapsuleGeneratorScript",
              "@toField":"set_coordIndex",
              "@toNode":"COMPUTED_IFS"
            }
          },
          { "ROUTE":
            {
              "@fromField":"pointsComputed",
              "@fromNode":"CapsuleGeneratorScript",
              "@toField":"set_point",
              "@toNode":"COMPUTED_COORDINATE"
            }
          }
        ]
    }
  }
}