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
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

kbwbe wrote: Sat Sep 08, 2018 2:47 pm
manuelkrause wrote: Sat Sep 08, 2018 2:04 pm Without your answers to the above questions I'm as lost as without a failing test-file.
Hi Manuel,
i could reduce the filesize and reproduce the artifacts.
Please import attached file 17144-test.fcstd to a fresh assembly. It contains a subassembly 17230-test.fcstd. It is attached too.

Here are the artifacts...
.
Artifacts-II.png
.
This happens with FC17 + FC18, FC16 i did not test ATM. Updating of subassembly does not help. With these files, you should be able to test.
Hi Klaus,

I have now updated my FC (still release 0.17), python3 and related libs to the current openSUSE tumbleweed state, last installation was from July, but am still unable to open/ import your test files. I always get a segfault. Log attached.

I have no idea what component may be missing.
I'm thankful for any hint!

Manuel
Attachments
FreeCAD-failure-log.20180909.txt
(5.37 KiB) Downloaded 40 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 »

manuelkrause wrote: Sun Sep 09, 2018 1:05 pm
I have now updated my FC (still release 0.17), python3 and related libs to the current openSUSE tumbleweed state, last installation was from July, but am still unable to open/ import your test files. I always get a segfault. Log attached.

I have no idea what component may be missing.
I'm thankful for any hint!
Hi Manuel,
i assume the files are simply to old and i have been working on them in past with previous WB to A2plus. On my system, i get only some warnings, your's is crashing. The files are not quiet compatible to recent Version of A2plus.

Better we forget these old files and do fresh assemblies. ;)
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 »

kbwbe wrote: Sun Sep 09, 2018 1:20 pm
manuelkrause wrote: Sun Sep 09, 2018 1:05 pm
I have now updated my FC (still release 0.17), python3 and related libs to the current openSUSE tumbleweed state, last installation was from July, but am still unable to open/ import your test files. I always get a segfault. Log attached.

I have no idea what component may be missing.
I'm thankful for any hint!
Hi Manuel,
i assume the files are simply to old and i have been working on them in past with previous WB to A2plus. On my system, i get only some warnings, your's is crashing. The files are not quiet compatible to recent Version of A2plus.

Better we forget these old files and do fresh assemblies. ;)
No no, no escape,
why are you able to open them and me not. The archive structure is o.k. and one file of them even shows a FC version stamp of 0.18pre.
I'm not able to open your pump assembly, not linkgruppe-V, but linkgruppe-VI succeeded (I assume you re-assembled it for me at that time) and there I only get artifacts for the decribed situation of 0.0 overlapping surfaces, and all surfaces are selectable on here.
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 to everyone,

after a lot of work and final testing, i released first official version v0.1 of A2plus
Many, many thanks to all members of this small team for supporting and discussing.

A2plus has been already included to FreeCAD's addon manager, so it is easy to install for everyone. Many thanks to @Kunda1

Everyone is invited to do intensive tests and give feedback.

Have fun !

This was my last screenshot after testing...
.
Machinery.png
Machinery.png (314.6 KiB) Viewed 1586 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
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

manuelkrause wrote: Sun Sep 09, 2018 1:29 pm
kbwbe wrote: Sun Sep 09, 2018 1:20 pm
manuelkrause wrote: Sun Sep 09, 2018 1:05 pm
I have now updated my FC (still release 0.17), python3 and related libs to the current openSUSE tumbleweed state, last installation was from July, but am still unable to open/ import your test files. I always get a segfault. Log attached.

I have no idea what component may be missing.
I'm thankful for any hint!
Hi Manuel,
i assume the files are simply to old and i have been working on them in past with previous WB to A2plus. On my system, i get only some warnings, your's is crashing. The files are not quiet compatible to recent Version of A2plus.

Better we forget these old files and do fresh assemblies. ;)
No no, no escape,
why are you able to open them and me not. The archive structure is o.k. and one file of them even shows a FC version stamp of 0.18pre.
I'm not able to open your pump assembly, not linkgruppe-V, but linkgruppe-VI succeeded (I assume you re-assembled it for me at that time) and there I only get artifacts for the decribed situation of 0.0 overlapping surfaces, and all surfaces are selectable on here.
@kbwbe:
So my approach only fails for you with artifacts on very old parts that I'm not even able to open with FC 0.17?
Then you could have left my code in. Current devel code doesn't preserve transparency, even not for current part assemblies.
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: Sun Sep 09, 2018 3:21 pm So my approach only fails for you with artifacts on very old parts that I'm not even able to open with FC 0.17?
Then you could have left my code in. Current devel code doesn't preserve transparency, even not for current part assemblies.
A release point is something very special. I only put code to this where i am 100% sure that it works. Regarding this i was not sure, had not really much time and therefore i left the code out. And it was not the most important topic. So, if changing importPart.py and muxAssembly.py to work with compound shapes, in generally the code will become smaller and the color/transparency management will reduce to only some lines. Please be patiently.
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 »

