Closed gunnarmein closed 7 years ago
Issues #30 to #33 look pretty simple, will write quick fixes for them tonight.
I would use caution with #33. A mistake here would influence the math in an undetectable way.
Didn't mean to close this.
Just ran a benchmark test to determine how shakeUpPoints runs right now. For my Bent Sphere JSON file (the realistic one), it takes 85.2493 seconds to perform 20 shake-up operations on 2000 total points. Note that the Bent Sphere JSON object includes a complex STL file.
After fixing #30, the operation described above takes 29.4334 seconds.
Just built a fix for this. No meaningful change in performance visible.
Your stl file is not a great case for this fix. This one only matters when surface area involves more complex calculations, like the torus segment. Triangles are too simple. But, we may never have enough complex shapes for this to matter.
Every time we choose a random point, we compute the surface area of parts over and over again. That value needs to be cached. Here is one easy way: