Assembly 4 workbench

Discussion about the development of the Assembly workbench.
Bayesian
Posts: 87
Joined: Thu Aug 08, 2019 1:49 pm

Re: Assembly 4 workbench

Postby Bayesian » Mon Nov 11, 2019 9:53 am

I have started to use Jupyter Notebooks to organize documents, parameters and exports.

I put the instructions, like opening documents or changing values and recomputing in different cells and execute them, sort of adhoc macros with less clicking.

I haven't used it with the Assembly4 workbench yet, though.
User avatar
Zolko
Posts: 1189
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Mon Nov 11, 2019 10:20 am

joe.belladonna wrote:
Sat Nov 09, 2019 10:16 pm
Box was linked, but Variables were empty. Like in the picture2. Everything was there except for Variables.
I just tested this, and you're right, there is something fishy. Actually, it does work, because you can still change the variables in the original sub-assembly, and the parameters are transfered as they should, but the Variables object of the sub-assembly as shown in the tree of the link shows actually the Variables object of the higher-level assembly, and thus one cannot modify the variables of the sub-assembly directly in the tree of the assembly, it must be done in the window of the sub-assembly.

I must look into the details, but this is I think a bug in App::Link

joe.belladonna wrote:
Sat Nov 09, 2019 10:16 pm
  • Is it possible to "detach" link after linking, but to keep all the properties of a linked part? I would like to link my Box and then "detach" it and change Variables so my Box will have some specific dimensions. Then I would like to link my Box second time, but this time with different dimensions. That way, I will have two Boxes with all the properties of an original Box, but with different values.
This is what was called Variant Links, and today no, it's not possible. The current App::Link implementation does allow to make exactly the feature you're asking-for, but it cannot be saved to disk. I've made a proof-of-concept about this possibility, but it was not well received. I too think that this feature would be remarkable and would put FreeCAD in another league of the CAD software, but I don't know how to proceed. If you have ideas please tell us/me
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
BassMati
Posts: 82
Joined: Sat Oct 06, 2018 11:39 am

Re: Assembly 4 workbench

Postby BassMati » Mon Nov 11, 2019 10:59 am

Zolko wrote:
Mon Nov 11, 2019 10:20 am
joe.belladonna wrote:
Sat Nov 09, 2019 10:16 pm
  • Is it possible to "detach" link after linking, but to keep all the properties … That way, I will have two Boxes with all the properties of an original Box, but with different values.
This is what was called Variant Links, and today no, it's not possible…
Just an idea: Create two (or) more variants, and switch between them by hiding and showing them. Served well for me, but might cause trouble with generating the bill of material...
joe.belladonna
Posts: 18
Joined: Sat Nov 09, 2019 9:18 pm

Re: Assembly 4 workbench

Postby joe.belladonna » Mon Nov 11, 2019 7:42 pm

Zolko wrote:
Mon Nov 11, 2019 10:20 am
If you have ideas please tell us/me
Would it be possible to use something like in picture1. There, I have used "Override colors.." to override color of linked object.
picture1.png
picture1.png (71.19 KiB) Viewed 612 times
If we could override "Variables", then the problem would be solved :-). If we can get two linked Boxes with different colors, maybe it would be possible to override some other properties, like complete set of "Variables"?

I have attached my Boxes assembly (Box.FCStd). There, I have created one Box from linked parts that are within that assembly. Is it possible to have parametric placement of a part? I have created one variable named "TopOverSide", and I would like to have different placement of parts depending on the value of this variable. When this variable is true I would like to use certain LCSs for placement, and when this variable is false, I would like to use different LCSs for placement.

Finally, I have created different assembly. It is AssemblyOfBoxes_WithCopy (AssemblyOfBoxes_WithCopy.FCStd). I have copied Boxes in that assembly (CTRL+C) in Parts Group. I only copied Model part of Boxes like in picture2. I didn't copied the Part group, but when I pasted it in new assembly, everything were like it should be. Even variables changed names, and constraints followed that name change.
picture2.png
picture2.png (18 KiB) Viewed 612 times
After I made those copies, my new assembly worked like I was expecting. I only had to hide some objects. Changing variables in one part changed geometry of only that part. The only downside is the copy itself, because the file size is bigger then that when we were only linking objects. You can see in attached files how I did that.
Attachments
Box.FCStd
(45.27 KiB) Downloaded 13 times
AssemblyOfBoxes_WithCopy.FCStd
(92.61 KiB) Downloaded 10 times
AssemblyOfBoxes.FCStd
(7.86 KiB) Downloaded 20 times
User avatar
Zolko
Posts: 1189
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Mon Nov 11, 2019 9:34 pm

