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?
Solved! Go to Solution.
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?
Solved! Go to Solution.
Solved by g-andresen. Go to Solution.
@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!
@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!
Hi,
Please share the file with the equation
File > export > save as f3d on local drive > attach to post
günther
Hi,
Please share the file with the equation
File > export > save as f3d on local drive > attach to post
günther
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!
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!
Impossible to tell without knowing how each parameter has been defined.
ETFrench
Impossible to tell without knowing how each parameter has been defined.
ETFrench
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?
the values PI ~ 180° and 2*PI ~ 360° are wrong for the sine.
günther
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?
the values PI ~ 180° and 2*PI ~ 360° are wrong for the sine.
günther
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!
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!
@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!
@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!
Hi,
Many thanks for the feedback.
Is there an explanation for the sine 180deg & 360deg ?
günther
Hi,
Many thanks for the feedback.
Is there an explanation for the sine 180deg & 360deg ?
günther
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!
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!
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
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.