OBJReader

class compas.files.OBJReader(filepath)[source]

Bases: object

Read the contents of an obj file.

Parameters

filepath (path string, file-like object or URL string) – A path, a file-like object or a URL pointing to a file.

Attributes
  • vertices (list) – Vertex coordinates.

  • weights (list) – Vertex weights.

  • textures (list) – Vertex textures.

  • normals (list) – Vertex normals.

  • points (list) – Point objects, referencing the list of vertices.

  • lines (list) – Line objects, referencing the list of vertices.

  • faces (list) – Face objects, referencing the list of vertices.

  • curves (list) – Curves

  • curves2 (list) – Curves

  • surfaces (list) – Surfaces

  • objects (dict) – The named objects.

  • groups (dict) – The named polygon groups.

Notes

For more info, see 1.

References

1

Bourke, P. Object Files. Available at: http://paulbourke.net/dataformats/obj/.

Methods

open

post

pre

read

Read the contents of the file, line by line.