此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

OFF (.off, .coff, .noff, .cnoff)

OFF 3D geometry format.
Used for storing and exchanging 3D models.
OFF is an acronym for Object File Format.
Occasionally called COFF if color information is present.
Related to NOFF and CNOFF.
ASCII or binary format.
Represents a single 2D or 3D object.
Stores a collection of planar polygons with possibly shared vertices.
Supports polygon and vertex colors and opacity specifications.
  • Import and Export support ASCII and binary versions of the OFF file format.
  • Mathematica can read and write vertex or face colors.
  • If both vertex and face colors are present in the file, Import returns the vertex color information.
  • Importimports an OFF file as graphics.
  • Export exports graphics to a binary OFF file.
  • Import imports the specified element from an OFF file.
  • Import imports multiple elements.
  • Export creates a binary OFF file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"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
  • Data representation elements:
"Graphics"2D OFF file represented as a Graphics object
"Graphics3D"3D geometry represented as a Graphics3D object
"GraphicsComplex"OFF file as a GraphicsComplex object
"PolygonColors"face color information, given as a list of color primitives associated with each polygon
"PolygonData"the polygon elements 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
  • Import and Export by default use the element to represent 3D geometries, and the element for two-dimensional objects.
  • When rendering an OFF color model, Import automatically uses the setting Lighting->"Neutral".
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 OFF.
  • Detailed properties and settings:
"BinaryFormat"Truewhether the file is in ASCII or binary format
"InvertNormals"Falsewhether to invert the orientation of vertex normals
"VerticalAxis"{0,0,1}orientation to assume for the coordinate system used in the file
  • Binary OFF files store information as and data types, always using the setting .
  • By default, Mathematica assumes that in the coordinate system used by the OFF format the vertical axis corresponds to the third coordinate.
  • With the setting , Mathematica will apply the transformation to all graphics coordinates when importing from OFF, and the inverse transformation when exporting to OFF.
This imports a 3D model of a seashell:
Import a simple OFF file that contains vertex color data:
Extract the vertex colors:
Import the vertex coordinates:
Read the corresponding polygon data:
Export a 3D model with transparent surfaces:
This imports a 3D model of a seashell:
In[1]:=
Click for copyable input
Out[1]=
 
Import a simple OFF file that contains vertex color data:
In[1]:=
Click for copyable input
Out[1]=
Extract the vertex colors:
In[2]:=
Click for copyable input
Out[2]=
Import the vertex coordinates:
In[3]:=
Click for copyable input
Out[3]=
Read the corresponding polygon data:
In[4]:=
Click for copyable input
Out[4]=
 
Export a 3D model with transparent surfaces:
In[1]:=
Click for copyable input
Out[1]=