OBJReader

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

Bases: object

Class for reading raw geometric data from OBJ files.

Parameters

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

Attributes
  • vertices (list[list[float, float, float]]) – List of lists of vertex coordinates.

  • weights (list[float]) – List of vertex weights.

  • normals (list[list[float, float, float]]) – List of lists of normal components.

  • points (list[int]) – List of references to vertex coordinates.

  • lines (list[tuple[int, int]]) – List of pairs of references to vertex coordinates.

  • faces (list[list[int]) – List of lists of references to vertex coordinates.

  • groups (dict[str, tuple[list[int], list[list[int]]]]) – Groups of mesh objects defined by their vertices and faces.

  • objects (dict[str, tuple[list[int], list[list[int]]]]) – Named mesh objects defined by their vertices and faces.

Methods

open

Open the file and read its contents.

post

Post-process the contents.

pre

Pre-process the contents.

read

Read the contents of the file, line by line.