Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
kbwbe
Posts: 909
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Dec 23, 2018 1:46 pm

manuelkrause wrote:
Sun Dec 23, 2018 12:28 pm
Seems like the most window-manager related issues are cleaned up, but I at least got one weird behavior:
Steps:
* Create a planesParallel constraint
* Push 'Delete this constraint'
* Try to close the "Constraint Properties" sub-window
=> Clicking on it's (x) button pops-up the message "Constraint already has been deleted" with the "Constraint Properties" sub-window remaining open (intended would be it's closing ;-) )
Hi Manuel, many thanks for the report.

I cannot reproduce the error.
On my system the worksflow shows as:

* Create a planesParallel constraint <== works
* Push 'Delete this constraint' <== works
* A confirmation dialog opens "Confirmation required","Really delete this constraint?" <== This does not show on your system ??
* I confirm this dialog
* Confirmation dialog and constraint properties dialog disappear
* Constraint tools dialog is shown again, constraint is deleted. No error message.

Also the report dump is very strange and does not give a really good hint to me. It looks like there is another error present.
(Constraint dialog seems to be destroyed instead of only been hidden)

I will do some tests with different AppImages.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.40a, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
User avatar
easyw-fc
Posts: 2713
Joined: Thu Jul 09, 2015 9:34 am

Re: Another approach to assembly solver (A2plus)

Postby easyw-fc » Sun Dec 23, 2018 2:06 pm

It could be related to Py3 Qt5 environment... It is always useful to enable report panel to get error messages.
I have reporterted a similar issue at A2p repo.
Last edited by easyw-fc on Sun Dec 23, 2018 3:38 pm, edited 2 times in total.
User avatar
babaroga
Posts: 81
Joined: Sun Aug 14, 2016 6:52 pm
Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina

Re: Another approach to assembly solver (A2plus)

Postby babaroga » Sun Dec 23, 2018 2:17 pm

Hello,

I am experiencing same problem as Manuel, with simmilar error message.

At first, when I try to activate Constraint tools widget, it does not show up and following error is thrown.

Code: Select all

Running the Python command 'a2p_ConstraintDialogCommand' failed:
Traceback (most recent call last):
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 821, in Activated
    p = a2p_ConstraintPanel()
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 784, in __init__
    self.move(screen_center(self))      
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 783, in <lambda>
    screen_center = lambda widget: QtGui.QApplication.desktop().screen().rect().center()- widget.rect().center()  

Internal C++ object (PySide2.QtWidgets.QWidget) already deleted.
Then I have to minimize and then maximize complete FC window, and then I get widget shown.

But If I try to create any new constrain I get error

Code: Select all

Running the Python command 'a2p_ConstraintDialogCommand' failed:
Traceback (most recent call last):
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 821, in Activated
    p = a2p_ConstraintPanel()
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 784, in __init__
    self.move(screen_center(self))      
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 783, in <lambda>
    screen_center = lambda widget: QtGui.QApplication.desktop().screen().rect().center()- widget.rect().center()  

Internal C++ object (PySide2.QtWidgets.QWidget) already deleted.Traceback (most recent call last):
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 715, in onPlaneCoincidentButton
    self.manageConstraint()
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 652, in manageConstraint
    'createConstraint'
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 755, in __init__
    self.move(screen_center(self))      
  File "/home/senja/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 754, in <lambda>
    screen_center = lambda widget: QtGui.QApplication.desktop().screen().rect().center()- widget.rect().center()  
RuntimeError: Internal C++ object (PySide2.QtWidgets.QWidget) already deleted.
Constraint properties dialog stays on and it is impossible to close it. Whatever I choose, delete or accept constraint i get notification "Constraint has been already deleted". I have to force kill FC to close Properti dialog.


Code: Select all

OS: Manjaro Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15468 (Git)
Build type: Unknown
Branch: master
Hash: 4c67a5c3c66e0796be9884df65655ea679f31919
Python version: 3.7.1
Qt version: 5.11.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Sun Dec 23, 2018 2:41 pm

