Assembly 4 workbench

Discussion about the development of the Assembly workbench.
User avatar
Zolko
Posts: 1182
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Sat Dec 14, 2019 6:35 pm

xyzman wrote:
Sat Dec 14, 2019 12:23 pm
A step by step guide would be very helpful. If this explained somewhere then please point me to it.
yes, I know, it doesn't exist yet, it's on my todo list.

A work bench I find useful is WorkFeatureDev it has the ability to place a point at midpoint on a line onto which I can then place a LCS. Not being able to program , but making the assumption that if I can place a point it could/ should be possible to place a LCS at the midpoint on a line in one operation.
you didn't think that one through:

1) it is already possible today to do that, with MapMode, select 2 points, and choose InertialCS

2) but that doesn't give enough information to actually place an entire LCS, there are unresolved degrees of freedom. Which doesn't happen when placing a mid-point and then translating an LCS onto that point.

Therefore this is not something that Assembly4 will implement. Generally speaking Assembly4 is mostly a wrapper around existing core FreeCAD functions, there are very few — if any — low-level functions.

As for WorkFeatureDev, there are zillions of FreeCAD workbenches that do similar stuff (Draft, Curves...) and in-fine I'm not sure that this diversity is really so advantageous for FreeCAD users. Admittedly, you could say the same about assembly workbenches :-)
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
xyzman
Posts: 4
Joined: Thu Oct 24, 2019 8:45 am

Re: Assembly 4 workbench

Postby xyzman » Sun Dec 15, 2019 7:06 am

Thank you for your reply. Some clarity has been achieved.
User avatar
OficineRobotica
Posts: 352
Joined: Thu Feb 21, 2019 8:17 am

Re: Assembly 4 workbench

Postby OficineRobotica » Sun Dec 15, 2019 7:19 am

Zolko wrote:
Fri Dec 13, 2019 9:33 am

yes, I know, it's a bug in App::Link. I also reported this problem, may-be you can chime in and give your feedback:

https://forum.freecadweb.org/viewtopic. ... 29#p353629
Sorry that I'm late to the party, busy days. I readed that thread and honestly I didn't wanted to pollute it with my opinion as it seemed to me that you already pinpointed the problem before me and the crash seemed exactly the same. Most of all I'm not a coder unfortunately.

After disabling the DAG view everything worked as aspected and i could experience the thrill of chamfering an edge witought all the hell breaking loose with my assembly.

If the PR isn't included in the next days git appimage there should be a link to the DAG view workaround inside this thread so that other users can avoid the crash.
Thank you Zolko.
User avatar
ppemawm
Posts: 766
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: Assembly 4 workbench

Postby ppemawm » Sun Dec 15, 2019 6:06 pm

xyzman wrote:
Sat Dec 14, 2019 12:23 pm
1. to get a part to slide on a rod?
2. a rod / shaft to turn in a bearing ,bush etc.
3. and the combination of the two, a rod turning and sliding in a slot .
Until we get another of Zolko's excellent tutorials perhaps the attached file will help with the basics.

I would not use a master sketch for the animation of your examples. Rather, one method is to animate the LCS's for each of the parts.
Assuming that you know how to create an Assembly4 file and assemble the parts, the next steps are as follows (see attached file):

Slide Part On a Rod (Hide Shaft and Nut in Model)
1. Create Assembly4 > Variable to define the position of the LCS's, e.g. bush_distance. The value is the default position.
2. Create an LCS that will be animated, e.g. LCS_1_bush_distance. Map it to LCS_0 > Object's XYZ.
3. Use Expressions to define its MapMode > AttachmentOffset Z > Variables.bush_distance as shown in the image below
4. Attach the Part_bush001 LCS_1001 to the Parent Assembly LCS_1_bush_distance using Assembly4>Move/Attach a Part
5. Select Animator, Variable > bush_distance and input begin/end positions and step value. Run for animation.

Picture1.png
Picture1.png (130.77 KiB) Viewed 853 times
Turn shaft in Bushing (Hide rod001,bush001, and nut in Model. Unhide shaft.)
1. Create Variable to define angle of shaft rotation
2. Create LCS_2_shaft_rotate that will be rotated and Map to LCS_0
3. Expand AttachmentOffset and use Expressions to define Angle > Variables.shaft_rotation as shown in image. Axis Z=1.
4. Attach Part_shaft to the Parent Assembly LCS_2_shaft_rotate
5. Select Animator, Variable > shaft_rotation and input begin/end and step values (these will be in degrees). Run for animation.

