How to multiply/pow constraints in formulas ?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
elurkki
Posts: 6
Joined: Mon Feb 03, 2020 9:41 pm

How to multiply/pow constraints in formulas ?

Post by elurkki »

Hi,

I am testing 0.20.2 and latest weekly here. I have named constraints in my test Sketch and trying to solve pythagoras here (probably I could do this without expressions as well but do not know how).

When I give formula "Sketch003.Constraints.bottom_big_radius", the constraints is used (Picture 1). When I use Sketch003.Constraints.bottom_big_radius*Sketch003.Constraints.bottom_big_radius or pow(Sketch003.Constraints.bottom_big_radius,2) (Picture 2 and 3), I get message: "Unit mismatch between result and required unit". How could I prevent this happening?

Thanks a lot for help!

Picture 1:
Screenshot from 2023-02-01 21-10-24.png
Screenshot from 2023-02-01 21-10-24.png (25.98 KiB) Viewed 603 times
Picture 2:
Screenshot from 2023-02-01 21-10-33.png
Screenshot from 2023-02-01 21-10-33.png (29.49 KiB) Viewed 603 times
Picture 3:
Screenshot from 2023-02-01 21-10-45.png
Screenshot from 2023-02-01 21-10-45.png (27.6 KiB) Viewed 603 times
edwilliams16
Veteran
Posts: 3111
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: How to multiply/pow constraints in formulas ?

Post by edwilliams16 »

If you multiply two lengths together the result has units mm^2 To correct this divide the result by 1 mm.
elurkki
Posts: 6
Joined: Mon Feb 03, 2020 9:41 pm

Re: How to multiply/pow constraints in formulas ?

Post by elurkki »

Hi,

Ah excellent. Great thanks! I just should have written the whole equation with sqrt included and the units would be correct after that.

Thanks very much for the answer!
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: How to multiply/pow constraints in formulas ?

Post by Shalmeneser »

:idea:
Attachments
Capture d’écran 2023-02-01 213510.jpg
Capture d’écran 2023-02-01 213510.jpg (48.42 KiB) Viewed 520 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: How to multiply/pow constraints in formulas ?

Post by Roy_043 »

Please also read Expressions.
Post Reply