-
Hi Bender, I tried to do some simulations of gear collision by inputting their geometry by initializing an instance of pbd.IndexedFaceMesh and use addFace(). However, I got the following error. TypeError: addFace(): incompatible function arguments. The following argument types are supported: Invoked with: <pypbd.IndexedFaceMesh object at 0x000001E97C958F30>, 1, 1, 2 Furthermore, I, otherwise, tried inputting a range of list like the following:
However, it returned the following strange big number for every alternate index positions 1 and 2: Would you please tell me how to input the arguments and format the data beforehand? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
The function addFace requires 3 indices per triangle. However, you call it with just one int. So probably the remaining two indices are just random numbers. Can you try to call the function with something like this: addFace([1,2,3]) |
Beta Was this translation helpful? Give feedback.
-
It seems to be a pointer. Probably I have to adapt the Python interface. I will take a look next week. |
Beta Was this translation helpful? Give feedback.
-
I tried hard and worked till now for many different possible combinations but in vain. Yes, thanks for your suggestion that it maybe a pointer for the integers. it looks python does not deal with the pointer, am I right? |
Beta Was this translation helpful? Give feedback.
-
I just fixed the Python interface of the function. Now you should be able to add a face by calling: addFace([1,2,3]) This will add a triangle with the vertex indices 1,2 and 3. |
Beta Was this translation helpful? Give feedback.
-
This should work. And of course then you have to recompile it. pip install pypbd |
Beta Was this translation helpful? Give feedback.
I just fixed the Python interface of the function. Now you should be able to add a face by calling:
addFace([1,2,3])
This will add a triangle with the vertex indices 1,2 and 3.