Skip to content

Loses the information whether the faces are triads or quads #4

@bvraghav

Description

@bvraghav
  • wavefront_reader version: 0.2.2
  • Python version: 3.7.1
  • Operating System: Linux (arch x64)

Description

I was trying to read a cube exported as obj from blender. Which exports quads. But the obj reader does not retain the information whether it is quad or triads...

What I Did

import wavefront_reader
mesh = read_wavefront('/path/to/cube.obj')
print(mesh)
  'usemtl': 'Material',
  's': 'off',                                                                                                                                      
  'v': array([[ 1.      , -1.      , -1.      ],                                                                                                   
         [ 1.      , -1.      ,  1.      ],
         [-1.      , -1.      ,  1.      ],
         [-1.      , -1.      , -1.      ],
         [ 1.      ,  1.      , -0.999999],
         [-1.      ,  1.      , -1.      ],
         [-1.      ,  1.      ,  1.      ],
         [ 0.999999,  1.      ,  1.000001],                                                                                                        
         [ 1.      , -1.      , -1.      ],                                                                                                        
         [ 1.      ,  1.      , -0.999999],
         [ 0.999999,  1.      ,  1.000001],
         [ 1.      , -1.      ,  1.      ],
         [ 1.      , -1.      ,  1.      ],
         [ 0.999999,  1.      ,  1.000001],
         [-1.      ,  1.      ,  1.      ],
         [-1.      , -1.      ,  1.      ],
         [-1.      , -1.      ,  1.      ],
         [-1.      ,  1.      ,  1.      ],
         [-1.      ,  1.      , -1.      ],
         [-1.      , -1.      , -1.      ],
         [ 1.      ,  1.      , -0.999999],
         [ 1.      , -1.      , -1.      ],
         [-1.      , -1.      , -1.      ],
         [-1.      ,  1.      , -1.      ]]),
  'vt': (),
  'vn': array([[ 0., -1.,  0.], 
         [ 0., -1.,  0.],
         [ 0., -1.,  0.],            
         [ 0., -1.,  0.],
         [ 0.,  1.,  0.],
         [ 0.,  1.,  0.],
         [ 0.,  1.,  0.],
         [ 0.,  1.,  0.],
         [ 1.,  0.,  0.],
         [ 1.,  0.,  0.],
         [ 1.,  0.,  0.],
         [ 1.,  0.,  0.],
         [-0., -0.,  1.],
         [-0., -0.,  1.],
         [-0., -0.,  1.],
         [-0., -0.,  1.],
         [-1., -0., -0.],
         [-1., -0., -0.],
         [-1., -0., -0.],
         [-1., -0., -0.],
         [ 0.,  0., -1.],
         [ 0.,  0., -1.],
         [ 0.,  0., -1.],
         [ 0.,  0., -1.]]),
  'material': {'Ns': 96.078431,
   'Ka': (1.0, 1.0, 1.0),
   'Kd': (0.64, 0.64, 0.64),
   'Ks': (0.5, 0.5, 0.5),
   'Ke': (0.0, 0.0, 0.0),
   'Ni': 1.0,
   'd': 1.0,
   'illum': 2}}}

This object loses the vital information whether the geometry is to be rendered as quad or triad.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions