zanoni-mbdyn / blendyn

MBDyn (https://www.mbdyn.org/) graphical post-processor for blender (https://www.blender.org/)
GNU General Public License v2.0
40 stars 8 forks source link

Add Deformable Joints #26

Closed janga1997 closed 4 years ago

janga1997 commented 7 years ago

Do be sure to install the addon Add Curve:Extra Objects before trying out this PR. Just type extra in the search bar of the Add-ons tab, and you should find the add-on.

zanoni-mbdyn commented 7 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).

janga1997 commented 7 years ago

@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.

janga1997 commented 7 years ago

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

janga1997 commented 7 years ago

@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)

janga1997 commented 7 years ago

The size of all the deformable joints is still an issue. I will try to figure out a way for appropriate scaling.

zanoni-mbdyn commented 4 years ago

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.