Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

Zolko wrote: Mon Sep 19, 2022 9:52 pm I'm having a very busy week, I won't be able to update your code but I really would like to have it in there for the next release
I have had a few very busy weeks too. I think I get your ideas now and it seems I will have time to make a more complete PR this weekend.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Zolko »

Jolbas wrote: Mon Oct 03, 2022 3:53 pm it seems I will have time to make a more complete PR this weekend.
that would be great. There has been quite some development for the BOM so it would be nice to be able to release a new version with all these improvements.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

Zolko wrote: Mon Sep 19, 2022 9:52 pm 3) optionally, select direction
A question about terminology as my native language is not English. Is "Direction" understandable as the axis in a circular array?
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Zolko »

Jolbas wrote: Sat Oct 08, 2022 8:50 am
Zolko wrote: Mon Sep 19, 2022 9:52 pm 3) optionally, select direction
Is "Direction" understandable as the axis in a circular array?
Yes. The goal was to have the same terminology for linear and circular arrays. Would "Axis" be better name ?
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

Zolko wrote: Sat Oct 08, 2022 8:54 am Would "Axis" be better name ?
I think I would prefer Axis, but as said, I'm not that familiar with English.
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

I have done some more testing and coding I would like some input about property names and kinds.

The main ExpressionArray type has the following properties

Index (hidden)
This is the property that is incremented before calculation of an elements position

Axis Placement
If an axis is chosen on creation this property will hava a preset expression that gives its position. For example if Y axis of LCS_1 is selected on creation it is preset to: LCS_1.Placement*create(<<rotation>>;0;0;-90). If a axis is selected it is just set to Axis_1.Placement

Element Placement
The Source Object Placement is internally first set to align the Axis Placement. Then transformed using this property. As a default there is an expression on the Angle subproperty: IntervalAngle*Index and one default expression on the Position.z: LinearStep*Index.

Linear Step
To easily input desired step size. Default is for example 100mm. If you want the last element on a certain distance. Set the property expression to: 180/(ElementCount-1).

Interval Angle
This has the default expression of 360/ElementCount and if you for example want the last element on 180° you set the property expression to: 180/(ElementCount-1).

Then there is the Circular Array. The only difference from Expression Array is that you have to choose an Axis and the Linear Step is set to 0 and is hidden. Also Element Placement is hidden

Linear Array on the other hand hides Interval Angle an set it to 0
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

I feel that the Circular and Linear Arrays are almost not necessary to have as it is quite easy to set linear or angular steps to 0 after creation of an Expression Array.
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

It would look like this in the Property View
propview.png
propview.png (70.08 KiB) Viewed 1044 times
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

ppemawm wrote: Mon Sep 19, 2022 4:10 pm 5. Will the array object accommodate path link arrays? EDIT: Could it also accommodate mirrors?
I thinking of a path to accomplish this. If we add a ElementScaleVector property to the array that also is calculated using the Index property during recompute. Say we set an expression on x in this property to (Index%2)==1?-1:1. Then this Scale is also copied to the child link elements along with the calculated placement.
It would only be possible to mirror on a plane through the linked parts origin before the placement, but that may be enough.
User avatar
Jolbas
Posts: 330
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3

Post by Jolbas »

Mirroring could also just support the most common scenario with a property MirrorEachOther where you can just select from None, XY-Plane, XZ-Plane or YZ-Plane
Post Reply