OFF Files

File format

  • Read and write OFF files

Supported features

  • Read OFF ASCII files
  • Vertex positions
Note

The current implementation supports only vertex positions!

Note

The current implementation does not support OFF BINARY!

API

PMesh.createmeshMethod
mesh = createmesh(::OFF[; real_type=Float64, dimx=Val(3), dimu=Val(2)])

Create an empty mesh with all attributes that may be read from an OFF file: position, normal, and texture coordinates:

  • vertex attributes :x, :n, :u, :c
  • face attributes: :n

The latter stores texture coordinates and normals that are defined for each vertex of a face.

Note

This method uses default attribute names :x, :n, :u, :c!

source
PMeshIO.readoffmeshFunction
mesh = readoffmesh(io, template::Mesh[; position=Val(:x))

Read mesh of same type as template from OFF data steam io.

  • position denotes the vertex position attribute in mesh
Note

The current version of readoffmesh supports only the vertex position attribute.

Note

This method is called by readmesh

See also readmesh

source
PMeshIO.writeoffmeshFunction
writeoffmesh(io, mesh[; position=Val(:x), format="%g"])

Write mesh to io in OFF format using attributes

  • position
Note

The current version of writeoffmesh supports only the vertex position attribute.

Pass nothing to ignore an optional attribute. Attributes the are disabled are also ignored, i.e., not written.

The optional format argument specifies the output format of a floating point number as a String using sprintf-syntax.

Note

This method is called by writemesh.

See also writemesh, readoffmesh

source