kbwbe wrote:
Sun Dec 23, 2018 1:46 pm
Hi Manuel, many thanks for the report.

I cannot reproduce the error.
On my system the worksflow shows as:

* Create a planesParallel constraint <== works
* Push 'Delete this constraint' <== works
* A confirmation dialog opens "Confirmation required","Really delete this constraint?" <== This does not show on your system ??
* I confirm this dialog
* Confirmation dialog and constraint properties dialog disappear
* Constraint tools dialog is shown again, constraint is deleted. No error message.

Also the report dump is very strange and does not give a really good hint to me. It looks like there is another error present.
(Constraint dialog seems to be destroyed instead of only been hidden)

I will do some tests with different AppImages.
Hi Klaus,
yes sorry, just forgotten to also list the "Confirmation required" "Really delete this constraint?" one. It shows up here as well and I confirm it, too.
But in my FC the "Constraint Properties" then remains open after the confirmation window disappeared (...until the time I close the whole FreeCAD).

I've tried a more detailed look at the error messages (instead of just copying them all at once from the Report view).
This one comes when invoking "Constraint Tools":

Code: Select all

Running the Python command 'a2p_ConstraintDialogCommand' failed:
Traceback (most recent call last):
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 820, in Activated
    p = a2p_ConstraintPanel()
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 783, in __init__
    self.move(screen_center(self))      
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 782, in <lambda>
    screen_center = lambda widget: QtGui.QApplication.desktop().screen().rect().center()- widget.rect().center()  

Internal C++ object (PySide2.QtWidgets.QWidget) already deleted.
This one comes when adding planesParallel constraint:

Code: Select all

Traceback (most recent call last):
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 709, in onPlanesParallelButton
    self.manageConstraint()
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 651, in manageConstraint
    'createConstraint'
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 754, in __init__
    self.move(screen_center(self))      
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 753, in <lambda>
    screen_center = lambda widget: QtGui.QApplication.desktop().screen().rect().center()- widget.rect().center()  
RuntimeError: Internal C++ object (PySide2.QtWidgets.QWidget) already deleted.
Then, no further error messages in Report view (e.g. upon deleting the constraint).

BTW, the "Confirmation Dialog" window has a somehow different look than the "Constraint Properties" and "Constraint Tool", maybe some old code remainders? (Just an idea, not sure if useful.)

And some FC cross version testing:
FreeCAD_0.18.15417.glibc2.17-x86_64.AppImage does not show any of these errors, while
FreeCAD_0.18.15419_Conda_Py3Qt5_glibc2.12-x86_64.AppImage does show them all.

Best regards,
Manuel
kbwbe
Posts: 909
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Dec 23, 2018 3:00 pm

Hi Guy's,
thank you all for reporting.

Probably it is a Py3/Qt5 issue. Conda-Appimage does not work, Babarogas System does not work. Both are Py3/Qt5. My system (py2/Qt4) works, FC0.18-Appimage(No Conda) works.

Has anyone an idea what is going wrong ? (Only one file is IMHO responsible for these problems: "constraintdialog.py")
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.40a, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Sun Dec 23, 2018 3:13 pm

kbwbe wrote:
Sun Dec 23, 2018 3:00 pm
Hi Guy's,
thank you all for reporting.

Probably it is a Py3/Qt5 issue. Conda-Appimage does not work, Babarogas System does not work. Both are Py3/Qt5. My system (py2/Qt4) works, FC0.18-Appimage(No Conda) works.

Has anyone an idea what is going wrong ? (Only one file is IMHO responsible for these problems: "constraintdialog.py")
With one of my tests I also got the following:

Code: Select all

Traceback (most recent call last):
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 764, in closeEvent
    self.widget().reject()
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_constraintDialog.py", line 352, in reject
    if self.constraintObject not in doc.Objects:
