{ "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":"Text",
            "@level":1
          },
          {
            "@name":"Grouping",
            "@level":2
          },
          {
            "@name":"Navigation",
            "@level":3
          }
        ],
        "meta": [
          {
            "@name":"title",
            "@content":"X3dMeshDesignPattern.x3d"
          },
          {
            "@name":"description",
            "@content":"Candidate design pattern for 3D scanner outputs to consistently define the elements of an X3D mesh."
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman, Vince Marchetti, Roy Walmsley, Nicholas Polys"
          },
          {
            "@name":"created",
            "@content":"4 June 2017"
          },
          {
            "@name":"modified",
            "@content":"13 October 2023"
          },
          {
            "@name":"TODO",
            "@content":"Upgrade and verify X3D v4.0 XML DTD and Schema to validate"
          },
          {
            "@name":"reference",
            "@content":"X3dMeshDesignPattern.txt"
          },
          {
            "@name":"Image",
            "@content":"X3dMeshDesignPattern.png"
          },
          {
            "@name":"warning",
            "@content":"Under development. Note that proposed design pattern for Normal inside PointSet or LineSet/IndexedLineSet is accepted in X3D 4.0 but is not allowed in X3D v3.3."
          },
          {
            "@name":"reference",
            "@content":"Web3D 2017 Workshop on 3D Scanning: Use Cases, Workflow and Profile Requirements for X3D"
          },
          {
            "@name":"reference",
            "@content":"http://web3d2017.web3d.org/program"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Scanning/X3dMeshDesignPattern.x3d"
          },
          {
            "@name":"license",
            "@content":"../license.html"
          },
          {
            "@name":"translated",
            "@content":"31 August 2025"
          },
          {
            "@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":"X3dMeshDesignPattern.x3d"
            }
          },
          { "Group":
            {
              "-metadata":
                { "MetadataSet":
                  {
                    "@name":"X3dMesh",
                    "-children":[
                      {
                        "#comment":"enter other Metadata nodes and values here, vocabulary TBD"
                      }
                    ]
                  }
                },
              "-children":[
                { "Switch":
                  {
                    "@whichChoice":2,
                    "-children":[
                      { "Shape":
                        {
                          "-geometry":
                            { "PointSet":
                              {
                                "-children":[
                                  {
                                    "#comment":"Currently invalid in X3D DTD: Normal node must be first to be allowed inside IndexedLineSet or LineSet"
                                  },
                                  {
                                    "#comment":"Of note: MeshLab allows assigning normals to a point cloud"
                                  },
                                  {
                                    "#comment":"Currently invalid in X3D v3.3: Normal node not allowed inside PointSet"
                                  }
                                ],
                                "-normal":
                                  { "Normal":
                                    {
                                      "@DEF":"VertexNormals"
                                    }
                                  },
                                "-color":
                                  { "Color":
                                    {
                                      "@DEF":"VertexColors",
                                      "@color":[1,0,0,0,1,0,0,0,1,1,1,1]
                                    }
                                  },
                                "-coord":
                                  { "Coordinate":
                                    {
                                      "@DEF":"VertexValues",
                                      "@point":[1,1,0,1,-1,0,-1,-1,0,-1,1,0]
                                    }
                                  }
                              }
                            }
                        }
                      },
                      { "Shape":
                        {
                          "-geometry":
                            { "IndexedLineSet":
                              {
                                "@coordIndex":[0,1,2,3,0,-1],
                                "-children":[
                                  {
                                    "#comment":"Currently invalid in X3D DTD: Normal node must be first to be allowed inside IndexedLineSet or LineSet"
                                  }
                                ],
                                "-normal":
                                  { "Normal":
                                    {
                                      "@USE":"VertexNormals"
                                    }
                                  },
                                "-coord":
                                  { "Coordinate":
                                    {
                                      "@USE":"VertexValues"
                                    }
                                  },
                                "-color":
                                  { "Color":
                                    {
                                      "@USE":"VertexColors"
                                    }
                                  }
                              }
                            }
                        }
                      },
                      { "Shape":
                        {
                          "-geometry":
                            { "IndexedFaceSet":
                              {
                                "@coordIndex":[0,1,2,3,0,-1],
                                "@solid":false,
                                "-coord":
                                  { "Coordinate":
                                    {
                                      "@USE":"VertexValues"
                                    }
                                  },
                                "-color":
                                  { "Color":
                                    {
                                      "@USE":"VertexColors"
                                    }
                                  },
                                "-normal":
                                  { "Normal":
                                    {
                                      "@USE":"VertexNormals"
                                    }
                                  }
                              }
                            }
                        }
                      }
                    ]
                  }
                },
                { "ViewpointGroup":
                  {
                    "@description":"Viewpoints at appropriate distance from model",
                    "-children":[
                      { "Viewpoint":
                        {
                          "@description":"Front view",
                          "@position":[0,0,4]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "#comment":"Default scene display"
          },
          { "Background":
            {
              "@skyColor":[1,1,1]
            }
          },
          { "Transform":
            {
              "@DEF":"AvoidCoplanarAliasing",
              "@translation":[0,0,0.1],
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "Text":
                        {
                          "@string":["X3D","Mesh","Design","Pattern"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@family":["SANS"],
                                "@justify":["MIDDLE","MIDDLE"],
                                "@size":0.4,
                                "@style":"BOLD"
                              }
                            }
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[0.3,0.7,0.7]
                              }
                            }
                        }
                      }
                  }
                }
              ]
            }
          }
        ]
    }
  }
}