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)
Import a 3D model from X3D as a MeshRegion object:
"Summary" properties of the solid model:
Export a 3D model to an ASCII X3D file:
Scope (8)
Import Elements (13)
"BoundaryMeshRegion" (1)
Give a BoundaryMeshRegion:
"Graphics3D" (1)
Give the Graphics3D object:
"GraphicsComplex" (1)
Give the GraphicsComplex object:
"MeshRegion" (1)
Give a MeshRegion:
"PolygonObjects" (1)
Give the list of Polygon primitives given in absolute coordinates:
"Region" (1)
Give a Region: