Regular API function

simGetShapeMesh / sim.getShapeMesh

Description Retrieves a shape's mesh information. See also sim.getShapeViz, sim.createShape and sim.exportMesh for a usage example.
C/C++
synopsis
int simGetShapeMesh(int shapeHandle,double** vertices,int* verticesSize,int** indices,int* indicesSize,double** normals)
C/C++
parameters
shapeHandle: handle of the shape
vertices: receives the vertices. The user is in charge of destroying the array with simReleaseBuffer. See simExportMesh for a usage example.
verticesSize: receives the size of the vertices array. See simExportMesh for a usage example.
indices: receives the indices. The user is in charge of destroying the array with simReleaseBuffer. See simExportMesh for a usage example.
indicesSize: receives the size of the indice array. See simExportMesh for a usage example.
normals: receives the normals (3 times the size of indicesSize). The user is in charge of destroying the array with simReleaseBuffer. Can be nullptr.
C/C++
return value
-1 if operation was not successful
Lua
synopsis
float[] vertices,int[] indices,float[] normals=sim.getShapeMesh(int shapeHandle)
Lua
parameters
shapeHandle: handle of the shape. See sim.exportMesh for a usage example.
Lua
return values
vertices: table of vertices
indices: table of indices
normals: table of normals
Python
synopsis
list vertices,list indices,list normals=sim.getShapeMesh(int shapeHandle)