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!
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

kbwbe wrote: Thu Nov 01, 2018 6:14 pm Hi,

there is a new release v0.1.5 available.
It contains the new basic partlist functionality, see my post before.
Hello, again thank you very much for your work.
I've been testing this new function and found an error.
When I enter an expression in some field of the original part spreadsheet, for example =Pad.Length (first image), the assembly spreadsheet shows an error (second image).
I think this is because when you build the spreadsheet in the assembly, you can't evaluate the expression and therefore show an error.

I think you can try the following solution:
1) Evaluate the recursive expression of the original part spreadsheets when creating the spreadsheet in the assembly. This way, you could get the result in a string and not generate the error. This could be done by identifying the = sign.

Look at this post I created https://forum.freecadweb.org/viewtopic.php?f=3&t=32004

Greetings
Attachments
second image.png
second image.png (60.86 KiB) Viewed 1734 times
first image.png
first image.png (70.29 KiB) Viewed 1734 times
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 »

dcapeletti wrote: Sat Nov 03, 2018 1:19 pm I've been testing this new function and found an error.
When I enter an expression in some field of the original part spreadsheet, for example =Pad.Length (first image), the assembly spreadsheet shows an error (second image).
I think this is because when you build the spreadsheet in the assembly, you can't evaluate the expression and therefore show an error.

I think you can try the following solution:
1) Evaluate the recursive expression of the original part spreadsheets when creating the spreadsheet in the assembly. This way, you could get the result in a string and not generate the error. This could be done by identifying the = sign.
Hi @dcapeletti,
My implementation ATM does not intend evaluating spreadsheet /EDIT: formulas within foreign files. It is only designed for transporting some static cell entries (without formula within), as e.g. necessary to do a partlist.

Maybe, as "=Pad.Length" is finally a static entry in another object, it should be possible to modify the "a2p_fcdocumentreader" to follow such entries and make it returning the correct value instead of an error. But more complicated formulas sure will not work.

I will keep it in mind for future versions. Recent version is not able to do this.
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
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

Hi, maybe this topic is dealt with in the string expression request https://freecadweb.org/tracker/view.php?id=3460
Anyway, sooner or later we'll have to find a way to solve it. I will try to read your code when I have time, I will do some tests.

Greetings
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 »

Hi,
there is a new version of A2p available, V0.1.5.1

What has been changed ?
- bugfix for partlist. I did not work for assemblies done with older versions of A2p (without "subAssembly" property). Now it works (but without recursive iteration over subassemblies)

- pointOnPlane-constraint has been improved. I now accepts a center of a circle as point selection and it got a offset property. Now we can constraint a cylinder within a slot.

Please see here:
-
New-pointOnPlane.png
New-pointOnPlane.png (148.17 KiB) Viewed 1669 times
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
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

Hi, when I try to generate a parts list and the file hasn't been saved, it generates an empty list.
Steps.
I create a file and save it.
I import the parts.
I create a parts list spreadsheet. It is generated empty.
I save the document and generate it again, it is filled in.

I think I should save the document or warn the user somehow.
Greetings
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 »

dcapeletti wrote: Mon Nov 05, 2018 10:06 am Hi, when I try to generate a parts list and the file hasn't been saved, it generates an empty list.
Thanks, i will fix the bug soon.
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 »

dcapeletti wrote: Mon Nov 05, 2018 10:06 am Hi, when I try to generate a parts list and the file hasn't been saved, it generates an empty list.
This has been fixed with new release V0.1.5.2
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
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Hi Klaus, @kbwbe,
today I've finally tried to use an openSUSE tumbleweed 0.18-pre FreeCAD version and get this in bash console (as startup in normal KDE GUI failed):

Code: Select all

During initialization the error /usr/lib64/FreeCAD/lib/Part.so: undefined symbol: _ZN24BRepMesh_IncrementalMeshC1ERK12TopoDS_Shapedbdbb occurred in /home/manuel/.FreeCAD/Mod/A2plus/InitGui.py
Please look into the log file for further information
There is no log info found anywhere.

This can be due to my further playing with A2plus colors, or due to missing/ not updated libraries for the v0.18 FC.

Ideas and hints highly appreciated, TIA
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 »

manuelkrause wrote: Wed Nov 07, 2018 4:00 pm Hi Klaus, @kbwbe,
today I've finally tried to use an openSUSE tumbleweed 0.18-pre FreeCAD version and get this in bash console (as startup in normal KDE GUI failed):

Code: Select all

During initialization the error /usr/lib64/FreeCAD/lib/Part.so: undefined symbol: _ZN24BRepMesh_IncrementalMeshC1ERK12TopoDS_Shapedbdbb occurred in /home/manuel/.FreeCAD/Mod/A2plus/InitGui.py
Please look into the log file for further information
There is no log info found anywhere.

This can be due to my further playing with A2plus colors, or due to missing/ not updated libraries for the v0.18 FC.

Ideas and hints highly appreciated, TIA
Hi Manuel,
it seems to be related to A2plus. Please test with master branch of it (identical to devel ATM), whether the problem still exists or not. If the problem vanishes, it perhaps has to do with color setting experiments.

P.S.: It can be a library problem too... P.S.-II: (as undefined symbol should never happen!)
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 »

@manuelkrause,
There is now the feature freeze and bugfix period running for fc-0.18. Perhaps this bug is important.
Best way:
Post a helprequest with title something like: "Testing FC018-pre, undefined symbol in library during start of external WB", with errormessage, your systeminformation, way to reproduce. Even if there is something wrong during experimenting with A2plus, "undefined symbol" should not happen.
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
Post Reply