ASM4 - Fluidity of animation

I don’t have a good fluidity in the animation of my crankshaft . What’s my likely problem?
Thanks for yours returns
Simplified crankshaft for 3 cylinders at 120°

OS: Windows 11 build 22631
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.35485 (Git)
Build type: Release
Branch: main
Hash: a662fbb2ff267fb8dd56fcc3d1ec55a5968b7f5a
Python 3.10.13, Qt 5.15.8, Coin 4.0.2, Vtk 9.2.6, OCC 7.6.3
Locale: French/France (fr_FR)
Installed mods:
* Assembly4 0.50.6

I finally understand what you mean by “fluidity”.

You have applied the rotation constraint variable to the body link’s assembly LCS. When you attach another body to this link with the same LCS then it will also rotate but RELATIVE to the one to which it is attached. So, each successive body rotates faster with respect to the global origin.

You can treat this as a sub-assembly and apply a rotation constraint to the parent LCS like that shown in the attached file. Or, make a linear array and rotate the array. Or, change the link element count to 3, locate each element appropriately using its placement, and then rotate the original link attachment offset. Or, rotate only the first body link using its assembly attachment offset property. Your choice, many ways to do this.

test.gif
ASM4_Vilebrequin2.FCStd

Hi
I will try to apply this. This is not obvious. As you point out, there are several possibilities with different results.
I continue to test on my simple pieces and I will find the right way to proceed.
Thanks

After testing your file, the fluidity on my machine does not correspond to that of your video. She is always very slow.
But by removing the attached variable a_rotation in Tourillon001 LCS1 I gained fluidity. So depending on the fluidity of the animation it will be necessary to review the positioning of the LCS. I think with experience we no longer ask this kind of question.
Do you have any ideas on how I can improve my fluidity?
Sincerely

Are you talking about the animator itself or the Save function which creates the .GIF file? The animator is indeed slow depending upon the step size. The GIF Save function speeds up the animation depending upon the frames per second (FPS) setting.
These are settings I used for the video:
Screenshot 2024-01-11 080708.jpg

Thanks for this precision

For the animation program which creates the .GIF file impossible to use for me. I always encounter this problem. https://devtalk.freecad.org/t/is-eigen2-still-a-prerequisite/752/1 If necessary, I use the stable version of FreeCAD.
If you have a solution, I’m interested

Syres

I have the same problem with the development weekly versions lately so I have to fall back to this version or the original V0.21 stable as you.
Works OK here:

OS: Windows 11 build 22621
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.34959 (Git)
Build type: Release
Branch: main
Hash: 640018bfa7878a79e1b3c220ddd488d66464dc70
Python 3.10.13, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods:

  • Assembly4 0.50.6
  • fasteners 0.4.15
  • freecad.gears 1.1.0
  • QuickMeasure 2022.10.28

It will also not run for me on Windows V0.21.2.33771 bug fix so I’m guessing that something has happened since the V0.21 release.
Runs OK here:

OS: Windows 11 build 22621
Word size of FreeCAD: 64-bit
Version: 0.21.0.33668 +7 (Git)
Build type: Release
Branch: (HEAD detached at 0.21)
Hash: 41b058e2087de60dc8fef3d3e68c7d0129e13abf
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.50.6
  * fasteners 0.4.15
  * freecad.gears 1.1.0
  * QuickMeasure 2022.10.28

I have no other solution other than what Zolko and Syres have suggested but I have not tried that. Sounds complicated.

I only keep the last 10 versions of FreeCAD weekly. How can I find the oldest ones on GitHub?

I do not know. I searched github too. Perhaps looo can tell us what is available and where.

If nothing else, I can send you a Dropbox link for a copy of that specific Windows version 0.22.0dev.34959 you referenced.

I would like to please on my @. Thank you so much

What the Conda packager will need to know (not me) is the version number of cv2 that works in build 34959 by entering the following in the Python Console:

import cv2
cv2.__version__

and reply with the output and mention adrianinsaval

With Conda (and I guess other packaging software) the version of each package can be pinned so it doesn’t increase until we can find a newer version that works correctly.

adrianinsaval

import cv2
cv2.version
‘4.8.1’

Thanks for responding so quickly.

what error do you get and doing what?

it doesn’t look like opencv is the problem, the error is reported incorrectly by assembly4 because it has two imports in the same try block but assumes that if importing anything fails it’s opencv. This is the line that fails:
https://github.com/Zolko-123/FreeCAD_Assembly4/blob/e65011002a2f57f575824a8d46d42d04757d65b4/AnimationLib.py#L479

import AnimationExportLib
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/tmp/.mount_FreeCAZJRDdo/usr/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/feature.py", line 139, in _import
    return original_import(name, *args, **kwargs)
  File "/home/adrian/.local/share/FreeCAD/Mod/Assembly4/./AnimationExportLib.py", line 13, in <module>
    from PIL.ImageQt import ImageQt
ImportError: cannot import name 'ImageQt' from 'PIL.ImageQt' (/tmp/.mount_FreeCAZJRDdo/usr/lib/python3.10/site-packages/PIL/ImageQt.py)

which then leads to https://github.com/Zolko-123/FreeCAD_Assembly4/blob/e65011002a2f57f575824a8d46d42d04757d65b4/AnimationExportLib.py#L13

the problem is that pillow has depecrated qt5 and removed support in pillow 10, so we would need to downgrade pillow to 9.5 but I’m not sure how viable that is. I’ll check this out.

Zolko
Bernard19
Vincent B

The ‘Save’ function of the Assembly4 animator complains that CV2 is not installed and prevents saving the animation. Works OK in the following weekly and V0.21.1.33377 stable but not in V0.21.2 or later weekly versions:

OS: Windows 11 build 22621
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.34959 (Git)
Build type: Release
Branch: main
Hash: 640018bfa7878a79e1b3c220ddd488d66464dc70
Python 3.10.13, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods:

  • Assembly4 0.50.6
  • fasteners 0.4.15
  • freecad.gears 1.1.0
  • QuickMeasure 2022.10.28



Thank you for any assistance. This is a frequently used function.

Do you want us to issue a bug report on Git?

do it at https://github.com/FreeCAD/FreeCAD-Bundle/ please since this is strictly about packaging

Done…https://github.com/FreeCAD/FreeCAD-Bundle/issues/208

This is very good, a solution is coming soon…

fixed, new bundles should be up shortly