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.
Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
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.
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
Yes. The goal was to have the same terminology for linear and circular arrays. Would "Axis" be better name ?
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
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
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
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
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.
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
It would look like this in the Property View
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
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.
Re: Using V0.21 Draft Link Arrays in Assembly4 V0.12.3
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