Picture2.png
Picture2.png (101.2 KiB) Viewed 853 times
Combination ( Unhide nut)
1. There can be only one independent variable.
2. Create Variable to define position of nut as a function of the shaft rotation, e.g. one shaft turn (360 deg) displaces nut 90 mm as shown below
3. Create LCS_2_nut_position and map to LCS_0
4. Use Expressions to define the MapMode > AttachmentOffset Z > Variables.nut_position
5. Attach Part_nut to the Parent Assembly LCS_2_nut_position
6. Select Animator, Variable > shaft_rotation and input begin/end and step values as above. Run for animation.

Picture3.png
Picture3.png (107.1 KiB) Viewed 853 times
rod_slide.FCStd
(46.02 KiB) Downloaded 34 times

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18848 (Git)
Build type: Release
Branch: master
Hash: 50f4c012b4d45a4d34055f0be1a48de6e293c9a8
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
"It is a poor workman who blames his tools..." ;)
User avatar
s-light
Posts: 96
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: Assembly 4 workbench

Postby s-light » Tue Dec 17, 2019 8:23 pm

realthunder wrote:
Thu Nov 21, 2019 10:55 pm
joe.belladonna wrote:
Sat Nov 16, 2019 2:29 pm
When I close and then reopen "AssemblyOfBoxes_WithCopy", most parts in my linked parts are hidden, as you can see in a picture. Here you see Left_Body is hidden, but when the file was saved it was visible.
picture.png
Every time I reopen this document, I have to manually unhide all parts.
This is a bug, and I have fixed it already. The PR will be ready soon.
i just found that it seems the same bug is still there for Draft LinkedArray.
and it is only triggered if the linked parts are later in the document tree - to confirm this i have created two test files:
https://github.com/s-light/io_import_fc ... Visibility

Code: Select all

daily build - FreeCAD.Version(): ['0', '19', '', 'https://code.launchpad.net/~vcs-imports/freecad/trunk', '2019/12/17 15:26:22']
OS: Ubuntu 19.10 (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.7.5
Qt version: 5.12.4
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
PS: i hope its fine i poste it here (as it is a followup from earlier posts here) - if there is a better place please let me know!
realthunder
Posts: 1847
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly 4 workbench

Postby realthunder » Wed Dec 18, 2019 4:40 am

s-light wrote:
Tue Dec 17, 2019 8:23 pm
PS: i hope its fine i poste it here (as it is a followup from earlier posts here) - if there is a better place please let me know!
The fix is stuck in a big PR. I just split it out to join another smaller one here, with this commit.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
s-light
Posts: 96
Joined: Thu Feb 12, 2015 11:39 am
Location: Germany, Hofheim am Taunus
Contact:

Re: Assembly 4 workbench

Postby s-light » Wed Dec 18, 2019 8:42 am

thanks realthunder for the fast respons! i will watch the pullrequest and report back when merged :-)
User avatar
ppemawm
Posts: 766
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: Assembly 4 workbench

Postby ppemawm » Wed Dec 18, 2019 4:52 pm

Zolko wrote:
Fri Dec 13, 2019 9:33 am
...may-be you can...give your feedback:
I notice that the Variables displayed in the property panel are listed alphabetically. If possible, can they be listed in the order they were created with the Assembly4 > Add Variable tool?

Picture1.jpg
Picture1.jpg (17.56 KiB) Viewed 588 times
The Variables list is an excellent location to collect all of the variables in the file. But, it also can serve as a mini-worksheet for both
entering variable values as well as documenting calculations using Expressions for parametric models. In this case, it would be better to list them in a logical order rather than alphabetically as you can see in the example above.

Also, would it be possible to add the option to change the variable name in the Variables > property panel?
"It is a poor workman who blames his tools..." ;)
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Assembly 4 workbench

Postby vocx » Wed Dec 18, 2019 6:22 pm

Zolko wrote:
Sat Dec 14, 2019 6:35 pm
...it's on my todo list.
Talking about todo lists.

What are your ideas about making your workbench more PEP8 compliant? By that I mean the Python coding style, naming style of variables, classes, organization in modules, documentation strings, etc.

Right now I see your code, and it looks kinda messy. The comment blocks are completely non-standard.

It isn't a huge problem, but I feel it would be good to make it more standardized before the workbench grows too big. Particularly the public programming interface should be more standard, following Python guidelines.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Zolko
Posts: 1182
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Thu Dec 19, 2019 8:54 am

vocx wrote:
Wed Dec 18, 2019 6:22 pm
What are your ideas about making your workbench more PEP8 compliant?
the short answer is: I have none.

vocx wrote:
Wed Dec 18, 2019 6:22 pm
Right now I see your code, and it looks kinda messy. [...] Particularly the public programming interface should be more standard, following Python guidelines.
That's an understatement.

The longer answer is: as you could see, I don't know how to do all the things that you're saying (or I'd have done it before), so If you have proposals please feel free to do so. If you know people who would be willing to make the Assembly4 code-base better, without necessarily changing the functionality, I'd be happy to take their code contributions.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here