Commit Graph

61 Commits

Author SHA1 Message Date
PaddleStroke
7dcd2610f0 AssemblyObject: Use std::unordered_set instead of vector. 2024-12-13 18:04:10 +01:00
PaddleStroke
1806857c42 Assembly: Enable the use of App::Datums 2024-12-13 18:04:10 +01:00
Aik-Siong Koh
5d143d1f59 Assembly: Simulation implementation 2024-12-03 20:07:04 +01:00
Benjamin Nauck
32e339447a Move back the assembly util functions to AssemblyUtil (#18020)
* Move back util functions to AssemblyUtils again

* Add getPropertyByName<T>() helper

* Improve constness in AssemblyUtils

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-02 10:48:48 -06:00
PaddleStroke
a174d87fac Assembly: Store DocumentObject instead of mbdPart for the dragged parts. Fixing the bug where doDragStep was 50% of time failing to find the correct DocumentObject due to bundling. 2024-11-18 17:43:53 +01:00
PaddleStroke
127d5dd840 Assembly: AssemblyLinks. 2024-10-16 15:39:23 +02:00
Furgo
6266e1c96a Assembly: make "Solve failed" error more verbose (#17117)
* Add FC_ERR macro for the 'Solve failed' Assembly error

* Handle standard exceptions during assembly solve

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-14 10:43:15 -05:00
PaddleStroke
55b9ed8882 AssemblyObject.cpp : add failsafe checks 2024-10-14 08:58:35 -05:00
PaddleStroke
1b44435e98 Assembly: Fix lag during dragging of large assemblies. Bundle fix joints together. Show only the movingJoint during dragging. Do not recompute joints during dragging. 2024-09-30 17:38:54 +02:00
Bas Ruigrok
29de03a098 Move isLink and isLinkGroup from AssemblyObject to DocumentObject 2024-09-08 11:56:14 +02:00
Bas Ruigrok
174846a665 Move getGlobalPlacement from AssemblyObject to GeoFeature 2024-09-07 13:27:59 +02:00
Bas Ruigrok
a2736e8a37 Move splitSubName from AssemblyObject to Base::Tools 2024-09-07 13:27:59 +02:00
wmayer
392949fcfa Assembly: Fix compiler warning 2024-09-03 16:26:52 +02:00
PaddleStroke
452d4a61d2 Assembly: Fix case of link groups 2024-09-02 18:20:18 +02:00
PaddleStroke
62e5e0e41d Assembly: Enable ungrounded connected parts to move as one item. 2024-09-02 18:20:18 +02:00
PaddleStroke
2dc8612a78 Assembly: Fix objects in group would not have the dragger appear when selected. 2024-08-12 11:49:12 -04:00
PaddleStroke
e773c65abb Assembly: Fix distance joints 2024-08-12 11:47:21 -04:00
PaddleStroke
8fdbeeced6 Assembly: Make sure that when a components is deleted its joints are as well. 2024-08-12 11:43:54 -04:00
PaddleStroke
855835cf4e Assembly: Replace ObjRefPairs std::pair by structure. 2024-07-29 17:48:25 +02:00
PaddleStroke
8d3e3acd11 Assembly: Property change from Object/Part to Reference 2024-07-29 17:48:25 +02:00
luzpaz
2837b46c3e Fix various typos throughout the codebase 2024-07-08 17:19:20 -05:00
PaddleStroke
f5a6e0fd32 Assembly: Change Object1/2 from strings to PropertyXLinkSub and Remove Element1/2 and Vertex1/2 2024-07-01 11:22:30 -05:00
PaddleStroke
fcf54e031c Assembly: Enable moving objects while making joints. 2024-06-27 09:10:38 +02:00
PaddleStroke
9ae198ab95 Assembly: Limits: Set one checkbox for each limit. 2024-06-26 17:06:02 +02:00
PaddleStroke
0972645fab Assembly: Do not attempt to drag grounded objects. 2024-06-25 09:14:59 -05:00
Chris Hennes
22aad24b06 Merge pull request #14608 from Ondsel-Development/asm_del_obj
Assembly: Makes sure deleting assembly deletes the joints and views
2024-06-17 10:49:58 -05:00
PaddleStroke
f6b15dcc12 Assembly: Fix bug by replacing const char* by std::string for variables that need to be swapped. 2024-06-11 12:11:16 +02:00
PaddleStroke
47c22bec65 Assembly: Add validation step during dragging to ignore steps where grounded objects moved. 2024-06-10 11:35:04 -05:00
PaddleStroke
7345d76f2c Assembly: Add preference to enable debug files of dragging 2024-06-10 11:13:12 -05:00
PaddleStroke
2bd57d0817 Assembly: Fix bad limits automatically. Fixes https://github.com/Ondsel-Development/FreeCAD/issues/61 2024-05-30 10:33:59 +02:00
PaddleStroke
5fb3589f26 Assembly: Add 'Angle', 'Perpendicular' and 'Parallel' joints. 2024-05-27 11:59:06 -05:00
Jiří Mácha
635616c88f Missing property Object1 or Object2 of fixed joint causing crash (#13912)
* Assembly: removal of object of fixed joint causing crash

FreeCAD is crashing if the 'Object'
property of fixed joint (Assembly/Joints/Fixed/Joint Connector 1/Object1 or
Assembly/Joints/Fixed/Joint Connector 2/Object2) is manually removed.

Steps to reproduce:

 - make simple Assembly e.g. of two cubes with Fixed joint
 - Select Fixed joint in the tree and go-to property 'Data' tab
 - Select 'Object1' or 'Object2' of the 'Joint Connector 1' or 'Joint Connector 2'
   and remove this reference
 - click by your pointing device (mouse) to the arbitrary other property

The FreeCAD will crash here because the call
App::DocumentObject* obj = getObjFromNameProp(joint, propObjName, propPartName);
will return NULL pointer.

This problem is similar to the
8d5348ad066aa216c387582bfdcf066966a4fe09.

* Assembly: fixed warning message text

The warning message text is not describing two cases which can happen,
but only one - property of specific joint.

* Assembly: avoiding possible crash in rack pinion joint code

Similar problems:

07c6df61f8456a6b02e88b369dcef5643ac1574e
and
8d5348ad066aa216c387582bfdcf066966a4fe09

were causing real crashes (Linux + Sway Wayland compositor) when
Fixed joint type was used.

This patch tries to avoid the same situation, but now for the
rack pinion joint type.

The returned pointer value (part1 and obj1) can get NULL pointer value
and is used in the code:

    if (obj1->getNameInDocument() != part1->getNameInDocument()) { ....

a few lines later.
2024-05-27 10:46:02 -05:00
PaddleStroke
5f4dd814ea Core: Add getRootObjectsIgnoreLinks and fix bugs in tree.cpp and AssemblyObject.cpp, CommandInsertLink.py, UtilsAssembly.py 2024-05-13 17:58:34 +02:00
wmayer
c1b7d38b27 Assembly: Fix warning: -Wunused-variable 2024-05-07 19:48:33 +02:00
PaddleStroke
3d13f5353a Assembly: add try/catch blocks in drag step. 2024-05-06 18:32:00 +02:00
PaddleStroke
3419d27077 Assembly: Make RackPinion and Screw easier to setup. 2024-05-06 18:32:00 +02:00
PaddleStroke
b25f90c694 Assembly: Fix small bugs in AssemblyObject.cpp, JointObject.py and UtilsAssembly.py 2024-05-06 18:32:00 +02:00
PaddleStroke
13c0ba1902 Assembly: Introduce Belt joint. 2024-05-06 18:32:00 +02:00
PaddleStroke
b4168c95ee Assembly: Drag: switch from solver Solve to dragStep. 2024-05-06 18:32:00 +02:00
PaddleStroke
60b902fc7e Assembly: Adds limit and RackPinion/Screw/Gears 2024-05-06 18:32:00 +02:00
PaddleStroke
4d33659666 Assembly: Add Screw/Pulley/Gears/RackPinion icons. Credits to @maxwxyz 2024-05-06 18:32:00 +02:00
PaddleStroke
b35e4adc13 Assembly: Solve on recompute. Fixes #12983 2024-05-06 18:32:00 +02:00
PaddleStroke
d389074c61 Assembly: Exploded view refactoring 2024-05-06 18:32:00 +02:00
PaddleStroke
2cfc1cc85b Assembly: Fix distance 0 between 2 vertex. Issue mentioned in #12490 2024-05-06 18:32:00 +02:00
PaddleStroke
061aba3476 Assembly: Remove bad joints : joints between a part and itself. Fixes #12752 2024-05-06 18:32:00 +02:00
PaddleStroke
f27f5bba37 Assembly: Fix #12887: changing offset can move grounded parts in some cases. 2024-05-06 18:32:00 +02:00
PaddleStroke
27bb619323 Assembly: Fix #12889 : deleting a part does not delete joint and later crashes freecad. 2024-05-06 18:32:00 +02:00
PaddleStroke
2cf789a45f Assembly: define nested assemblies. Fixes 12440 2024-05-06 18:32:00 +02:00
PaddleStroke
2fad087aac Assembly: Add DistanceType enum and getDistanceType function. 2024-05-06 18:32:00 +02:00
Jiří Mácha
69898555c6 Assembly: fix segfault when Part property of Joint Connector is missing
FreeCAD is crashing during 'Solve Assembly' call if the Part property
(Assembly/Joints/Fixed/Joint Connector 1/Part1 or Assembly/Joints/Fixed/Joint
Connector 2/Part2) of fixed Joint is unset.

Steps to reproduce:

 - make simple Assembly e.g. of two cubes with Fixed joint
 - Select Fixed joint in the tree and go-to property 'Data' tab
 - Select Part1 or Part2 of 'Joint Connector 1' or 'Joint Connector 2'
   and remove this reference
 - call 'Solve Assembly' now

The FreeCAD will crash here because the call
App::DocumentObject* part = getLinkObjFromProp(joint, propPartName);
will return NULL pointer.

The property Part1 or Part2 can get empty (unset) during usual
construction operations - during changing construction history
and it can be very hard to find the cause of FreeCAD crash on a big
model.

This patch tries to fix the crash in such situation.
2024-04-08 18:00:40 +02:00