rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
715 stars 342 forks source link

Remove normals from assimp #1176

Closed cielavenir closed 1 year ago

cielavenir commented 1 year ago

https://www.dropbox.com/s/7f0g474xf9nb5wm/teapot.stl

without my patch:

openrave.py --viewer= -p 'mesh=env.GetBodies()[0].GetLinks()[0].GetGeometries()[0].GetCollisionMesh(); print("triangles=%d, vertices=%d"%(len(mesh.indices),len(mesh.vertices))); exit()' ~/Downloads/teapot.stl 
triangles=894, vertices=2310

with my patch:

openrave.py --viewer= -p 'mesh=env.GetBodies()[0].GetLinks()[0].GetGeometries()[0].GetCollisionMesh(); print("triangles=%d, vertices=%d"%(len(mesh.indices),len(mesh.vertices))); exit()' ~/Downloads/teapot.stl
triangles=894, vertices=480

this causes two issues:

  1. larger msgpack size
  2. potential performance issue

The core issue is that aiProcess_JoinIdenticalVertices does not work well if the stl has normals because JoinIdenticalVertices considers the normals value as vertex normals while assimp STLLoader loads triangle normals. According to https://github.com/assimp/assimp/issues/407 , we need to remove normals component during import.

cielavenir commented 1 year ago

tested on:

rdiankov commented 1 year ago

cool, thanks~