BYU (.byu)

  • Import and Export fully support the BYU format.
  • Background & Context

      3D geometry format.
      Used for visualization of 3D polygonal meshes in CAD systems and other applications.
      BYU is an acronym for Brigham Young University.
      ASCII format.
      Represents 3D objects as collections of polygon primitives.
      Can store multiple 3D objects.

    Import and Export

    • Import["file.byu"] imports a BYU file as a Graphics3D object.
    • Export["file.byu",expr] exports a Graphics3D expression to a BYU file.
    • Import["file.byu"] returns an expression of the form Graphics3D[GraphicsComplex[vertices,primitives,opts]].
    • Import["file.byu",elem] imports the specified element from a BYU file.
    • Import["file.byu",{elem,suba,subb,}] imports a subelement.
    • Import["file.byu",{{elem1,elem2,}}] imports multiple elements.
    • The import format can be specified with Import["file","BYU"] or Import["file",{"BYU",elem,}].
    • Export["file.byu",expr,elem] creates a BYU file by treating expr as specifying element elem.
    • Export["file.byu",{expr1,expr2,},{{elem1,elem2,}}] treats each expri as specifying the corresponding elemi.
    • Export["file.byu",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
    • Export["file.byu",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
    • See the reference pages for full general information on Import and Export.
    • ImportString and ExportString support the BYU format.


    • General Import elements:
    • "Elements"list of elements and options available in this file
      "Rules"full list of rules for each element and option
      "Options"list of rules for options, properties, and settings
    • Graphics elements:
    • "Graphics3D"BYU file represented as a Graphics3D object
      "GraphicsComplex"list of GraphicsComplex objects, each representing a 3D geometry stored in the file
    • Import and Export use the "Graphics3D" element by default for BYU files.
    • Data representation elements:
    • "PolygonData"the polygon data in indexed form
      "PolygonObjects"list of Polygon primitives given in absolute coordinates
      "VertexData"list of vertex coordinates
    • Import with a data representation element returns a list whose elements correspond to the geometry objects stored in the file.
    • Import["file.byu",{"PolygonData",n}] gives the polygon data of the n^(th) geometry object.


    • 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 BYU.
    • Advanced option:
    • "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 BYU 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 BYU, and the inverse transformation when exporting to BYU.


    open allclose all
    Basic Examples  (0)

    Scope (3)

    This imports a simple BYU file and renders it as 3D graphics:

    Click for copyable input

    Import the GraphicsComplex object representing this sample file:

    Click for copyable input

    Read the vertex coordinates:

    Click for copyable input

    Import the corresponding polygon information:

    Click for copyable input

    Convert the sample file to a list of Polygon primitives:

    Click for copyable input

    Use ParametricPlot3D to create a 3D geometry:

    Click for copyable input

    Export it to BYU:

    Click for copyable input

    Export inline 3D graphics:

    Click for copyable input

    See Also

    "3DS"  "JVX"  "LWO"  "Maya"  "OBJ"  "OFF"  "PLY"  "POV"  "RIB"  "STL"  "X3D"

    Introduced in 2007