floor function broken when using driven constraints and causes Fusion 360 to crash

floor function broken when using driven constraints and causes Fusion 360 to crash

mjvaal
Explorer Explorer
654 Views
10 Replies
Message 1 of 11

floor function broken when using driven constraints and causes Fusion 360 to crash

mjvaal
Explorer
Explorer

I am pretty sure the cause of this issue is a combination of driven constraints and using them in User Parameters. This causes Fusion 360 to crash if you use the named driven constraint in the User Parameters.

As you can see in the screenshot, the floor function is broken, this Value here should be '66'. Strangely, removing floor changes the value, so some equation is actually being applied here.

Using the 'ExactScale' variable here after this is set anywhere in the User Parameters causes Fusion 360 to crash.

Screenshot 2022-08-30 103938.png

Screenshot 2022-08-30 104244.png

0 Likes
Accepted solutions (1)
655 Views
10 Replies
Replies (10)
Message 2 of 11

Steven_Gao
Community Manager
Community Manager

Can you help to share the Fusion 360 file to us for confirmation and further investigation?

 

Thanks in advance!

Steven

0 Likes
Message 3 of 11

mjvaal
Explorer
Explorer

Added, though I can't recreate the crashing now after restart. floor function still appears to be broken though.

0 Likes
Message 4 of 11

Steven_Gao
Community Manager
Community Manager

Thanks for sharing the file. I cannot reproduce the crash but the Floor function seems not working in here. Let me log an internal defect to track this problem.

 

Thanks,

Steven

0 Likes
Message 5 of 11

Steven_Gao
Community Manager
Community Manager

FYI, the internal defect ID is FUS-112354.

0 Likes
Message 6 of 11

Steven_Gao
Community Manager
Community Manager
Accepted solution

Hello, our development team took a look at this problem and confirmed this is showing a flaw in our parsing of expressions. They also provided a couple of workarounds that can help you in this case until there is a fix:

Workaround 1

Use an intermediate parameter to help in the calculation. For example

Name Expression Value
Temp ScaledMK3sShortSidePrint / 3 in * 100 66.2113
ExactScale floor(Temp) 66

Workaround 2

Don't mix unit types in the expression when using floor. In the users expression

floor(ScaledMK3sShortSidePrint / 3 in * 100)

ScaledMK3sShortSidePrint is in mm and it's being divided by an inch value. If you convert the denominator into mm so it matches the unit in the numerator, i.e. 76.2mm instead of 3in, the problem no longer occurs.

 

Thanks,

Steven

0 Likes
Message 7 of 11

kit5QJW7
Community Visitor
Community Visitor

I'm getting the same problem with ceil();  I get a "failed to resolve" error.

This bug seems happens with any of the maths functions, eg. ceil(), floor(), round() etc.

 

Using an intermediate parameter didn't work for me either; the intermediate parameter was created fine, referencing the driven dimension, but it couldn't be used in ceil() or any other function.

Message 8 of 11

felix85SA3
Participant
Participant

fusion360_dependent_calculation2.png

 

I tried the workaround with the intermediate variable and got weird behaviour. Sometimes it helps to trigger 'Compute All' multiple times, in the attached sample file it doesn't.

 

In the screenshot above I've added a driven dimension to the length that is controlled by the calculated value.

0 Likes
Message 9 of 11

deb.foster
Explorer
Explorer

The floor and ceil functions are still broken. Fusion is not crashing for me when using a driven dimension like it was for the original poster but it still is not functioning correctly. I have attached a simple example of the problem I am having. As you can see in the attached screenshot, the dimensions for Box_2_Height and Box_2_Width calculated properly in the Parameters window but they do not update the sketch correctly. I tried this with both the floor and ceil functions. Same problem with both.

 

This is my first time posting anything so if I didn't do it correctly please instruct me how to do it right. Thanks for your help.

Message 10 of 11

ccyokes
Participant
Participant

After banging my head against a wall for a little over 2 hr trying to figure out what was going wrong, I finally came to the same conclusion as you. It's still broken. I made an even more simple demonstration to prove it as well before finding this thread now that I know what the root cause is. Create a new file, draw a square, dimension one edge to 2 (in or mm, doesn't matter), dimension the second edge to ceil(d1), and instantly you get a "failed to solve" error. Doesn't matter if you strip the units from d1 before going into the function, the result is the same.

 

User parameters will take the driven dimension and work with it just fine, but using that user parameter inside of a sketch again causes the sketch line to turn black showing that it is fully constrained, however you can just drag it around and it doesn't snap back into the right position, nor does it give you any error message. Very strange behavior that took so long to figure out what was actually causing the dimension not to be locked down despite getting no error messages.

 

You can even add a second box with d3 on one edge and use that in the ceil function and it works just fine, proving that having units isn't what causes the issue, it's putting a driven dimension in. (previous related reports were having issues because of putting unit dimensions into the function, but this has since been improved)

 

Might need to repost this under a new bug report since your message didn't get any attention even months later. Not sure if this one will either.

 

Screenshot shows test I explained. d3 stuck, but trying to swap to d1 throws an error and reverts d2 to using d3.

0 Likes
Message 11 of 11

mjvaal
Explorer
Explorer

They did open a ticket (FUS-112354) and gave a work around of sorts, but I am not sure how to see the status of the ticket.

0 Likes