AttributeError: 'NoneType' object has no attribute 'Objects'
I need to apologize that I can't tell how this came exactly.
But maybe it gives some hint.
kbwbe
Posts: 909
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Dec 23, 2018 5:05 pm

kbwbe wrote:
Sun Dec 23, 2018 3:00 pm
Hi Guy's,
thank you all for reporting.

Probably it is a Py3/Qt5 issue. Conda-Appimage does not work, Babarogas System does not work. Both are Py3/Qt5. My system (py2/Qt4) works, FC0.18-Appimage(No Conda) works.

Has anyone an idea what is going wrong ? (Only one file is IMHO responsible for these problems: "constraintdialog.py")
Hi Guy's,
the Py3/Qt5 issue for branch "releasecandidate" is fixed. Simply the calculation of the screencenter did not work with Py3/Qt5. Now it is ok for Py2/Py3/Qt5.

Please test again.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.40a, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Sun Dec 23, 2018 5:09 pm

kbwbe wrote:
I've now also retested the spherical constraints from my post as of: https://forum.freecadweb.org/viewtopic. ... 53#p274859

The following is the failure code with a Conda build:

Code: Select all

Running the Python command 'a2p_ImportPart' failed:
Traceback (most recent call last):
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 275, in Activated
    importedObject = importPartFromFile(doc, filename)
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 203, in importPartFromFile
    newObj.muxInfo, newObj.Shape, newObj.ViewObject.DiffuseColor = topoMapper.createTopoNames(withColor=True)
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_topomapper.py", line 443, in createTopoNames
    self.processTopoData(n) # analyse each toplevel object...
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_topomapper.py", line 357, in processTopoData
    self.processTopoData(ob.Name,level)
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_topomapper.py", line 362, in processTopoData
    self.populateShapeDict(objName)
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_topomapper.py", line 303, in populateShapeDict
    edgeKeys = self.calcEdgeKeys(edge, pl) # 2 keys for a linear edge, 1 key per circular edge
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_topomapper.py", line 163, in calcEdgeKeys
    hasattr(edge,"Curve") and

undefined curve type

This is the same as with the openSUSE tumbleweed build that I usually use on here, as here the Icons+Menus are usable (in contrary to the Conda build).

With the FreeCAD_0.18.15417.glibc2.17-x86_64.AppImage I don't get any of these errors and the intended assembly builds up fine:

Screenshot_20181223_175726.png
Screenshot_20181223_175726.png (67.26 KiB) Viewed 219 times

Best regards,
Manuel
kbwbe
Posts: 909
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Dec 23, 2018 5:29 pm

manuelkrause wrote:
Sun Dec 23, 2018 5:09 pm
undefined curve type
Hi Manuel,
I did not address this error up to now, but will have a look at it yet. So if this is the only error, i assume all the other problems vanished. Yeah!
We are getting closer to a important release step.

BR
Klaus
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.40a, installable via FreeCAD's addon manager
Tutorials:
Paul Randall: https://youtu.be/mnkecA9S7kc
anisim (deutsch): https://www.youtube.com/watch?v=vDcaFq6IEJM
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Postby manuelkrause » Sun Dec 23, 2018 5:44 pm

kbwbe wrote:
Sun Dec 23, 2018 5:29 pm
manuelkrause wrote:
Sun Dec 23, 2018 5:09 pm
undefined curve type
Hi Manuel,
I did not address this error up to now, but will have a look at it yet. So if this is the only error, i assume all the other problems vanished. Yeah!
We are getting closer to a important release step.

BR
Klaus
No, sorry. My re-testing was following my earlier error reportings. Now I come to your recent changes of this evening.
I'd report back as soon as done.

BTW, always keep in mind, that most of _my_ error reportings are due to the Py3/Qt5 etc. changes. The Py2... doesn't make problems for A2Plus.
And you shouldn't rely on that people remain at Py2 stuff...