Assembly 4 workbench

Seems to work OK here:

Screenshot 2023-11-24 124222.jpg

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
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.12.7
  * DynamicData 2.53.0
  * fasteners 0.4.15
  * freecad.gears 1.0.0
  * QuickMeasure 2022.10.28
  * Render 2022.2.0

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.12.7
  • DynamicData 2.53.0
  • fasteners 0.4.15
  • freecad.gears 1.0.0
  • QuickMeasure 2022.10.28
  • Render 2022.2.0

Tested from another computer. Doesn’t work for me.

OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.21.1.33668 +26 (Git)
Build type: Release
Branch: (HEAD detached at 0.21.1)
Hash: f6708547a9bb3f71a4aaade12109f511a72c207c
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/Sweden (en_SE)
Installed mods: 
  * Assembly4 0.50.4
  * fasteners 0.4.67
  * Help 1.0.3
  * InventorLoader 1.4.0
  * kicadStepUpMod 10.20.7
  * Manipulator 1.5.0

I tried it with your version as well and both assembly files still work OK for me with no error reported.

I assume you tried deleting the link and re-assembling it?
You might also try downloading from your own google drive link and see if you get the same error.

Other than that, I am out of suggestions.
Maybe Zolko can help.

I downloaded my own files from Google Drive and put them in another directory. Stil still the same problem.

I added a different file with a single body (diff_Body) and inserted that into the Assembly in my test file measure_test. I see the same results (0 distance) when trying to measure distances between diff_Body.LCS_0 and any of the other LCS’s. Measuring between the edges of any of the bodies works as expected. However, a different oddity occurred when I tried to measure between other_Body001.LCS_001.Y and diff_Body.Pad.Edge4. In this case, the distance reported (5.5mm) appears to be between the Edge4 and (I am guessing) Assembly.LCS_Origin. I have attached a screenshot with this last measurement highlighted. I have also attached the updated test file as well as the different file. Let me know if you need any additional information.
asm4_measure_test_Screenshot_20231127_010810.png

Actually, the entire handling of LCS was wrong. There is a new version out v0.50.6, can you please update and test with your files ? There are probably still some corner cases that I didn’t think of

Zolko leoheck
I had my first opportunity to use the check interference tool V0.50.6. Thank you for this valuable enhancement. It is especially useful during assembly design of mechanisms that have many moving parts. In this example it correctly picked up the interference fits with the handle pad and rivets:

Screenshot 2023-12-07 115427.jpg

The report view did show a number of non-fatal errors however:
ViewProviderExt.cpp(1274): Cannot compute Inventor representation for the shape of Latch_Style_Toggle_Clamp2#Common: Bnd_Box is void
```
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
  • DynamicData 2.54.0
  • fasteners 0.4.15
  • freecad.gears 1.1.0
  • QuickMeasure 2022.10.28
  • Render 2022.2.0

Zolko
I discovered another tool which you may find useful for Assembly4. It is a utility by mnesarco which you can find here: https://github.com/mnesarco/FreeCAD_Utils.

Download the zip file and unzip in the Mod folder of the development version you are running. It will create a folder and a toolbar in the workbench. It is another way to conveniently add variables and animate them using a slider as shown in the following images.
FreeCAD_Utils-main.zip
Picture1.png
Picture3.png
Picture4.png

If anyone would like the assembly file please PM me for a Dropbox link. It is too large to attach.

@Zolko: Sorry for the delayed reply.

I have been testing with v0.50.6 and every case that I have tested looks good! I’ll will let you know if I notice any other LCS issues.

Thank you for your investigation of this issue and its quick resolution. Your efforts are very much appreciated!

I’ve got an error when trying to make video. How to correct it?

OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.35327 (Git)
Build type: Release
Branch: main
Hash: 32a0e0c6ae7fdd6e179065c247d53b8497bf1db2
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:

  • A2plus 0.4.60n
  • Assembly3 0.12.0
  • Assembly4 0.50.2

Did you try to install the Python module OpenCV ?

I’ve downloaded opencv from https://opencv.org/releases/ then install into mod repertory. What I’m supposed to do?

Are you serious ? A veteran asks this question ? Did you try to use a search engine ? May-be easier in French ?

As to your question: you wouldn’t want to know my suggestion for that. This is about your computer management, it will depend on your computer, how am I supposed to know how you should install OpenCV on your system ? On my system (Debian) I installed it with :


sudo apt install python3-opencv

I encounter the same problem as Vincent B when i clic on Save Button and I read the latest exchanges but I don’t know where to attach the OpenCv directory. I tried C:\Users\berna\AppData\Roaming\FreeCAD\Mod
C:\Users\berna\AppData\Roaming\FreeCAD\Mod\Assembly4
C:\Users\berna\AppData\Roaming\FreeCAD\AdditionalPythonPackages\Py310.
OpenCV is still missing
Thank you for your feedback and have a happy Christmas

OS: Windows 11 build 22631
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.35414 (Git)
Build type: Release
Branch: main
Hash: 759930e3aab711355d2f0895f641a8657897af48
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
* CurvedShapes 1.0.4
* Curves 0.6.13
* ExplodedAssembly
* fasteners 0.4.67
* fcgear 1.0.0
* LCInterlocking
* Nodes 0.1.36
* Pyramids-and-Polyhedrons
* QuickMeasure 2022.10.28
* sheetmetal 0.3.1

Vincent B I believe you are a Windows user who possibly uses both the proper Installer LibPack build and the Weekly Conda builds. If so, this is indeed more complicated than a normal library such as ezdxf, certainly with the latest 4.8.1 version of cv2. So these are the steps to ensure you are using the latest version in different builds with different versions of Python:

With FreeCAD closed down:

  1. I downloaded the opencv-4.8.1-windows.exe file from https://github.com/opencv/opencv/releases and extracted it to the same named folder in my case on my G: drive.
  2. I found a workbench in my C:\Users_username_\AppData\Roaming\FreeCAD\Mod that I would not be updating regualrly which in my case is Plot
  3. Search for Init_Gui.py in the folder structure and edit it
  4. Add the following two lines towards the top (in my case the import sys already existed so I ommited it):
import sys
sys.path.insert(1, 'G:/opencv-4.8.1-windows/opencv/build/python')

(replacing G: with the drive you are using and notice the forward slashes not back slashes)
and save & close the file.

  1. Start any version of FreeCAD and in the Python Console type:
import sys
sys.path
import cv2
cv2.__version__

You should receive no errors, just expected output for the path and version number but if you do then you need to look at the beginning of the sys.path output to ensure the folder that you entered above is in there usually the second one of the list.

I tested this using 0.21.1 LibPack build with Python 3.8.x and the Conda build: FreeCAD_weekly-builds-34387-2023-09-24-conda-Windows-x86_64-py310

Bernard19 see above

Syres
Thanks a lot for your explanation.
After installation, I send to the console:

>>> import cv2
>>> cv2.__version__
'4.8.1'
>>>

that’s saying the cv2 library is here, isn’t it? but still have the animation can’t run. :unamused:

Vincent B I’ll have a look later today, I don’t use Assembly4 but I’m sure I can find an appropriate file from somewhere.

Syres
Thank you for your detailed step by step
After typing in Python FreeCAD
cv2.version
I got it back
‘4.8.1’
I think Open Cv is loaded.
However, I still encounter the same problem. Unable to record animation.
It seems to be the same problem for Vincent B

yes that should do it. Does the animation itself not run or is the “Save” function telling that OpenCV is not installed ?