Assembly 4 workbench

Discussion about the development of the Assembly workbench.
User avatar
bambuko
Posts: 222
Joined: Thu Oct 24, 2019 12:53 pm

Re: Assembly 4 workbench

Postby bambuko » Wed Nov 25, 2020 3:48 pm

Zolko wrote:
Wed Nov 25, 2020 2:20 pm
...because a "Model" is a "Part" called "Model"...
Thank you!
I am slowly getting my head round the concepts involved .
Does this mean that I can mix and match in one design parts that are rigid/fixed and do not need Assembly 4 as a solution with parts that are mechanisms and would benefit from Assembly 4?

I have used sketch constraints, spreadsheets etc on my first design:
Linda.png
Linda.png (307.62 KiB) Viewed 1015 times
and it was just about possible to do, but very fragile, sensitive and prone complaints about solver issues :) .

What I would like to is to leave frames, cylinders and other "fixed" parts as they are and use Assembly 4 to design cranks, connecting rod, coupling rod, crosshead and piston as one mechanism.
Followed by a second mechanism (again using Assembly 4) involving cranks and valve gear.
Common factor between the two mechanisms being cranks.

Does this make sense? or am I talking out of my rear? ;)
User avatar
Zolko
Posts: 1177
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Thu Nov 26, 2020 1:55 pm

bambuko wrote:
Wed Nov 25, 2020 3:48 pm
What I would like to is to leave frames, cylinders and other "fixed" parts as they are and use Assembly 4 to design cranks, connecting rod, coupling rod, crosshead and piston as one mechanism. Followed by a second mechanism (again using Assembly 4) involving cranks and valve gear.

Does this make sense ?
yes, sounds good
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
ManiacRS
Posts: 10
Joined: Sun Sep 27, 2020 10:13 am
Contact:

Re: Assembly 4 workbench

Postby ManiacRS » Sun Dec 06, 2020 12:31 pm

So, I've been reading this thread and starting to use Assembly4 workbench.

I would call it the love child of Matlab and Inventor/Fusion360 joints system. And I mean that as a compliment. I have found that the way you assemble parts and the Measure Distance tool in the View toolbar can have a very powerful synergy when referencing measurements in parts you design down the line. I don't know if anybody else is doing that or if it's the most efficient way but it's worked for me on a few occasions.

But now I would like to ask if I can do something, and if it's not currently possible maybe put it in as a feature request.

Can we get the data out as a graph, csv or any other form of what happens to one attachment's position angle, etc when another one moves?

For example, in Officina's Stewart platform, can we move the orientation of the attachment of the table and get back the lengths of each leg? Or in a car's suspension, change the height of the wheel and get back alignment angles like camber, caster, etc. in a form we can store and export?

Creo 3 Student edition was the last PTC product I used and it had that.
User avatar
Zolko
Posts: 1177
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Sun Dec 06, 2020 2:55 pm

ManiacRS wrote:
Sun Dec 06, 2020 12:31 pm
I would call it the love child of Matlab and Inventor/Fusion360 joints system. And I mean that as a compliment.
thank-you

Can we get the data out as a graph, csv or any other form of what happens to one attachment's position angle, etc when another one moves?
You can certainly do that by scripting, and quite easily. Now, if you want it in some automated way, then it needs to be generic. I'd say it should go with the Animation tool: we could imagine having a check-box to export data, and then select which Part's Placement should be exported, and then write out into a spreadsheet (for example, or a csv text file) the selected data.

If you know Python coding, you can look at the AnimationLib.py file. I won't have the time to look into this in the near future, but please don't hesitate to ask for information.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
raadal
Posts: 1
Joined: Mon Dec 07, 2020 9:43 pm

Re: Assembly 4 workbench

Postby raadal » Mon Dec 07, 2020 10:49 pm

Hello, I met issue with "PropertyLinkSubList does not support external object" when I try to create a new sketch on a face of model created with assembly. The assembly uses links to external files. Is there a way how to deal with this issue?

I'm using
OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: cfa02932155232032c6e6fe28e9d757d1494e72e
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
wmbq
Posts: 11
Joined: Wed Dec 02, 2020 11:51 pm

Re: Assembly 4 workbench

Postby wmbq » Tue Dec 08, 2020 1:33 am

Edit2: The assumption regarding question 2 below was correct, in App::Link Placement is contained the complete rotation and translation information/matrix for the current link.
I wrote a recursive parser, that builds a tree structure over existing App::Links in the main assembly, and aggregates the Placement data for every node.
The tree can then be used to run functions on leaf nodes (which would be a part that contains no more links or parts). The defined function in my case does "create solid", "update solid placement with saved value for node". This results in a correctly placed solid collection of all parts and sub parts used in the assembly.

@Zolko: I was skimming through the thread: https://forum.freecadweb.org/viewtopic. ... 0&start=10 and am not too clear on all the implications,because I have never used the A2plus WB and do not know all mentioned data types, but it sounds like a case of making used data types compatible with each other.
Would my approach fit in there somehow? It is literally going through all subassemblies while collecting data neccessary for computation later on. (In my case placement)

