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

easyw-fc wrote: Tue Jan 15, 2019 8:05 pm Edit: I have added a small PR
I merged it to master ! :D
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
roerich_64
Veteran
Posts: 1465
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Another approach to assembly solver (A2plus)

Post by roerich_64 »

works great! :D
Die Liebe wird siegen, denn sie ist unzerstörbar :) ;)
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Another approach to assembly solver (A2plus)

Post by easyw-fc »

kbwbe wrote: Tue Jan 15, 2019 5:08 pm Hi Guy's,
as "cylindersTangent" constraint is still on my todo list, this is some magic of @easyw-fc. I am curious how this was possible ! :D
the result I got in the file is possible just because the cylinder is already in the right position (placement) for the tangent... the constraint is acting only on the seam edge coincidence ... if you rotate the cylinder manually, you will see that it can be freely rotated using its seam edge as axis of rotation. Unfortunately no tangent constraint is created. ;)
User avatar
roerich_64
Veteran
Posts: 1465
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: Another approach to assembly solver (A2plus)

Post by roerich_64 »

roerich_64 wrote: Tue Jan 15, 2019 9:47 pm works great! :D
But the transparency comes not through subassemblies...
Die Liebe wird siegen, denn sie ist unzerstörbar :) ;)
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: Tue Jan 15, 2019 9:24 pm
easyw-fc wrote: Tue Jan 15, 2019 8:05 pm Edit: I have added a small PR
I merged it to master ! :D
Mmmh, I don't understand... Somehow this doesn't work on here. Already a first imported file with set transparency doesn't apply it and refresh also doesn't bring it up.

(It's a Conda-like openSUSE Tumbleweed FC 0.18, and I applied the respective commit to the devel branch of A2plus and removed pycache before first use.)
Any idea what's going wrong? Or have I misunderstood the way it's supposed to work?

TIA and best regards
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Another approach to assembly solver (A2plus)

Post by easyw-fc »

manuelkrause wrote: Wed Jan 16, 2019 12:37 pm
Mmmh, I don't understand... Somehow this doesn't work on here. Already a first imported file with set transparency doesn't apply it and refresh also doesn't bring it up.

(It's a Conda-like openSUSE Tumbleweed FC 0.18, and I applied the respective commit to the devel branch of A2plus and removed pycache before first use.)
Any idea what's going wrong? Or have I misunderstood the way it's supposed to work?

TIA and best regards
Do you nave a small test file with sub file to upload that is Darling?
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Another approach to assembly solver (A2plus)

Post by easyw-fc »

I have added a small PR to A2p repo to better handle transparency...

For sub-assembly transparency I think we will have to be improve A2p using per face transparency as in this thread:
https://forum.freecadweb.org/viewtopic.php?t=16476

Here a sample with sub-assembly per face transparency:
mycube-transparency.FCStd
(11.71 KiB) Downloaded 43 times
assy-transparency1.FCStd
(11.86 KiB) Downloaded 41 times
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

easyw-fc wrote: Wed Jan 16, 2019 1:34 pm
manuelkrause wrote: Wed Jan 16, 2019 12:37 pm
Mmmh, I don't understand... Somehow this doesn't work on here. Already a first imported file with set transparency doesn't apply it and refresh also doesn't bring it up.

(It's a Conda-like openSUSE Tumbleweed FC 0.18, and I applied the respective commit to the devel branch of A2plus and removed pycache before first use.)
Any idea what's going wrong? Or have I misunderstood the way it's supposed to work?

TIA and best regards
Do you nave a small test file with sub file to upload that is Darling?
Sorry, I have forgotten to add some files to my earlier post.
The assembly only consists of the one other file I'd also attach. Transparency in the latter set to 55 in Property editor and resaved. Untouched in the assembly.
Attachments
KKM-1309.Contour.08.Piston.01.fcstd
transparent piston part
(37.1 KiB) Downloaded 65 times
ASM-TEST.KKM-1309.Piston.fcstd
assembly test
(4.27 KiB) Downloaded 43 times
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

easyw-fc wrote: Wed Jan 16, 2019 2:23 pm I have added a small PR to A2p repo to better handle transparency...

For sub-assembly transparency I think we will have to be improve A2p using per face transparency as in this thread:
https://forum.freecadweb.org/viewtopic.php?t=16476

Here a sample with sub-assembly per face transparency:
mycube-transparency.FCStd
assy-transparency1.FCStd
Please also note the files I've attached for you in my post above.
I've retested with these files and your PR link's commit applied. It doesn't change anything on here. Either in my FreeCAD the core .cpp transparency improvement commit hasn't landed as expected, it isn't sufficient or something else is going on.

Regarding your attached cube files... I attach two screenshots. First one is showing directly after opening the assy and second one is after refreshing imported files. Unfortunately both versions again show the annoying artefacts, coming along with unselectable faces (look at the cylinder's section and faces and try to select).
Are you able to reproduce what I describe?

BTW, the above linked forum thread was my inspiration to work on my improve-colors coding trials. But the unselectable faces issue made me take a break. In my humble understanding there is a collision of the presence of {DiffuseColor with/without included alpha value} and {ShapeColor with Transparency value property} and I haven't won any clear evidence about what gets precedence over the other or in which order. Maybe you're able to find out more.

BR, Manuel

after opening the assy
after opening the assy
Screenshot_20190116_160721.png (22.37 KiB) Viewed 1372 times

after refreshing the assy
after refreshing the assy
Screenshot_20190116_155954.png (17.95 KiB) Viewed 1372 times
User avatar
manuelkrause
Posts: 442
Joined: Thu Jul 05, 2018 7:16 pm

Re: Another approach to assembly solver (A2plus)

Post by manuelkrause »

easyw-fc wrote: Tue Jan 15, 2019 8:05 pm Here a small macro that could refresh Transparency if applied i.e. when refreshing the Assembly

Code: Select all

doc = FreeCAD.ActiveDocument

if doc is not None:
    for obj in doc.Objects:
        if hasattr (obj, 'ViewObject'):
            if hasattr (obj.ViewObject, 'Transparency'):
                if obj.ViewObject.Transparency < 100:
                    transparency = obj.ViewObject.Transparency
                    obj.ViewObject.Transparency = transparency + 1
                    obj.ViewObject.Transparency = transparency
Edit: I have added a small PR
In addition to my posts above... and referring to your most recent changes to this code:
I'm convinced that such trick needs to occur on every color operation within A2plus.

IIRC something like that was used in assembly2 and also is in current Arch WB, that needs somekind of this (windows are transparent).
Post Reply