Another approach to assembly solver (A2plus)

Discussion about the development of the Assembly workbench.
MRx
Posts: 74
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » Fri Apr 16, 2021 3:52 am

Hi,

is there a way to constrain the sideway distance of two circles?
distance_circles.png
distance_circles.png (11.64 KiB) Viewed 1854 times
kbwbe
Posts: 1044
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sat Apr 17, 2021 1:05 pm

MRx wrote: Fri Apr 16, 2021 3:52 am ...is there a way to constrain the sideway distance of two circles?
You can constraint the cylinders to a converted Sketch.

1) create a sketch with 2 circles
2) convert the sketch to an A2p part
3) set fixPosition = True for the converted sketch
4) import first and second cylinder
5) constraint the cylinders to the sketch

If you want to change the sketch, edit it, save and finally update the assembly.
arranging-cylinders.png
arranging-cylinders.png (79.86 KiB) Viewed 1763 times
Attachments
files.zip
(16.09 KiB) Downloaded 28 times
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.54b, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
MRx
Posts: 74
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » Sun Apr 18, 2021 7:26 am

Hi,

thanks, I will try it soon.

Seems like I have figured out another issue.

There are 2 projects:
Project A - and the Assembly file is called assembly.fcstd

Project B - has a sub-assembly also called assembly.fcstd (but is located in another directory)

When the assembly file of Project A (assembly.fcstd) is open, and if you try to import assembly.fcstd of project B into another assembly file, it will effectively import assembly.fcstd from Project A.
kbwbe
Posts: 1044
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Sun Apr 18, 2021 9:10 am

MRx wrote: Sun Apr 18, 2021 7:26 am There are 2 projects:
Project A - and the Assembly file is called assembly.fcstd

Project B - has a sub-assembly also called assembly.fcstd (but is located in another directory)

When the assembly file of Project A (assembly.fcstd) is open, and if you try to import assembly.fcstd of project B into another assembly file, it will effectively import assembly.fcstd from Project A.
A2Plus needs unique filenames. Using same filename but from another directory does not work. This behavior is intended and needed to keep assemblies portable from one machine to another.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.54b, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench
dammerel
Posts: 78
Joined: Sat Aug 09, 2014 2:15 am

Re: Another approach to assembly solver (A2plus)

Postby dammerel » Sun May 09, 2021 1:18 am

Hi all I noticed A2 plus now works with the link version of freecad meaning you can insert a part into the assembly constraint it and then go back later and modify the component and update the assembly this is a great feature
HubertTO
Posts: 1
Joined: Sun Jun 06, 2021 7:53 am

Re: Another approach to assembly solver (A2plus)

Postby HubertTO » Sun Jun 06, 2021 8:24 am

Dear All,

I am new on this forum, and I hope I am in the right thread for my question. I've been using FreeCAD for a year now, and I have to say that the A2plus module brings quite a lot of possibilities to the software. Congrats to the owner(s) (kbwbe if I'm right, maybe others, sorry if I missed the names) !

My point of coming here: toponaming issue, there is quite a large number of posts and video on the web, and I understood clearly the main 'core engine' of FreeCAD does not help, so when we have a complex assembly with large number of constraints and there is a change in one of the part, ... it's a mess then :), everything can be quickly broken and we have to redo all the constraints one by one. I have a suggestion, I don't know if it has been discussed previously (at least I could not find it), so please excuse me if I missed the right thread. My suggestion would be to edit the sub element in the constraint (property view of dialog box). Today this is not possible from the GUI as it is locked with read only option when created, I guess it is to prevent selecting elements that are not compatible with the initial constraint (?). Changing it from python console works perfectly, for example :

Code: Select all

