anvaka/streamlines

Storing dTest and dSep on Streamline Added

kimalbrecht opened this issue · 2 comments

Thank you, Andrei this is so so fantastic!

In the original paper by Jobard I found the "Tapering effect" (p. 9 - 10). The idea is to taper the lines, change the thickness based on the spacing towards the next line. I have tried to replicate this with you library, so far without success. The functions "checkDTest" and "checkDSep" contain the needed values. With some unpleasant global variables I was able to store dTest and dSep. But the output looks wrong.

Have you looked into this? Is there an easy way to store dTest and dSep in the 'onStreamlineAdded' function?

Thank you!

Hi Kim,

Just checked this out. To implement the tapering effect you need to find the distance from the candidate point to the nearest rendered streamline. onPointAdded is a perfect candidate for this. I realize that the library didn't expose spatial lookup data structure to help with finding the nearest point. I exposed it in v1.3.0 and added a demo of how to get the line's width smaller as it approaches another streamline:

image

Hi Andrei, super impressive. Thank you. I'll have a closer look at your changes as I couldn't get those values. And thank you in general for the fantastic work!