Skip to content

IndexError during triangulate #4

@andyli

Description

@andyli

I tried to convert my obj file to collada, with the triangulate filter, it fails with error:

$ meshtool --load_obj wall_and_door.obj --save_collada wall_and_door.dae --triangulate
Warning: filter 'viewer' disabled because of ImportError: No module named direct.task
Warning: filter 'collada_viewer' disabled because of ImportError: No module named direct.task
Warning: filter 'pm_viewer' disabled because of ImportError: No module named direct.task
Warning: filter 'sander_simplify' disabled because of ImportError: No module named networkx
Warning: filter 'save_screenshot' disabled because of ImportError: No module named direct.task
Warning: filter 'save_rotate_screenshots' disabled because of ImportError: No module named direct.task
Warning: filter 'save_bam' disabled because of ImportError: No module named direct.task
MISSING MTL LINE Ni 1
MISSING MTL LINE Ni 1
MISSING MTL LINE Ni 1
Traceback (most recent call last):
  File "/usr/local/bin/meshtool", line 9, in <module>
    load_entry_point('meshtool==0.3', 'console_scripts', 'meshtool')()
  File "/usr/local/lib/python2.7/dist-packages/meshtool/__main__.py", line 88, in main
    collada_inst = inst.apply(collada_inst, *arguments)
  File "/usr/local/lib/python2.7/dist-packages/meshtool/filters/optimize_filters/triangulate.py", line 19, in apply
    triangulate(mesh)
  File "/usr/local/lib/python2.7/dist-packages/meshtool/filters/optimize_filters/triangulate.py", line 9, in triangulate
    triprims.append(prim.triangleset())
  File "/usr/local/lib/python2.7/dist-packages/collada/polylist.py", line 251, in triangleset
    self.index[indexselector+1],
IndexError: index 40 is out of bounds for axis 0 with size 40

The model I used can be found at
https://github.com/andyli/aframe-test/tree/1fe0f0cc8af332b9a8c7880437a8678e99e3b6e2/wall_and_door

I'm using pycollada 0.4.1, meshtool 0.3.

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