well the are lot of problem there. firs off all the input mesh is wrong I save the mesh as an
.off file using this function
NewtonMeshSaveOFF (convexAproximation, "xxxxx.off");
this is how it looks like, you are getting is what is being input
- Untitled.png (15.77 KiB) Viewed 7693 times
The second problem is that the mesh I tiny is if the order of centimeters is size and you using the process all backward. You are making a collision tree and converting it to a newtonmesh, however the process that builds a collision tree, condition the mesh for better collision, so I am guessing the all the missing polygons are filtered out by the collision tree builder because the as too small.
you should do it the other way around, use the NewtonMesh to create the mesh. the once you Mesh you can do few thing to the mesh, you can bake a scale on it, or you can optimize it if you want.
the to make the Compound collision you nee to create a convex decomposition by calling this function first
NEWTON_API NewtonMesh* NewtonMeshApproximateConvexDecomposition (const NewtonMesh* const mesh, dFloat maxConcavity, dFloat backFaceDistanceFactor, int maxCount, int maxVertexPerHull, NewtonReportProgress reportProgressCallback, void* const reportProgressUserData);
then after your mesh has being processed, the you can now call
NewtonCreateCompoundCollisionFromMesh to make a compound.
you are doing the worse possible way, there is no need to make a collision tree as intermediate step