FreeCAD / FreeCAD/FreeCAD

Assembly: Problem with CopyOnChange links

Open
#14,056 7 comments 0 reactions 0 assignees View on GitHub
Mod: Assembly Status: Confirmed Type: Bug
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Problem description

I noticed this bug wen creating some assembly with generic extruded aluminum profiles (implemented with the "CopyOnChange" feature of App::Link). Wen you modify the copyOnwrite parameter, the solid will shift, and if you try to solve the constraint, the solid will shift more, and if you try to modify the parameter, will shift again, in a random rotation and magnitude.

A possible way to reproduce the bug:
- Creating an assembly;
- Add a part as a link, and ground it;
- Add another part as a link (that has a CopyOnChange parameter that modifies the solid), and set Link On Copy on "Enabled"
- make a "Fixed joint" constraint between the two object
- Change the CopyOnChange parameter
(The solid now swifts randomly)
- Press "Solve Assembly"
(The solid will shift more each time is pressed)

![image](https://github.com/FreeCAD/FreeCAD/assets/7541781/c281befa-c243-45f9-ba3c-158a040bb0b1)
![image](https://github.com/FreeCAD/FreeCAD/assets/7541781/532a277a-5446-40b2-9b54-5cf0d8c3fa55)
![image](https://github.com/FreeCAD/FreeCAD/assets/7541781/9f88536e-7983-46ab-a000-f976cd436cf9)

### Full version info

```shell
OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37302 (Git)
Build type: Release
Branch: main
Hash: 0e24e121eb3e5708c380596e0a9fd583befac977
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/Europe (en_150)
Installed mods:
* Assembly4 0.50.12
* Gridfinity 0.4.0
* kicadStepUpMod 11.1.0
* LCInterlocking
* sheetmetal 0.4.11
```

### Subproject(s) affected?

Assembly

### Anything else?

I tried with different
No error log are generated in the console, But i created an example that triggers the strange behavior.
[testbug.zip](https://github.com/FreeCAD/FreeCAD/files/15335026/testbug.zip)

You just need to press "Z" (Solve Assembly) to admire the majestic glider going places :D

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.