Closed janga1997 closed 4 years ago
That was a simple example that works well for angles between 0 and 90°. For a full 360° capable spring, we should probably move to a complete circle, defined by 9 points on a square (the first and the last are coincident).
@zanoni-mbdyn That should work. I found a very simple package which I think does calculations for NURBS curves. Maybe I can adapt his code for our much simpler use case.
After a lot of headbanging (I couldn't find a way to calculate nurbs' points locations, I had to do it myself),
I think its close to completion.
defhinge.zip
This is an animation I made just now after making a lot of changes to defhingejlib.py
.
The shape is not a perfect circle (due to the weight of points I assume) but the angles are correct.
Edit: Here is an animation for a deformable joint. (With 6 springs, 3 rotational, and 3 displacement) defjoint.zip
@zanoni-mbdyn @louisgag I added the code to calculate Nurbs points locations in a different file. Just uncomment all the lines regarding plotting if you want to test it. It will generate a scatter plot with all the locations of all the 9 Nurbs points. I tested it with both +ve and -ve angles, and the critical cases( 0deg, 360deg, >360, <-360, and every 90deg step from 0 to (+/-)360)
The size of all the deformable joints is still an issue. I will try to figure out a way for appropriate scaling.
Leaving this aside for the moment. I think that a simpler approach is probably better, and I've started to do so with the deformable displacement joint.
Do be sure to install the addon
Add Curve:Extra Objects
before trying out this PR. Just typeextra
in the search bar of theAdd-ons
tab, and you should find the add-on.