{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Interchange",
    "@version":"4.0",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-4.0.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "component": [
          {
            "@name":"NURBS",
            "@level":3
          }
        ],
        "meta": [
          {
            "@name":"title",
            "@content":"NurbsSweptSurfaceExample.x3d"
          },
          {
            "@name":"description",
            "@content":"X3D Architecture example: NurbsSweptSurface demonstration."
          },
          {
            "@name":"creator",
            "@content":"Doug Sanden and Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"13 April 2022"
          },
          {
            "@name":"modified",
            "@content":"28 September 2025"
          },
          {
            "@name":"Image",
            "@content":"NurbsSweptSurfaceExample.png"
          },
          {
            "@name":"specificationSection",
            "@content":"X3D Architecture, 27 NURBS component, 27.4.11 NurbsSweptSurface"
          },
          {
            "@name":"specificationUrl",
            "@content":"https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/nurbs.html#NurbsSweptSurfaceExample"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/NurbsSweptSurfaceExample.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"20 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":[
          { "Group":
            {
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "LineSet":
                        {
                          "@vertexCount":[2],
                          "-coord":
                            { "Coordinate":
                              {
                                "@point":[0,0,0,4,0,0]
                              }
                            }
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@emissiveColor":[1,0,0]
                              }
                            },
                          "-lineProperties":
                            { "LineProperties":
                              {
                                "@linewidthScaleFactor":4
                              }
                            }
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "-geometry":
                      { "LineSet":
                        {
                          "@vertexCount":[2],
                          "-coord":
                            { "Coordinate":
                              {
                                "@point":[0,0,0,0,4,0]
                              }
                            }
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@emissiveColor":[0,1,0]
                              }
                            },
                          "-lineProperties":
                            { "LineProperties":
                              {
                                "@linewidthScaleFactor":4
                              }
                            }
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "-geometry":
                      { "LineSet":
                        {
                          "@vertexCount":[2],
                          "-coord":
                            { "Coordinate":
                              {
                                "@point":[0,0,0,0,0,4]
                              }
                            }
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@emissiveColor":[0,0,1]
                              }
                            },
                          "-lineProperties":
                            { "LineProperties":
                              {
                                "@linewidthScaleFactor":4
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          },
          { "Background":
            {
              "@skyColor":[1,1,1],
              "@transparency":1.0
            }
          },
          { "Viewpoint":
            {
            }
          },
          { "Transform":
            {
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@transparency":0.5
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "NurbsSweptSurface":
                        {
                          "@solid":false,
                          "-trajectoryCurve":
                            { "NurbsCurve":
                              {
                                "@DEF":"TRAJECTORY",
                                "@knot":[0,0,0,1,2,3,4,5,5,5],
                                "@weight":[1,1,1,1,1,1,1],
                                "-controlPoint":
                                  { "Coordinate":
                                    {
                                      "@DEF":"TRAJECTORYCONTROLPTS",
                                      "@point":[0,2,4,0,2,2,0,0,2,2,0,2,2,0,0,2,4,0,2,4,2]
                                    }
                                  },
                                "-children":[
                                  {
                                    "#comment":"Coordinate DEF='TRAJECTORYCONTROLPTS' containerField='controlPoint' point='4 0 2, 2 0 2, 2 0 0, 2 2 0, 0 2 0, 0 2 4, 2 2 4' /"
                                  }
                                ]
                              }
                            },
                          "-crossSectionCurve":
                            { "NurbsCurve2D":
                              {
                                "@controlPoint":[-0.25,0,0.5,0,0.5,0.25,0,0.5,0.5,0.75,0.5,1,-0.25,1,-0.25,0],
                                "@knot":[0,0,0,1,2,3,4,5,6,6,6],
                                "@tessellation":30,
                                "@weight":[1,1,1,1,1,1,1,1]
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          },
          { "Transform":
            {
              "-children":[
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"CYAN",
                                "@diffuseColor":[0,0.8,0.8]
                              }
                            },
                          "-lineProperties":
                            { "LineProperties":
                              {
                                "@linewidthScaleFactor":6
                              }
                            }
                        }
                      },
                    "-children":[
                      {
                        "#comment":"To convert a NurbsCurve2D control curve to a displayable NurbsCurve 1. rename element NurbsCurve2D -> NurbsCurve 2. cut controlPoint= field and paste into child node CoordinateDouble point field 3. edit point field adding a 3rd (z) = 0 to each xy point"
                      }
                    ],
                    "-geometry":
                      { "NurbsCurve":
                        {
                          "@DEF":"CROSSSECTION",
                          "@knot":[0,0,0,1,2,3,4,5,6,6,6],
                          "@weight":[1,1,1,1,1,1,1,1],
                          "-controlPoint":
                            { "CoordinateDouble":
                              {
                                "@point":[-0.25,0,0,0.5,0,0,0.5,0.25,0,0,0.5,0,0.5,0.75,0,0.5,1,0,-0.25,1,0,-0.25,0,0],
                                "-children":[
                                  {
                                    "#comment":"point array (8 tuples, 24 total doubles) has closed geometry with coincident endpoints"
                                  }
                                ]
                              }
                            }
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"MAGENTA",
                                "@diffuseColor":[0.8,0,0.8]
                              }
                            },
                          "-lineProperties":
                            { "LineProperties":
                              {
                                "@linewidthScaleFactor":6
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "NurbsCurve":
                        {
                          "@USE":"TRAJECTORY"
                        }
                      }
                  }
                },
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"GRAY",
                                "@diffuseColor":[0.5,0.5,0.5],
                                "@transparency":0.5
                              }
                            },
                          "-lineProperties":
                            { "LineProperties":
                              {
                                "@linewidthScaleFactor":6
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "NurbsCurve":
                        {
                          "@DEF":"TRAJECTORYCONTROLLINES",
                          "@knot":[0,0,1,2,3,4,5,6,6],
                          "@order":2,
                          "@weight":[1,1,1,1,1,1,1],
                          "-controlPoint":
                            { "Coordinate":
                              {
                                "@USE":"TRAJECTORYCONTROLPTS"
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          }
        ]
    }
  }
}