You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code was iterating through a mesh, defining supports. This was no problem until I added a y_control to the mesh, at which point some of the supports disappeared.
I looked through the examples and noticed they all use round(value, 10) in this case, and I added that to my code and it solved the problem. This seems like just a floating point precision problem. Correct?
It also seems like moving the call to round() into the library would be an improvement.
I wrote a patch to Node3D.py (attached) that:
adds class RoundFloat(float) that overrides the equality operator to compare the rounded values
added getters and setters for X, Y, and Z that store RoundFloat objects instead of floats
The patch should only affect comparisons between node coordinates and floats. It is working for me and doesn't seem to have a measurable performance impact. Thoughts appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My code was iterating through a mesh, defining supports. This was no problem until I added a y_control to the mesh, at which point some of the supports disappeared.
I looked through the examples and noticed they all use round(value, 10) in this case, and I added that to my code and it solved the problem. This seems like just a floating point precision problem. Correct?
It also seems like moving the call to round() into the library would be an improvement.
I wrote a patch to Node3D.py (attached) that:
The patch should only affect comparisons between node coordinates and floats. It is working for me and doesn't seem to have a measurable performance impact. Thoughts appreciated.
Beta Was this translation helpful? Give feedback.
All reactions