Community
Fusion Design, Validate & Document
Stuck on a workflow? Have a tricky question about a Fusion (formerly Fusion 360) feature? Share your project, tips and tricks, ask questions, and get advice from the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trouble with long equation using IF parameter

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
01165479
269 Views, 11 Replies

Trouble with long equation using IF parameter

Hello, what I want to achieve, is simple "if there are x number of holes, perform this equation" via parameter.
I got "a" defined in mm and "hole" defined without unit.

I run into trouble when creating the unit less parameter for the required equation
"invalid string ";" in expression"
Here is my code

if((hole==2; (a / 2)); (hole==3; ((a * sqrt(3)) / 2)); ((hole==4; (a * sqrt(2)) / 2)); (hole==5; ((a * sqrt(50 + 10 * sqrt(5))) / 10)); (hole==6; a); (hole==7; (a / (2 * sin(PI / 7)))); (hole==8; (a * sqrt((2 + sqrt(2)) / 2))); 0)

Could anyone help me review this? 

11 REPLIES 11
Message 2 of 12
CGBenner
in reply to: 01165479

@01165479 

Welcome to the forum.  I've moved your post here for better visibility.  Good luck!


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project
Message 3 of 12
g-andresen
in reply to: 01165479

Hi,

Please share the file with the equation

 

File > export > save as f3d on local drive  > attach to post

 

günther

Message 4 of 12
g-andresen
in reply to: 01165479

Hi,

gandresen_1-1727287099280.png

 

 

have a look at Product Documentation 

 

günther

 

Message 5 of 12
johnsonshiue
in reply to: 01165479

Hi! Either there is a bug in the Fusion equation parser or there is an inconsistent unit issue (not all terms have the same type of unit). Please share the f3d file here. The forum experts can help take a further look.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 6 of 12
etfrench
in reply to: 01165479

Impossible to tell without knowing how each parameter has been defined.

ETFrench

EESignature

Message 7 of 12
g-andresen
in reply to: 01165479

Hi,

1. each condition is introduced with an IF.
2. if you want a value without units, you must divide by mm at the end. (Reason: a has units)
3. the unit rad must be added for the sine, because otherwise Fusion assumes that PI is the number 3.14 and adds the unit deg.
@johnsonshiue  Is this intentional?


4. @johnsonshiue 

the values PI ~ 180° and 2*PI ~ 360° are wrong for the sine.

 

 

günther

 

Message 8 of 12
johnsonshiue
in reply to: g-andresen

Hi Günther,

 

Many thanks for sharing the file and the comments! I do believe this is the intended behavior. Fusion equation is indeed unit sensitive. If you enter a value without a unit attached, the default unit for the particular function will be added. The default angular unit is degree, not rad. You may change it in the Preferences -> Default Units.

Thanks again!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 9 of 12
CGBenner
in reply to: 01165479

@01165479 Did the information provided answer your question? If so, please use Accept Solution so that others may find this in the future. Thank you very much!


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project
Message 10 of 12
g-andresen
in reply to: johnsonshiue

Hi,

Many thanks for the feedback.


Is there an explanation for the sine 180deg & 360deg ?

 

günther

 

Message 11 of 12
johnsonshiue
in reply to: g-andresen

Hi Günther,

 

Regarding the values returned from trigonometric functions, the minute numerical deviation is due to how these functions are being approximated numerically. Some programs limit the number of decimal places so that the noise is not shown. In Fusion, you may add a wrap around the functions by using "round()." With or without the wrap, the result should be the same.

Here is an explanation of why such deviation exists. 

https://stackoverflow.com/questions/51820357/c-trigonometric-function-returns-unexpected-value

 

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 12 of 12
g-andresen
in reply to: johnsonshiue

Hi,

Many thanks for the info.
I came across this behavior by chance and don't currently have a design example where this could play a role.

 

günther

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report