original post:

Hello,

I want to use the Part workbench to create solids from objects in my Assembly4 WB.

This works, if the created App::Link objects contain the corresponding body directly. However when I have a subassembly in that link,
Part workbench breaks and can not resolve the links.

I wrote a macro to recursively resolve links, and create solids. That works, but the assembly 4 position attachement breaks,
and the solids are created where the original coordinate system was.

Two questions:
1.) I am a new FreeCAD user, and not familiar with everything there is, so is there a better way to create solids from the things in my assembly? I need these solids to create a mesh from my assembled project, to run FEA.

Edit regarding 2.: Would it suffice to reverse the transformations being defined at around line 362: https://github.com/Zolko-123/FreeCAD_As ... LinkCmd.py ?
2.) In case what I want to do is reasonable, how do I translate the App::Link.Placement property into coordinates of the files linked to my assembly?
So I can just translate the new position of the created solids.

Other than this, I am really fond of the Assembly 4 workbench. Very intuitive workflow :)
User avatar
alonso_jamm
Posts: 41
Joined: Mon Nov 11, 2019 11:32 pm

Re: Assembly 4 workbench

Postby alonso_jamm » Sat Dec 12, 2020 5:55 am

Well, turns out that being able to fix objects with respect to other objects was harder than what I expected. I also have been really busy so I didn't have too much time to work in the solver. But slowly I was able to make it work.

I did find a lot of troubles in being able to fix the placements of objects with respect to any arbitrary object. I ended rewriting the way the solver handles constraints multiple times. So the current constraints are pretty much the same as the ones I had in August. The constraints are:
  • Fix: It constraints an object with respect to another. This is considering the local coordinates of the "reference" object. Thus, if you fix a LCS to another in the x-axis with a value of 5mm, then the "fixed" LCS will be always 5mm in the local x-axis of the "reference" LCS no matter the rotations of either object. If the other 2 axis are left unfixed, then the "fixed" LCS will be able to move freely along those two axes. The same happens with rotations. The rotations an LCS can be fixed with respect to the rotation of the other LCS. This opens the door to do a lot of different constraints, like point in a line, or in a plane, or concentricity, etc.
  • Lock: This is pretty much my initial "Fix" constraint where you can fix the placement of an object with respect to the global coordinates. This is needed because the current "Fix" constraint does not care about the global placements of the objects. So the "Lock" constraint is used to fix a system of constraints into the global coordinates otherwise the objects would move or rotate when solving the system.
  • Equality: This simply sets the global coordinates or rotations of two objects the same. This constraint is really simple and is a lot easier to solve than the "Fix" constraint so I would recommend "Equality" constraints in cases where the placement of two objects is wanted to be exactly the same (not leaving degrees of freedom).
Like I said, a lot of more complicated constraints can be made by just using these 3 constraints (mostly by using the Fix constraint). As an example, I made slider-crank mechanism with the current constraints. This works surprisingly well. I was expecting for the solver to take seconds to solve each time, but it only takes about 0.09 seconds to solve. And here is a video showing the slider-crank mechanism

phpBB [video]


However, it is important to mention that the solver has troubles in finding a solution when the positions of the LCSs is larger than 1 (it still may solve but it is kind of unstable). I expected the solver to have troubles in solving with relatively large values for the placements, but I wasn't expecting for that to happen with values this small. I remember reading about scaling the values of the variables in order to improve convergence of the solvers, so I will try to do that next.

I also have seen there is some work in merging Assembly4 and A2+ and I think it the A2+ solver would work better since I don't really trust a lot in my solver and I still see my solver as some kind of experimental work. I will continue working in my solver because I am learning a lot of stuff about FreeCAD and I also find it fun, but I don't think it would ever be as good as the solvers used by the other assemblies since I don't have experience.
Attachments
Solver Example.FCStd
(8.61 KiB) Downloaded 6 times
User avatar
Zolko
Posts: 1177
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Sat Dec 12, 2020 6:31 pm

alonso_jamm wrote:
Sat Dec 12, 2020 5:55 am
Well, turns out that being able to fix objects with respect to other objects was harder than what I expected. I also have been really busy so I didn't have too much time to work in the solver. But slowly I was able to make it work.
...
I also have seen there is some work in merging Assembly4 and A2+ and I think it the A2+ solver would work better since I don't really trust a lot in my solver and I still see my solver as some kind of experimental work.
Nice try, and thank's for sharing.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
fred-3d
Posts: 2
Joined: Sat Sep 26, 2020 5:09 am

Re: Assembly 4 workbench

Postby fred-3d » Mon Dec 14, 2020 7:06 am

Hi Zolko,

I have been learning FreeCAD and Assembly4, in my spare time, over the last few months and I want to say that the Assembly4 workbench has been instrumental in my migration to FreeCAD. Many thanks for your efforts!

