Trying to create an stl-file to be used in ContactMesh, but my python script ends with:
Code: Select all
Traceback (most recent call last):
File "/home/sietse/Roeien/Modelling/OpenSim/MyCode/Pusher/pusher.py", line 170, in <module>
blad = osim.ContactMesh('brick.stl',
File "/home/sietse/Software/OpenSim/opensim/sdk/Python/opensim/simulation.py", line 14443, in __init__
_simulation.ContactMesh_swiginit(self, _simulation.new_ContactMesh(*args))
RuntimeError: std::exception in 'OpenSim::ContactMesh::ContactMesh(std::string const &,SimTK::Vec3 const &,SimTK::Vec3 const &,OpenSim::PhysicalFrame const &)': SimTK Exception thrown at ContactGeometry_TriangleMesh.cpp:451:
Bad call to Simbody API method ContactGeometry::TriangleMesh::Impl::TriangleMesh::Impl(): Multiple faces have an edge between vertices 0 and 2 in the same order.
(Required condition 'backwardEdges.find(pair<int, int>(edges[j][1], edges[j][0])) == backwardEdges.end()' was not met.)
![Sad :(](./images/smilies/icon_e_sad.gif)
Using python and the stl-library from [url]https://github.com/WoLpH/numpy-stl[url] I created a simple box. This is an example screenshot that I took with paraview. Note that the bottom side has more triangles than the other sides.
The idea is that this side it the one to make contact with similar surfaces. One such surface is large, so I create a large number of triangles to make ElasticFoundationForce work better (I hope).
I think the mesh-file is correct, but there probably are additional requirements on how the triangles are to be placed.
Maybe the order in which I describe the triangles or faces?
Added the python script for completeness.
Thanks in advance, Sietse