JVX (.jvx)

Background & Context

    • JavaView 3D geometry format.
    • Native format of the JavaView visualization software.
    • Used for the visualization of 2D or 3D geometries.
    • Can be embedded in web pages and viewed with the JavaView applet.
    • XML format.
    • Can store multiple geometries.
    • Represents 2D or 3D objects as a collection of polygons, lines, and points.

Import & Export

  • Import["file.jvx"] imports a JVX file as a Graphics or Graphics3D object.
  • Export["file.jvx",expr] exports a Graphics or Graphics3D object to JVX.
  • For JVX files containing 3D objects, Import["file.jvx"] returns an expression of the form Graphics3D[ GraphicsComplex[vertices,polygons,opts]], where vertices are given as a list of coordinates, and the polygons are represented as integer indices taken to be the corresponding vertices.
  • 2D objects are imported as an expression of the form Graphics[ GraphicsComplex[]].
  • Import["file.jvx",elem] imports the specified element from a JVX file.
  • Import["file.jvx",{elem,suba,subb,}] imports a subelement.
  • Import["file.jvx",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","JVX"] or Import["file",{"JVX",elem,}].
  • Export["file.jvx",expr,elem] creates a JVX file by treating expr as specifying element elem.
  • Export["file.jvx",{expr1,expr2,},{elem1,elem2,}] treats each expri as specifying the corresponding elemi.
  • Export["file.jvx",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • Export["file.jvx",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Graphics"two-dimensional objects in a JVX file represented as Graphics objects
    "Graphics3D"3D geometry represented as Graphics3D
    "GraphicsComplex"list of GraphicsComplex objects, each representing a geometry stored in the file
    "LineData"lines represented as lists of indices, referencing the vertices as given by the "VertexData" element
    "LineObjects"list of Line primitives given in absolute coordinates
    "PointData"point data in indexed form
    "PointObjects"list of Point primitives given in absolute coordinates
    "PolygonData"polygon data in indexed form
    "PolygonObjects"list of Polygon primitives given in absolute coordinates
    "VertexColors"colors associated with each vertex, given as a list of color primitives
    "VertexData"list of vertex coordinates
    "VertexNormals"normal vectors corresponding to the vertices given by "VertexData"
  • Import and Export by default use "Graphics3D" for the JVX files containing 3D geometries, and "Graphics" for files that represent two-dimensional content.
  • When rendering a JVX file representing a color model, Import automatically uses the setting Lighting->"Neutral".
  • Import elements, specifying meta-information:
  • "CreationDate"time and date when the file was exported
    "Creator"application that generated the file


  • General Import options:
  • BackgroundAutomaticwhat background color to use
    ImageSizeAutomaticoverall size of the graphics to display
    LightingAutomaticwhat simulated lighting to use in coloring 3D surfaces
  • All options of Graphics3D can be given when importing from JVX.
  • Meta-information elements, available for Import and Export:
  • "Version"""optional version information for the file content, given as a string
    "Keywords"{}keywords associated with the stored objects
    "ShortSummary"""brief description of the file content
    "Summary"""description of the file content
    "Title""Mathematica Graphics"document title
  • Import option:
  • "ReadDTD"Falsewhether to validate the file against the DTD format specification
  • Advanced options:
  • "InvertNormals"Falsewhether 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 JVX 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 importing from JVX, and the inverse transformation when exporting to JVX.


Basic Examples  (3)

Import a JVX sample file and render it as 3D graphics:

This imports a JVX file representing 2D vector graphics:

Create a 3D model using SphericalPlot3D, and export it to JVX: