kbwbe / A2plus

Another assembly workbench for FreeCAD, following and extending Hamish's Assembly 2 workbench
GNU Lesser General Public License v2.1
170 stars 69 forks source link

A2plus fails if no part has the property fixed Position #205

Open donovaly opened 5 years ago

donovaly commented 5 years ago

I use the latest a2plus 0.3.7. I cannot solve this super simple assembly:

2-part-testass.zip

there are only 2 parts, an axle and a wheel-like structure. Try to add a constraint between them of your choice.

result: the parts are not moved the solver only tells me: ===== Start Solving System ====== TARGET POS-ACCURACY :1e-05 REACHED POS-ACCURACY :0.0 TARGET SPIN-ACCURACY :1e-05 REACHED SPIN-ACCURACY :0.0 SA SPIN-ACCURACY :0.0 ===== System solved using partial + recursive unfixing =====

The reason is that no part has gthe property "fixed Position" set to true. If the A2plus solver requires this, A2plus should

As it is, average users like me are lost - it took me about an hour to realize what is going on.

kbwbe commented 5 years ago

This is an old unsolved issue. I will try to find an algorithm which detects such constellations. The first imported part is automatically set to fixed position. The problem appears e.g. when it is deleted.

easyw commented 5 years ago

I would opt for raising a dialog. Doing something automatically would lead to not desired behaviour...

kbwbe commented 5 years ago

Introducing a flag "moved" to each rigid could be a solution. If a constrained rigid does not have the flag set to value "True" after solving, this is an indicator for this problem. A dialog could be used in order to signal this.

kbwbe commented 5 years ago

Now A2plus evaluates a new flag "moved" of each rigid. After solving, parts with corresponding "rigid.moved == False" are highlighted and a dialog with a warning is shown. Please update to version v0.3.11

donovaly commented 5 years ago

Many thanks for this important improvement. However there are 2 issues:

My proposal:

kbwbe commented 5 years ago

Creation of constraint: This is necessary, as the solver can only solve existing constraints. It is not really a preview. IMHO the normal case is, that the user only forgot to set an additional constraint to the fixed part. So he can keep the constraint if he wants this.

Hidden dialog. This is a problem to solve. The constraint properties dialog is always pushed to front, so that the user can rotate and pan in the 3D view to inspect the result of the solving. This is conflicting with the new warning.

I hope i find a workaround.

donovaly commented 5 years ago

And what about my second proposal? From my experience this would makes things a lot easier because assembling doesn't always follow purely logic paths ;-) .

eduncan911 commented 2 years ago

Humm, I'm running into this today with two imported parts (step files) and have been unable to find a resolution.

I've even tried:

>>> FreeCAD.getDocument('volocomosq').getObject('Solid').fixedPosition = True
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'Part.Feature' object has no attribute 'fixedPosition'

(my first python within freecad)