Hey!
Thank you for your reply!
I succeeded in getting my mesh to load as a .obj file. I figured out that if the normal of at least 1 face is pointing inwards, then the mesh will not load. I assume OpenSim will think it has a negative volume? The issue was that my mesh did have a few faces constructed with vertices in a clockwise order. This resulted in faces having an inward pointing normal. I went through the file and corrected this by hand. So now my mesh loads into OpenSim!!
However, I have come across another issue. The skeleton (right/left foot) does not contact with the mesh, it falls right through it.
I have read through the code for the parsers you sent. The .obj parser checks for the v and f line, but my .obj has a vn ... for vertex normals:
Code: Select all
v x1 y1 y2
v x2 y2 z2
v ...
vn xn1 yn1 yn2
vn xn2 yn2 zn2
vn ...
f v1//vn1 v2//vn1 v3//vn1
f ...
My question is: how does OpenSim compute the normals for the surface of contact? Is as dependent on the order of the vertices given in the f ... lines as I thought, or does the parser make use of the vn ... lines inside the .obj? I have not noticed any difference yet, but would it matter if the faces are triangles or quads?
I have tried converting my working .obj file to both .stp and .vtp, both of which do not make contact with the skeleton.
The image shows the contact geomteries in blue. Each foot has their respective heel, toe1, and toe2 as contact points. The code shows that I have included the contact mesh (ramp_c) inside the Hunt Crossley force set along side the others.
Code: Select all
<HuntCrossleyForce::ContactParameters>
<!--Names of geometry objects affected by these parameters.-->
<geometry>ramp_c r_heel r_toe1 r_toe2</geometry>
<stiffness>500000</stiffness>
<dissipation>1.0</dissipation>
<static_friction>0.8</static_friction>
<dynamic_friction>0.8</dynamic_friction>
<viscous_friction>0</viscous_friction>
</HuntCrossleyForce::ContactParameters>