Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Koemi
Posts: 145
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Another approach to assembly solver (A2plus)

Post by Koemi »

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: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

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 2091 times
Test for a2p19.FCStd
(17.59 KiB) Downloaded 59 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Another approach to assembly solver (A2plus)

Post by vocx »

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: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

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
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

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.56, 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
Veteran
Posts: 1052
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Post by kbwbe »

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.56, 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: 7
Joined: Sun Jan 19, 2020 9:55 am

Re: Another approach to assembly solver (A2plus)

Post by unit1 »

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: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

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 1899 times
InitGui.py
(8.04 KiB) Downloaded 67 times
a2p_autoselect.py
(69.92 KiB) Downloaded 38 times
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Another approach to assembly solver (A2plus)

Post by dan-miel »

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
unit1
Posts: 7
Joined: Sun Jan 19, 2020 9:55 am

Re: Another approach to assembly solver (A2plus)

Post by unit1 »

dan-miel wrote: Mon Jan 20, 2020 5:26 amHi 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
Hi, Dan,

I woul love to experiment :) Hmm I can share my model, but is it not finished yet completely. And it's made like in pseudo "explosion" view and some parts are left with 1 DOF to move them arround. See 7zip file with freecad files and assembly which is named "Cavity_assembly". The files: https://drive.google.com/open?id=1OelZj ... 79ygJ6_2uX
Post Reply