BYU (.byu)
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 & Export
- Import["file.byu"] imports a BYU file as a MeshRegion object representing the surface.
- Import["file.byu",elem] imports the specified element from a BYU file.
- The import format can be specified with Import["file","BYU"] or Import["file",{"BYU",elem,…}].
- Export["file.byu",expr] exports a 3D mesh-based geometric region to a binary BYU 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,"BYU"] or Export["file",expr,{"BYU",opt1val1,…}].
- 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 "Summary" summary of the file "Rules" list of rules for all available elements - Data format representation elements:
-
"VertexData" list of vertex coordinates "PolygonData" the polygon data in indexed form - Geometry representation elements:
-
"BoundaryMeshRegion" boundary mesh representation of a solid "MeshRegion" mesh representation of a surface "Region" region representation of a surface - Graphics elements:
-
"Graphics3D" BYU file represented as a Graphics3D object "GraphicsComplex" list of GraphicsComplex objects "PolygonObjects" list of polygon primitives in absolute coordinates - Import and Export use the "MeshRegion" element by default for BYU files.
Examples
open all close allBasic Examples (3)
Import a 3D model from BYU as a MeshRegion object:
Import["ExampleData/seashell.byu"]"Summary" properties of the solid model:
Import["ExampleData/seashell.byu", "Summary"]Export a 3D model to an ASCII BYU file:
Export["model.byu", [image]]Print the raw textual contents of the file:
FilePrint[%]Scope (11)
Import (6)
Import works on a BYU file:
Import["ExampleData/chain.byu"]Import["http://exampledata.wolfram.com/vase.byu"]str = OpenRead["ExampleData/spikey.byu"]Import[str]Close[str]Import automatically detects BYU files:
Import["http://exampledata.wolfram.com/gear.10"]Import provides access to elements in the BYU file:
Import["ExampleData/seashell.byu", "Elements"]Import works on large files:
Import["http://exampledata.wolfram.com/turtle.byu"]// MeshCellCount//AbsoluteTimingExport (5)
Export works on 3D graphics:
Export["model.byu", [image]]Export["sphere.byu", Graphics3D[Sphere[]]]Export["ball.byu", ImplicitRegion[x ^ 2 + y ^ 2 + z ^ 2 ≤ 1, {x, y, z}]]Export["pyramid.byu", MeshRegion[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}, {0, 0, 1}}, Pyramid[{1, 2, 3, 4, 5}]]]Export["model.byu", [image]]Import Elements (9)
"BoundaryMeshRegion" (1)
Give a BoundaryMeshRegion:
Import["ExampleData/spikey.byu", "BoundaryMeshRegion"]"Graphics3D" (1)
Give the Graphics3D object:
Import["ExampleData/spikey.byu", "Graphics3D"]"GraphicsComplex" (1)
Give the GraphicsComplex object:
Import["ExampleData/spikey.byu", "GraphicsComplex"]"MeshRegion" (1)
Give the MeshRegion:
Import["ExampleData/spikey.byu", "MeshRegion"]"PolygonData" (1)
"PolygonObjects" (1)
Give the list of Triangle primitives given in absolute coordinates:
Import["ExampleData/spikey.byu", "PolygonObjects"] // Short"Region" (1)
Give a Region:
Import["ExampleData/spikey.byu", "Region"]"Summary" (1)
History
Introduced in 2007 (6.0) | Updated in 2020 (12.2)