joe.belladonna wrote:
Mon Nov 11, 2019 7:42 pm
There, I have used "Override colors.." to override color of linked object. If we could override "Variables", then the problem would be solved :-). If we can get two linked Boxes with different colors, maybe it would be possible to override some other properties, like complete set of "Variables"?
the point is that App::Link shares the geometries of objects: if you only change the colour it doesn't change its shape, but if you change a variable it would change the shape. So it's not as simple as overriding the Variables object.

joe.belladonna wrote:
Mon Nov 11, 2019 7:42 pm
Is it possible to have parametric placement of a part?
theoretically I think yes, but it's currently not implemented in Assembly4. If you have time to look into the code I'd be happy to include your contribution.

joe.belladonna wrote:
Mon Nov 11, 2019 7:42 pm
The only downside is the copy itself, because the file size is bigger then that when we were only linking objects.
Yes, I think that that's the correct way. What I did was to copy objects to documents in RAM, created on-the-fly, not written to disk, and variables were set on these — volatile — objects, and everything worked fine. Except that you could not write to disk. Each variant link took some extra memory, but not disk-space.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
Zolko
Posts: 1189
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Tue Nov 12, 2019 7:47 am

joe.belladonna wrote:
Mon Nov 11, 2019 7:42 pm
I have attached my Boxes assembly (Box.FCStd). There, I have created one Box from linked parts that are within that assembly.
...
Finally, I have created different assembly. It is AssemblyOfBoxes_WithCopy (AssemblyOfBoxes_WithCopy.FCStd).
what system are you using ? Which version of FreeCAD and Assembly4 ? I've played with your files, and they give me very strange results. These are my settings:

Code: Select all

OS: Ubuntu 18.04.3 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18714 (Git) AppImage
Build type: Release
Branch: master
Hash: a7ad04ba4aefb486fbc5e7c68da3dd488443b08c
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
with Assembly4 v0.7.1
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
basmati
Posts: 27
Joined: Thu Oct 31, 2019 10:22 am

Re: Assembly 4 workbench

Postby basmati » Tue Nov 12, 2019 11:39 am

I'm having problems trying to create a Render of an Assembly 4 assembly.

The assembly consists of many diferent parts, most of them should be made of different materials.
I want to use the render workbench and the appleseed renderer.

The problem I'm having is when I want to add my parts to the render view.

I already imported all my links into the file I'm working in (linking to external files doesnt seem to work when I try to add them to a view).

I can't select parts to add to a view – only items like bodies etc. work.
But when I add these bodies to the view, they of course are not positioned.

Since I can't add parts to a Raytracing project, I assume these problems also exist in the current Raytracing workbench.

Is there a way I could "bake in" the assembly / positioning?
Or something I'm missing?

Thanks!
User avatar
Zolko
Posts: 1189
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Postby Zolko » Tue Nov 12, 2019 1:18 pm

basmati wrote:
Tue Nov 12, 2019 11:39 am
I'm having problems trying to create a Render of an Assembly 4 assembly.
...
Is there a way I could "bake in" the assembly / positioning?
1) you're exploring domains nobody has tried, so you're encountering dragons and princesses for the first time: good luck.

2) a possible solution for your problem would be to "export" the assembly to some sort of exchange format that you could import into your renderer. STEP seems like a 1st choice: did you try to export an Assembly4 assembly to STEP ?

3) with an export you'll loose parametric positioning: as of today, I don't think it's a reasonable request to have a well-working exchange with a renderer AND retaining the native parametric positioning. Both App::Link and Assembly4 are alpha-grade software, meaning that they mostly work, but expecting such advanced features as ray-tracing is beyond our current investment possibilities.

Therefore, all-in-all, I'd suggest you try STEP export/import.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
basmati
Posts: 27
Joined: Thu Oct 31, 2019 10:22 am

Re: Assembly 4 workbench

Postby basmati » Tue Nov 12, 2019 2:06 pm

great suggestion!
But it did not work.
The imported step model also consists of parts, therefore the solids in it aren't positionted.
But then I simply selected all the parts and converted them to solids.
Works!

(this also works with the original assembly links. So at this moment you need to convert the parts to solids using the Part workbench.
Luckily, you can select all of them and convert them at once – one solid per Part will be created.
To move this "solidified assembly" you can select all of them and enter the wanted coorinates in the Position field.
joe.belladonna
Posts: 18
Joined: Sat Nov 09, 2019 9:18 pm

Re: Assembly 4 workbench

Postby joe.belladonna » Tue Nov 12, 2019 5:01 pm

Zolko wrote:
Tue Nov 12, 2019 7:47 am
what system are you using ? Which version of FreeCAD and Assembly4 ?
This is my FreCAD version:

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18686 (Git)
Build type: Release
Branch: master
Hash: f0cdad7f708c0185961cd7185e366df22e041d02
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Serbian/Serbia (sr_RS)
And my Assembly4 version is: 0.7.0