As a former (hobbyist) Fusion360 user, I used "Joint Origins" and "Joint"s for my assemblies. So, I was very happy to discover that Assembly4's use of LCS's and "Link to Part" were reminiscent of F360's "Joint Origins" and "Joint". Since then, I have successfully recreated a number of my assemblies in FreeCAD using Assembly4 and am having fun exploring new possiblities.

Of course, I had issues along the way. Many were the result of me initially making invalid assumptions about how FreeCAD and Assembly4 operate. Most were resolved by my searching and reading this, and other, forum thread(s) and the documentation. For the remainder, I found workarounds. Here is a summary of some of the issues and thoughts that I had during the first part of my learning curve with FreeCAD/Assembly4, for general comment.

1) UNDO acts unexpectedly. This initially slowed down my FreeCAD learning significantly. My brain was used to F360 where an "UNDO" operation reverses the immediately preceeding operation alone. Assembly4 (A4), however, appears to sometimes silently "batch" up multiple preceeding operations into a single "transaction" in the UNDO list. So, a single UNDO may do more than expected. Here is one simple example:

Noobie user's intended goal:
create new body named "Base"
create new body named "Pole"

Noobie user's GUI actions:
Click "Create a new Body" icon
Text (with typo) "Basee"
Click OK
Right Click "Basse" Body in Tree, Rename(F2)
Text corrected to "Base"
Enter Key
Click "Create a new Part" icon (simulated user error, should have clicked "Create a new Body")
Ctrl-Z keys (UNDO)
Click Create New Body icon
Text "Pole"
Click OK
Results:
new body "Basee"
new body "Pole"

Notice that the Rename was reversed as well as the "Create a new Part" operation. If you look at the UNDO list prior to keying Ctrl-Z, you will see only one UNDO list entry "Change Basse.Label". Somehow, the "Create a new Part" operation has been bundled in with the Rename operation. So, when you UNDO once, it will UNDO the last two operations. This isn't obvious and, for me, can lead to multiple "I thought I fixed that" moments during a work session. I'm dealing with this through careful inspection after each UNDO. But, it does slow me down.

At least that is the way it appears to be working. Am I just missing something here?

2) I was initially confused by conflicting information about what types of objects could by linked by A4. In https://github.com/Zolko-123/FreeCAD_As ... UCTIONS.md it says:
Please Note: objects in the same document as the linked part but outside the App::Part container will not be inserted. The PartDesign workbench doesn't produce Parts, it produces Bodies. It is entirely possible to use Parts made with the Part workbench with Assembly4, but if you want to use Bodies made with the PartDesign WB you need first to create a Part and move the Body into that Part.
I, however, recently finished reading all (currently) 84 pages of this thread and realized that, indeed, linking Body objects is now fully supported. Very Cool! Although, it would be good to update https://github.com/Zolko-123/FreeCAD_As ... UCTIONS.md to reflect the recent changes.

3) For many projects, I prefer to pre-define my actual or placeholder distances and angles into named variables before sketching and then adding or editing variables as needed. I initially used Spreadsheets for this, but have moved on to using A4 Variables instead. That has worked for me, but there is one thing:
a. When setting Variable values, I often need to use ExpressionEngine formulas to reference other Variables. I can't seem to do that directly now. So, instead, I create a dummy Float value, create the Variable and then edit it in the Properties box to enter the Value using the ExpressionEngine icon. Is there a way to enter a formula directly when initially creating a Variable?

4) The A4 measurement tool is my favorite measurement tool in FreeCAD! I did, however, have a couple of thoughts:
a. I haven't found a way to measure distances to, from, or between LCS's. Is there a way to do this?

b. Is there a way to reposition a measurement once it is displayed?

c. I wonder if it would be valuable to add default preferences or maybe auto-save/auto-restore of the last used settings, under "Controls", between invocations of the measurement tool. I sometimes find myself jumping in and out of Sketcher to measure distances and have to remember to click "Measure Distance" each time I enter the tool. I'm unsure about this one.

That's enough for now. Finally, I have years of C/C++ experience and in the future hope to look at the code and maybe contribute to the project with bugfixes, etc. Again, thanks to you and the other FreeCAD developers for all of your efforts!

Edit: FreeCAD Assembly 4 workbench, Current version 0.9.13, 2020-12-01

Edit: Oops, forgot to hit paste...
OS: openSUSE Leap 15.1 (KDE//usr/share/xsessions/plasma5)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23323 (Git) AppImage
Build type: Release
Branch: master
Hash: 512d5c6141aec52b6eecc67370336a28fde862a6
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Last edited by fred-3d on Wed Dec 30, 2020 1:37 pm, edited 1 time in total.
User avatar
bruno.zilli
Posts: 15
Joined: Tue Nov 17, 2020 8:41 am
Location: Latisana-Udine-Italy

Re: Assembly 4 workbench

Postby bruno.zilli » Wed Dec 23, 2020 3:41 pm

Hello friends

I did the tutorial Assembly4 part 2.

Simply great!

Thank you very much indeed.

Best regards

Bruno