dulimarta / spherical-easel

https://spherical-easel.vercel.app
Other
3 stars 7 forks source link

Slow display with many line segments #4

Open dickinson0718 opened 3 years ago

dickinson0718 commented 3 years ago

In the process of updating documentation, I updated the rotation handler which is now allows rotations about a point and translations along a line. It is fun to play with and you should check out the latest update.

For more fun, I was trying to sketch the Death Star :slightly_smiling_face: and I made a very rough sketch (maybe 1 line, 4 circles and 16 line segments & 20 points). After doing this I discovered:

  1. Rotating it was super super slow. Like I would start a rotation and then couldn’t interrupt the process for 15 seconds. Experimenting seems to show that you have 30-40 points rotation is fine, adding 4-6 circle is still ok (except if your circle has radius bigger than Pi/2), but adding only 4-6 line segments really slows it down. Perhaps that intersections calculation for line segments slows it down?

Issue #2 seems more pressing as I can imagine some of the constructions that I would make in my own research experiments would be much more complex and involve more parts. I’m not sure how to handle this issue — I’m not even sure what to make more efficient or even if efficiency is the issue.

dulimarta commented 2 years ago

The BFS update strategy implemented in 7c34ea0bf414fc0495e527acdef0d715c5de8e8c should improve the performance somewhat.