Scale just one axis

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ceving
Posts: 87
Joined: Wed Sep 20, 2017 9:46 am

Re: Scale just one axis

Post by ceving »

Zolko wrote: Fri Apr 17, 2020 9:12 am Did it move physically (did its Placement change)?
Yes. The LCS is attached to the object. Therefor scaling of the object must move the LCS.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Scale just one axis

Post by Zolko »

ceving wrote: Fri Apr 17, 2020 10:50 am Yes. The LCS is attached to the object. Therefor scaling of the object must move the LCS.
"must" ? Did you check ?
try the Assembly4 workbench for FreCAD — tutorials here and here
ceving
Posts: 87
Joined: Wed Sep 20, 2017 9:46 am

Re: Scale just one axis

Post by ceving »

Zolko wrote: Fri Apr 17, 2020 11:20 am
ceving wrote: Fri Apr 17, 2020 10:50 am Yes. The LCS is attached to the object. Therefor scaling of the object must move the LCS.
"must" ? Did you check ?
"must" reflects my expectation. What I have said would be a logical behavior for me.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Scale just one axis

Post by Zolko »

ceving wrote: Fri Apr 17, 2020 11:42 am "must" reflects my expectation. What I have said would be a logical behavior for me.
let me guess: "millenial" ?
try the Assembly4 workbench for FreCAD — tutorials here and here
ceving
Posts: 87
Joined: Wed Sep 20, 2017 9:46 am

Re: Scale just one axis

Post by ceving »

Zolko wrote: Fri Apr 17, 2020 12:01 pm
ceving wrote: Fri Apr 17, 2020 11:42 am "must" reflects my expectation. What I have said would be a logical behavior for me.
let me guess: "millenial" ?
Nope. X.

Don't you think it is logical, what I have said?

Take a balloon. Inflate it half. Then stick a cross on the balloon. Then inflate it further. What does the cross do? Does it keep its position or does it move?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Scale just one axis

Post by adrianinsaval »

Zolko is talking about the Placement property of the LCS which is used by assembly 4, this property is not changed with the link scaling as it only affects the visual representation.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Scale just one axis

Post by realthunder »

Zolko wrote: Fri Apr 17, 2020 9:12 am ... visually. Did it move physically (did its Placement change) ? I've argued with realthunder that this scaling of App::Link objects is a bad idea, even though I didn't have any hard evidence to point out why, and I wasn't able to convince him. Now you're giving this hard evidence.
No. It's quite the opposite, as this just shows how useful it is to have the scale option. Scaling is a complex operation, and it has given me trouble in more than one occasions, but that is not a valid reason to just give up on it.

Speaking of the use case here, Winkel001 placement expression is

Code: Select all

Rexroth_Nut_6.Placement * Rexroth_Nut_6#LCS_Opposite.Placement * AttachmentOffset * Winkel#LCS_Origin.Placement ^ -1
which does not take the scaling of Rexroth_Nut_6 into consideration. This is exactly why I provide the '_pla' pseudo property. The expression can be simplified as

Code: Select all

Rexroth_Nut_6.<<LCS_Opposite.>>._pla * AttachmentOffset * Winkel#LCS_Origin.Placement ^ -1
'_pla' uses the getSubObject() API to obtain the accumulated sub object placement, which includes any scaling factors along the object path. There is also the '_mat' property for accumulated matrix.

BTW, I wouldn't recommend using the explicit document referencing scheme here (i.e. Winkel#LCS_Origin). Just imagine if user manually change the link to point to another object. You can try the local sub-object referencing

Code: Select all

Rexroth_Nut_6.<<LCS_Opposite.>>._pla * AttachmentOffset * .<<LCS_Origin.>>.Placement ^ -1

Finally, here is the PR to fix the visualization problem of a scaled LCS.
Try Assembly3 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
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Scale just one axis

Post by Zolko »

realthunder wrote: Sat Apr 18, 2020 9:09 am BTW, I wouldn't recommend using the explicit document referencing scheme here (i.e. Winkel#LCS_Origin). Just imagine if user manually change the link to point to another object.
you're right, but it's on purpose: I don't like magic behind the scenes, if the link fails because the user made a mistake I prefer the program to tell up-front so the user can investigate and correct the problem, rather than finding a solution that looks good and will be good most of the time, but not always. In this particular case, if a user points the link to another object then the LCS_Origin in the new object might not be there, or might mean something else, or will have a different orientation, or ...

As for the scaling, I still think that the better and more general solution would be the variant link we have discussed many times. For v0.20 may-be ?
try the Assembly4 workbench for FreCAD — tutorials here and here
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Scale just one axis

Post by realthunder »

Zolko wrote: Sat Apr 18, 2020 9:37 am As for the scaling, I still think that the better and more general solution would be the variant link we have discussed many times. For v0.20 may-be ?
Looks like it has to wait for 0.20. I have further developed this a bit in my fork. And I'll soon make a release.
Try Assembly3 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
Post Reply