obj =App.getDocument('Sans_nom').getObject('axisCoincident_001')
obj.SubElement1 = 'Face181'  # was 180 before 
and recomputation works fine. As couple of tests are already implemented to check the selection compatibility with every constraint, I am asking myself if it would be possible to implement such 'modifyer' in the WB? The Flow could be something like:
- have the subelement label written in the constraint dialogbox and have an 'update' button on the right to change it
- if update button is pushed, get the result of 'highlight both part related' (maybe having 2 colors for the surfaces to identify which of the 2 surfaces we are editing, or highlight in red or other color the edges again to help remember what are we editing), then popup a dialog box to confirm selection
- let the user select the new element; validate, visibility is brought back to how it was before editing, then internally check if the new selection is still compatible with the constraint and keep doing the process like during creation

I don't know if this could be a workaround to the toponaming issue. I saw that there is an option under dev, did not try it yet as my assembly is quite large and I am deseperate to restard from scratch :). But, I let you guys give me a feedaback.

Thank you in advance for your support and all the work done so far for the community.
MRx
Posts: 74
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » Wed Jun 09, 2021 5:17 am

Hi,

I have a sheet metal object, and did an unfold. Now I have 2 objects within the same file - while I hide one of them (the unfolded part) the folded one is still visible.

If I import the part both objects will show up.
Could A2Plus do a check if the object is visible and only import the visible part?
MRx
Posts: 74
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Another approach to assembly solver (A2plus)

Postby MRx » Wed Jun 09, 2021 5:48 am

kbwbe wrote: Sat Apr 17, 2021 1:05 pm
MRx wrote: Fri Apr 16, 2021 3:52 am ...is there a way to constrain the sideway distance of two circles?
You can constraint the cylinders to a converted Sketch.

1) create a sketch with 2 circles
2) convert the sketch to an A2p part
3) set fixPosition = True for the converted sketch
4) import first and second cylinder
5) constraint the cylinders to the sketch

If you want to change the sketch, edit it, save and finally update the assembly.

arranging-cylinders.png
I think that's still no good solution, I'd moreover expect an option in the circularEdge dialog if I'd like to align the object horizontally or vertically to the existing object.
It's not about the cylinder - yes that might work that way but it seems to be "extra" complicated doing it that way, it's about having 2 existing gears and adding a constraint to them.
kbwbe
Posts: 1044
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Wed Jun 09, 2021 8:20 pm

MRx wrote: Wed Jun 09, 2021 5:17 am Could A2Plus do a check if the object is visible and only import the visible part?
Please do A2plus-Preferences setting: "Do not import invisible parts".
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.54b, 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
Posts: 1044
Joined: Tue Apr 10, 2018 3:12 pm
Location: Germany, near Köln (Cologne)

Re: Another approach to assembly solver (A2plus)

Postby kbwbe » Wed Jun 09, 2021 8:33 pm

MRx wrote: Wed Jun 09, 2021 5:48 am
kbwbe wrote: Sat Apr 17, 2021 1:05 pm
MRx wrote: Fri Apr 16, 2021 3:52 am ...is there a way to constrain the sideway distance of two circles?
You can constraint the cylinders to a converted Sketch.

1) create a sketch with 2 circles
2) convert the sketch to an A2p part
3) set fixPosition = True for the converted sketch
4) import first and second cylinder
5) constraint the cylinders to the sketch

If you want to change the sketch, edit it, save and finally update the assembly.

arranging-cylinders.png
I think that's still no good solution, I'd moreover expect an option in the circularEdge dialog if I'd like to align the object horizontally or vertically to the existing object.
It's not about the cylinder - yes that might work that way but it seems to be "extra" complicated doing it that way, it's about having 2 existing gears and adding a constraint to them.
Within A2plus, here are still some few basic constraints missing which will be done when i find some time:
- Distance between points
- Distance between point and axis
- Distance between two axis
and in addition:
- Distance between cylinders

Until the mentioned constraints are done, you only can work with the mentioned sketches. Sorry for no better news at moment.
KBWBE

https://github.com/kbwbe/A2plus
latest release: v0.4.54b, installable via FreeCAD's addon manager
Tutorial: gripper assembly https://www.youtube.com/watch?v=QMxcQ5tssWk
Documentation: https://www.freecadweb.org/wiki/A2plus_Workbench