Create a topic in the feature announcement topic
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

kbwbe wrote: Sun Sep 09, 2018 11:42 am
wandererfan wrote: Sun Sep 09, 2018 1:09 am Can anybody explain why we disassemble imported parts and rebuild as a shell instead of using a Compound shape? It seems such an obvious approach that I must be missing something.

wf
Hi wandererfan,

your are right ! :oops: It is inside as code was mainly taken from Hamish's WB. Later this algo was extended to do some "fingerprinting" for edges and faces as replacement for missing toponaming.

I did a quicktest and changed this function:
.

Code: Select all

def muxObjectsWithKeys(objsIn, withColor=False):
    '''
    combines all the objects in objsIn into one shape,
    is able to import colors
    '''
    doc = FreeCAD.activeDocument()
    faceColors = []
    muxInfo = [] # List of keys, not used at moment...

    comp = doc.addObject("Part::Compound","muxCompound")
    comp.Links = objsIn
    doc.recompute()
    shape = comp.Shape
    colors = comp.ViewObject.DiffuseColor
    doc.removeObject(comp.Name)
    return muxInfo, shape, colors
The new function is faster and more straight forward. Getting the combined shape is no problem, getting the colors depends on FC version and the version of the imported parts. It does not work in any cases. With old parts, i get the same graphical artifacts as with Manuel's code.

We have to work on this topic within development of V0.2. For V0.1, it's to late now.
Hi,
I just want to confirm, that changing the function to the shown section of code in a2p_MuxAssembly.py, works fine from the start for my FC 0.17 assemblies. Of course, without any of the lengthy lines I had introduced with my code.

Shapes, colors and transparencies are taken from the underlying sub-assemblies, and saved changes in there are taken over at a simple "Update imported parts".

Thanks!

Manuel
Turro75
Posts: 179
Joined: Mon Aug 15, 2016 10:23 pm

Re: Another approach to assembly solver (A2plus)

Post by Turro75 »

manuelkrause wrote: Mon Sep 10, 2018 8:25 am
kbwbe wrote: Sun Sep 09, 2018 11:42 am
wandererfan wrote: Sun Sep 09, 2018 1:09 am Can anybody explain why we disassemble imported parts and rebuild as a shell instead of using a Compound shape? It seems such an obvious approach that I must be missing something.

wf
Hi wandererfan,

your are right ! :oops: It is inside as code was mainly taken from Hamish's WB. Later this algo was extended to do some "fingerprinting" for edges and faces as replacement for missing toponaming.

I did a quicktest and changed this function:
.

Code: Select all

def muxObjectsWithKeys(objsIn, withColor=False):
    '''
    combines all the objects in objsIn into one shape,
    is able to import colors
    '''
    doc = FreeCAD.activeDocument()
    faceColors = []
    muxInfo = [] # List of keys, not used at moment...

    comp = doc.addObject("Part::Compound","muxCompound")
    comp.Links = objsIn
    doc.recompute()
    shape = comp.Shape
    colors = comp.ViewObject.DiffuseColor
    doc.removeObject(comp.Name)
    return muxInfo, shape, colors
The new function is faster and more straight forward. Getting the combined shape is no problem, getting the colors depends on FC version and the version of the imported parts. It does not work in any cases. With old parts, i get the same graphical artifacts as with Manuel's code.

We have to work on this topic within development of V0.2. For V0.1, it's to late now.
Hi,
I just want to confirm, that changing the function to the shown section of code in a2p_MuxAssembly.py, works fine from the start for my FC 0.17 assemblies. Of course, without any of the lengthy lines I had introduced with my code.

Shapes, colors and transparencies are taken from the underlying sub-assemblies, and saved changes in there are taken over at a simple "Update imported parts".

Thanks!

Manuel
Thanks Manuel,

does this change has an impact on assembly file size?
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 »

Turro75 wrote: Mon Sep 10, 2018 9:08 am does this change has an impact on assembly file size?
Hi Turro, hi manuel,
also in previous versions we stored one color value per face. I assume filesize will stay constant.

@Turro75:
On Github, i see you are very busy. "Multimode Solver" seems very promising. Are you integrating my "simple" solver into your files ?
If so, we should try to merge with devel, to get your stuff into it.
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