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 »

manuelkrause wrote: Tue Nov 27, 2018 8:14 pm I've now made some tests and code changes based on that assembly2 code. But I'm not any step ahead with that.
Please have a close look at it, maybe I simply don't put the needed algorithms in the right place / order.
I've taken the changes only into my github for now, to not disturb your (@kbwbe) version.
Hi Manuel,
i will come back to the color import issues within not too long time. Things regarding color/transparency import seem for me got worse last time. I am doing some work with A2plus at moment and i register some color/transparency problems on newer FC versions. I just want to finish some of my work before changing topic.

Best regards,
Klaus

/Edit: typos
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: Tue Nov 27, 2018 9:49 pm
manuelkrause wrote: Tue Nov 27, 2018 8:14 pm I've now made some tests and code changes based on that assembly2 code. But I'm not any step ahead with that.
Please have a close look at it, maybe I simply don't put the needed algorithms in the right place / order.
I've taken the changes only into my github for now, to not disturb your (@kbwbe) version.
Hi Manuel,
i will come back to the color import issues within not too long time. Things regarding color/transparency import seem for me got worse last time. I am doing some work with A2plus at moment and i register some color/transparency problems on newer FC versions. I just want to finish some of my work before changing topic.

Best regards,
Klaus

/Edit: typos
Hi Klaus,
it looks like good news to me, that you plan to invest some time into that. Doesn't matter when you join that "party", only that you'd do. (Gives hope!)
@wandererfan recently notified me of a FC forum thread that may indicate a longtime bug in FC. Btw. thanks for those notifications from you! (In this case it was: https://forum.freecadweb.org/viewtopic. ... 50#p270650) But I'm not quite sure that this covers the whole scope of the problems. And I tried to follow most of those possible origins, including committed patches to FC base code. At some point I gave up, as I haven't seen any trace (backwards) within this research, why our A2plus MUXed parts' DiffuseColor of existing (sub-)assemblies is handled differently than a freshly composed first assembly, for the displaying of it in 3D view.
There had been one patch from @abdullah, that included the population of Transparency (https://github.com/FreeCAD/FreeCAD/pull ... 6f92bd7351) -- maybe DiffuseColor should get the same treatment? I'm no programmer. Please evaluate this idea.
I'm also not convinced of my work, meaning my coding, or e.g. the way that I (we) refresh the display correctly.
What I'm willing to test is some code from the Arch WB (I was too anxious to test so far), they're also handling parts with transparency. I'm not used to it, so I don't know if it works with "re-imports" of shell objects with DiffuseColor, at this moment.

Kind regards,
Manuel
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Re: Another approach to assembly solver (A2plus)

Post by dcapeletti »

Hi, I'm trying to attach a cap to the tube. The first cap worked perfectly, but I have a problem with the second cap. Attached is a sample video.

https://peertube.video/videos/watch/0ac ... be01f30825

The assembly file here and the accessories in the Partes folder.
https://git.rlab.be/dcapeletti/huertecn ... onia.fcstd
https://git.rlab.be/dcapeletti/huertecn ... Hidroponia

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 »

dcapeletti wrote: Sat Dec 01, 2018 12:51 pm Hi, I'm trying to attach a cap to the tube. The first cap worked perfectly, but I have a problem with the second cap. Attached is a sample video.
Hi Diego,
i had a look at your assembly. Whether the second tube nor the second cap has the property "fixedPosition = True". If there is no fixed part in a combination, the solver will ignore these constraints.

I fixed the second tube, then i could constraint the second cap to it.

regards,
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, a million of thanks . I've already solved the problem. Greetings :)
dh9ts
Posts: 19
Joined: Sat Dec 01, 2018 4:59 pm

Re: Another approach to assembly solver (A2plus)

Post by dh9ts »

Hello,

I just installed the workspace and I'm very happy with this.

I am relative new to freecad and have a question regarding the workflow for the part construction:

I assembled the structure in the attached image. How do you proceed when you have to change parts?
For example drill holes to connect the beams or add further connections between single parts?

Like for the following connections.

https://www.google.de/url?sa=i&rct=j&q= ... 8206516814

https://www.google.de/url?sa=i&rct=j&q= ... 8208399887

The example is very simple, at the moment I could plan ahead. But if the machine gets complex, it is very possible that there have parts added
which I don't know beforehand.


Best regards
Thorsten
Attachments
profile_example.png
profile_example.png (73.02 KiB) Viewed 1209 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 »

dh9ts wrote: Sun Dec 02, 2018 8:30 pm I assembled the structure in the attached image. How do you proceed when you have to change parts?
For example drill holes to connect the beams or add further connections between single parts?
Hi Thorsten,
welcome to the forum.

If you intend to do changes to your imported parts after assembling, at first you should activate "use experimental toponaming" on preferences page of A2plus. With that, constraints will be more robust against editing of parts and you will get better warnings if a constraint breaks. As your assembly seems to be very small at moment, just redo it with the setting mentioned above.

If you later want to edit a part, been imported to your assembly, please select this part and hit the "edit part" button. (button with a pencil)
This way you can open the parts fcstd file directly from the assembly. Do your changes and store the part. Go back to the assembly and hit the button "update imported parts" (button with the recycling symbol). Your old part will be replaced by the edited one.

Save your assembly before doing this. If something goes wrong, you can just reload the old state. Replacing of parts in an assembly is a very critical operation.
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
jbe
Posts: 368
Joined: Sun Nov 10, 2013 4:18 pm
Location: France, Châteauroux

Re: Another approach to assembly solver (A2plus)

Post by jbe »

And it is very usefull ....!
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: ping
Hi Klaus,
Thank you for your continued hard work!
I was just testing to assemble the known-to-you "Pleuel" newly with the current devel-branch (last commit date: Nov 29, 2018) and noticed an issue:
Last constraint added, is 'axialConstraint_002__Pleuel.6_001'. "Flipping last constraint", as well as changing 'aligned' to 'opposed' in the properties, only rotates by 90°, a not-desired angle, and around a not desired axis. (The assembly is not fully constrained at this point.) I attach the last good state assembly file and a failing state screenshot.
Screenshot_20181203_184016.png
Screenshot_20181203_184016.png (136.71 KiB) Viewed 1142 times

Am I doing something wrong or does it point to a bug?

Best regards and TIA,
Manuel
Attachments
ASSY-Pleuel+Lager+Bolzen.6.fcstd
(17.08 KiB) Downloaded 37 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: Mon Dec 03, 2018 5:47 pm
Hi Manuel,
i can reproduce the problem. It is a bug within the solver. It does not correctly recognize an insolvable state of the assembly.

"Pleuellager-O.2" has two constraints (planeParallel and axialConstraint). Both constraints do a relation to an axis (one is the cylinder axis, the other is the plane axis). If you flip the last constraint, the axis alignment of both constraints get ridicoulus and the solver should signal this by an message "constraints inconsistant", but it does not. Instead of this, the part is adjusted to a wrong solution. I will implement an additional check next time.

I stumbled over a similar case last days.

Best regards,
Klaus

P.S. Better delete the planeParallel constraint, but keep the axialConstraint and do a new planeCoincident constraint to align the faces. This should work.
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