X3D (.x3d)
Background & Context

-
- MIME type: model/x3d+xml
- Web3D geometry format.
- Commonly used for distributing 3D models on the web and in media applications.
- XML format.
- Can store multiple geometries.
- Introduced in 2003, maintained by the Web3D Consortium.
- Successor of the VRML format.
Import & Export

- Import["file.x3d"] imports an X3D file as a MeshRegion object representing the surface.
- Import["file.x3d",elem] imports the specified element from an X3D file.
- The import format can be specified with Import["file","X3D"] or Import["file",{"X3D",elem,…}].
- Export["file.x3d",expr] exports a 3D mesh-based geometric region to a X3D file. The expr can be any region that is ConstantRegionQ or a Graphics or Graphics3D object.
- The export format can be specified with Export["file",expr,"X3D"] or Export["file",expr,{"X3D",opt1->val1,…}].
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements

- General Import elements:
-
"Elements" list of elements and options available in this file "Rules" list of rules for all available elements "Summary" summary of the file - Data format representation elements:
-
"LineData" lines represented as lists of indices, referencing the vertices as given by the "VertexData" element "PointData" point data in indexed form "PolygonData" list of polygon elements in indexed form "VertexData" list of vertex coordinates "VertexNormals" normal vectors corresponding to the vertices given by "VertexData" - Geometry representation elements:
-
"BoundaryMeshRegion" boundary mesh representation of a solid "MeshRegion" mesh representation of a surface "Region" region representation of a surface - Graphics representation elements:
-
"Graphics3D" X3D file represented as a Graphics3D object "GraphicsComplex" X3D file as a GraphicsComplex object "LineObjects" list of Line primitives given in absolute coordinates "PointObjects" list of Point primitives given in absolute coordinates "PolygonObjects" list of polygon primitives in absolute coordinates - Import and Export use the "MeshRegion" element by default for X3D files.
Options

- Advanced options:
-
"InvertNormals" False whether to invert the orientation of vertex normals "VerticalAxis" {0,0,1} orientation to assume for the coordinate system used in the file - By default, the Wolfram Language assumes that in the coordinate system used by the X3D format, the vertical axis corresponds to the third coordinate.
- With the setting "VerticalAxis"->{0,1,0}, the Wolfram Language will apply the transformation {x,y,z}->{x,z,-y} to all graphics coordinates when exporting to X3D.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Import a 3D model from X3D as a MeshRegion object:
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-deolm1
Out[1]=1

"Summary" properties of the solid model:
In[2]:=2

✖
https://wolfram.com/xid/0ck8v4qn-gdt10
Out[2]=2

Export a 3D model to an ASCII X3D file:
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-c0v43p
Out[1]=1

Print the raw textual contents of the file:
In[2]:=2

✖
https://wolfram.com/xid/0ck8v4qn-b11wj
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-g0bmlf
Out[1]=1

Scope (8)Survey of the scope of standard use cases
Import (4)
Import works on X3D file:
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-qzdt5a
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-gleixe
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-tgzw4
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0ck8v4qn-care6j
Out[2]=2

In[3]:=3

✖
https://wolfram.com/xid/0ck8v4qn-ll8we5
Out[3]=3

Import provides access to elements in the X3D file:
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-obu11p
Out[1]=1

Export (4)
Export works on 3D graphics:
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-mxwdw8
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-ev3xsy
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-dn22q2
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-b625h6
Out[1]=1

Import Elements (13)
"BoundaryMeshRegion" (1)
"Graphics3D" (1)
"GraphicsComplex" (1)
"MeshRegion" (1)
"LineData" (1)
"LineObjects" (1)
"PointData" (1)
"PointObjects" (1)
"PolygonData" (1)
"PolygonObjects" (1)
Give the list of Polygon primitives given in absolute coordinates:
In[1]:=1

✖
https://wolfram.com/xid/0ck8v4qn-6nbuok
