Another approach to assembly solver (A2plus)

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

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Thu Jan 16, 2020 10:30 am

Koemi wrote:
Thu Jan 16, 2020 7:25 am
- Apparently "enable recursive update" helps, but still a few buttons missing, also not present in the pulldown of A2plus.
- Version A2Plus V0.4.39a
Your installation of A2plus seems to be a mix of an old and the recent version, however. You should delete the complete A2plus subfolder in your Mod directory and reinstall the workbench.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.47e, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
Koemi
Posts: 108
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Another approach to assembly solver (A2plus)

Postby Koemi » Thu Jan 16, 2020 10:59 am

You should delete the complete A2plus subfolder in your Mod directory and reinstall the workbench.

Thanks kbwbe, this is the solution :mrgreen:
dan-miel
Posts: 161
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Sat Jan 18, 2020 4:33 am

I get an error when I try to constrain two edges. I removed FreeCAD 18 and installed 19 on my machine. There are no modified files in the Mod directory. I cannot find where to copy the versions of the programs to the post but I aam attaching a screen shot of the error code and the assembly file. Any thoughts?
Thanks for your time.

Dan Miel
Attachments
Constraining edges.JPG
Constraining edges.JPG (45.03 KiB) Viewed 647 times
Test for a2p19.FCStd
(17.59 KiB) Downloaded 9 times
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Another approach to assembly solver (A2plus)

Postby vocx » Sat Jan 18, 2020 7:20 am

dan-miel wrote:
Sat Jan 18, 2020 4:33 am
I cannot find where to copy the versions of the programs to the post but I aam attaching a screen shot...
Important information

Do not take a picture of the report view.

Code: Select all

Just copy the lines and paste them inside code tags. Like this.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
dan-miel
Posts: 161
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Sat Jan 18, 2020 4:40 pm

vocx wrote:
Sat Jan 18, 2020 7:20 am
I cannot find where to copy the versions of the programs to the post but I am attaching a screen shot...

Important information

Do not take a picture of the report view.

Code: Select allJust copy the lines and paste them inside code tags. Like this.
Thanks vocx, you are right.
After some machine maintenance and several down loads the new versions seems to be working. I'm not sure what single thing cleared the problem.
Where is a good source for the updated api commands? What code editors will work with it? VS is not giving me anything to work with.
Thanks
Dan
kbwbe
Posts: 956
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Jan 19, 2020 10:46 am

dan-miel wrote:
Sat Jan 18, 2020 4:33 am
I get an error when I try to constrain two edges
Hi Dan,
i also get this error:

Code: Select all

<Exception> Geometry.cpp(3829): Geom_TrimmedCurve::parameters out of range
It seems to be a FreeCAD bug, as i can reproduce this by using only the Part-WB.

I have reported this error here:
https://forum.freecadweb.org/viewtopic.php?f=3&t=42568
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.47e, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
kbwbe
Posts: 956
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Jan 19, 2020 3:44 pm

dan-miel wrote:
Sat Jan 18, 2020 4:33 am
I get an error when I try to constrain two edges.

Code: Select all

<Exception> Geometry.cpp(3829): Geom_TrimmedCurve::parameters out of range
I have found this bug. Please update A2plus to version V0.4.40a
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.47e, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
unit1
Posts: 6
Joined: Sun Jan 19, 2020 9:55 am

Re: Another approach to assembly solver (A2plus)

Postby unit1 » Sun Jan 19, 2020 6:26 pm

Hello, is there possibility or workaround to know which constraints exactly are failing in A2+ assembly?

Because when going back and forth when editing parts need do some changes. I recently updating parts with update function, but then when adding more parts solver complains about new constraints and it saying that "delete last created constraint", but is aware of that failing constraints are with the part, which was changed and updated. Thus not knowing which constraints are failing, it is needed to delete all already edited part's constraints and redo from beginning(it's very cumbersome). Maybe it's my problem which I've not figured out reading all A2+ WB manual.

P. S. This experience is influenced by Soliworks assembly. When you do changes to parts, the changes reflects to assembly, if the constrains are failing, but solver shows which constraints exactly fail by some reason, that loses some plane, vertex etc. And you know what is wrong.

P. S. S.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Lithuanian/Lithuania (lt_LT)
A2+ WB V0.4.39a
dan-miel
Posts: 161
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Mon Jan 20, 2020 5:16 am

kbwbe wrote:
Sun Jan 19, 2020 3:44 pm
<Exception> Geometry.cpp(3829): Geom_TrimmedCurve::parameters out of range

I have found this bug. Please update A2plus to version V0.4.40a
I updated to the new code and the edge constraint works. A couple of 'No control key" programs I'm working also had the same error. They also have this error when I select two planes They use your code but in a different way to return the true/false. The code starts on line 779 and In the Inigui you need to add lines 67 import and line 98.
I'm changing my code to use yours I thought you might want to know in case it might be a problem. I get the error in both FC 18 and 19. It did not show up until WB 39.a
Dan Miel




Traceback (most recent call last):
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_autoselect.py", line 158, in addSelection
selcontrol.divergehere(FreeCAD.ActiveDocument.Name, sel.Object.Name, sub)
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_autoselect.py", line 1687, in divergehere
self.name2(objinfo,sub)
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_autoselect.py", line 1725, in name2
form1.iconsSecondselection(FreeCADGui.Selection.getSelectionEx())
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_autoselect.py", line 783, in iconsSecondselection
list.append(a2p_constraints.AxialConstraint.isValidSelection(selection))
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_constraints.py", line 371, in isValidSelection
if ValidSelection(s1) and ValidSelection(s2):
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2p_constraints.py", line 364, in ValidSelection
return cylindricalFaceSelected(selectionExObj) \
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2plib.py", line 749, in cylindricalFaceSelected
axis, center, error = fit_rotation_axis_to_surface1(face.Surface)
File "C:\Users\dan-m\AppData\Roaming\FreeCAD\Mod\A2plus\a2plib.py", line 323, in fit_rotation_axis_to_surface1
uv = sum( [ [ (u,v) for u in linspace(0,1,n_u)] for v in linspace(0,1,n_v) ], [] )
<class 'NameError'>: name 'linspace' is not defined
Attachments
plane error.JPG
plane error.JPG (37.69 KiB) Viewed 456 times
InitGui.py
(8.04 KiB) Downloaded 8 times
a2p_autoselect.py
(69.92 KiB) Downloaded 9 times
dan-miel
Posts: 161
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Postby dan-miel » Mon Jan 20, 2020 5:26 am

unit1 wrote:
Sun Jan 19, 2020 6:26 pm
Hello, is there possibility or workaround to know which constraints exactly are failing in A2+ assembly?
Hi unit1 I have been trying to create a way to deal with these constraints. If you want to put you file up here I could use a real case problem to see if my idea works. If you want to try the program out I may have it working again in a day or two. but I can try it before then/
Dan Miel