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 »

I've changed the code to:

Code: Select all

SOLVER_CONTROLDATA = {
    #Index:(posAccuracy,spinAccuracy,completeSolvingRequired)
    1:(0.1,0.1,True),
    #2:(0.01,0.01,True),
    #3:(0.001,0.001,True),
    #4:(0.0001,0.0001,False),
    #5:(0.00001,0.00001,False)
    }
However, the results are very similar. I even measured the processor and practically no difference.
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 Oct 25, 2018 11:47 am
dcapeletti wrote: Thu Oct 25, 2018 8:33 am Hi, I'd like you to look at this comment https://forum.freecadweb.org/viewtopic. ... 00#p264527 to see if it's possible to implement such functionality in A2Plus.

Thanks
Hi,
i will have look for this problematic. I need similar thing too.
So we're all in the same boat, so I'll do some tests on my own and report results.
Look at this post I've made https://forum.freecadweb.org/viewtopic. ... 73#p264573

Thanks
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 Guy's,

i started work on support for partslist/BOM.

If we want to do a meaningfull partlist, for every imported part/subassembly we need some additional information, as there would be:
- quantity
- Suppliers product name
- Suppliers partnumber
- internal product name
- internal partnumber
- etc...

At moment, we only know the sourceFile of the imported object.
Quantity we can get by counting of the sourcefiles, but the other information does not exist up to now.

I intend to work with an information spreadsheet, to be placed within the .fcstd file to be imported. It would be very ugly if each involved file would have to be opened by FreeCAD, only to access the spreadsheet and gathering partslist data. I took @dcapeletti 's idea to directly read out the compressed XML document file for this task. Devel branch has been updated and there is a new file "a2p_fcdocumentreader.py". With this we are able to read spreadsheets from files given py a path.

I think it will be possible even to identify a2p objects and do a partslist recursively over all imported parts in all subassemblies.

Any suggestions appreciated.

If you want to test:
- open "testfile-with-spreadsheet" with FreeCAD
- execute the "a2p_fcdocumentreader.py" file as macro.
- in console output, you see the results.
Attachments
testfile-with-spreadsheet.fcstd
(3.73 KiB) Downloaded 49 times
a2p_fcdocumentreader.py
(6.55 KiB) Downloaded 54 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
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 all,
there is a new bugfix-release available, V0.1.4.1

What was fixed ?
- file importer did not import the base feature of a part/mirror operation. Fixed.
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
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Another approach to assembly solver (A2plus)

Post by Jee-Bee »

Freecad A2P reply

I have now tried for the first time the A2P. The result is that i have somen comments for making A2P better...
1 The point/ vertexes are quite hard to select. Maybe this is a FC issue
2 i had some repetive set of constraints. but for some reason it fails sometimes during build.
i had the workflow [axis, plane point] but sometimes i was unable to add the plane step at once... so i had to do [axis1, axis2] so it position was around good. than remove axis 2 and add plane, and final add point.
3 i was missing axis on plane
4 I started with a model with 2 part design bodies. It looks like A2P is unable to handle this without conversion...

Final: Thanks for all your work
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Jee-Bee wrote: Mon Oct 29, 2018 11:25 am Freecad A2P reply

I have now tried for the first time the A2P. The result is that i have somen comments for making A2P better...
1 The point/ vertexes are quite hard to select. Maybe this is a FC issue
2 i had some repetive set of constraints. but for some reason it fails sometimes during build.
i had the workflow [axis, plane point] but sometimes i was unable to add the plane step at once... so i had to do [axis1, axis2] so it position was around good. than remove axis 2 and add plane, and final add point.
3 i was missing axis on plane
4 I started with a model with 2 part design bodies. It looks like A2P is unable to handle this without conversion...

Final: Thanks for all your work
Hi @Jee-Bee
you can likely overcome your first issue (point selection) with the general FC Preferences -> Display -> Part colors: Default vertex size (increase the actual value). You can also change this per part in the Combo view -> View property settings (but I haven't tried this so far).
For the other issues: Would you be able to provide and attach your problematic assembly for us to test?

Thanks for testing!
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Another approach to assembly solver (A2plus)

Post by Jee-Bee »

sorry i wanted to do that but forgotten :oops:
Attachments
point_source_assy_1-0_A2P.FCStd
(78.86 KiB) Downloaded 53 times
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Jee-Bee wrote: Mon Oct 29, 2018 12:43 pm sorry i wanted to do that but forgotten :oops:
Thank you for sharing the assembly. I'm testing it ATM. Cool object, BTW.
A short question inbetween: What FreeCAD version do you use?
You don't need to use v0.18pre, but a v0.17 can be more useful than the predecessors, also for using A2plus.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Another approach to assembly solver (A2plus)

Post by Jee-Bee »

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15007 (Git)
Build type: Release
Branch: master
Hash: 70fef3934190aabc61f5e1346483359d5ad21403
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

Jee-Bee wrote: Mon Oct 29, 2018 1:28 pm

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15007 (Git)
Build type: Release
Branch: master
Hash: 70fef3934190aabc61f5e1346483359d5ad21403
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
kbwbe wrote: ping
Hi, Klaus,
this is a nice one: Please read @Jee-Bee's posts and test the assembly file on your side.
There are "invisible"-set bodies in the assembly.

I'm at least getting this:

Code: Select all

Running the Python command 'a2p_ViewConnectionsCommand' failed:
Traceback (most recent call last):
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2p_importpart.py", line 769, in Activated
    a2plib.setTransparency()
  File "/home/manuel/.FreeCAD/Mod/A2plus/a2plib.py", line 110, in setTransparency
    if ( len(obj.ViewObject.DiffuseColor) == 1 ) :

'Gui.ViewProviderDocumentObject' object has no attribute 'DiffuseColor'
But maybe this is due to my testing around @wandererfan's color improvements.

Anyway, trying to solve this, I get a:

Code: Select all

===== Start Solving System ====== 
====================
Hierarchy:
====================
Draft_001 - distance 0
   Body001_001 - distance 1
      Body001_002 - distance 1
         Body001_009 - distance 2
      Body001_008 - distance 2
   Body001_002 - distance 1
      Body001_009 - distance 2
   Body001_003 - distance 1
      Body001_010 - distance 2
         Body001_011 - distance 3
   Body001_004 - distance 1
   Body001_005 - distance 1
      Body001_006 - distance 2
      Body001_007 - distance 2
====================

convergency-conter: 151
Calculation stopped, no convergency anymore!
TARGET   POS-ACCURACY :0.0001
REACHED  POS-ACCURACY :0.0008623529216662061
TARGET  SPIN-ACCURACY :0.0001
REACHED SPIN-ACCURACY :2.7704921932800045e-05
===== System solved using partial + recursive unfixing =====
Post Reply