Grasshopper

algorithmic modeling for Rhino

Here is a new version (First version here) of "Kernel Density Estimation-based Edge Bundling" based on work from Christophe Hurter, Alexandru Telea, and Ozan Ersoy.
Graph Bundling by Kernel Density Estimation.
EuroVis 2012. Computer Graphics Forum journal.

http://www.recherche.enac.fr/~hurter/KDEEB/KDEEB.html

It is based on Visual Studio C# code instance (CPU version) from Antoine LHUILLIER. I changes a bit the code, use of Point3d, Vector3d, change 2D matrix in 1D to 2D ...

The inputs are :

  • lines, on XY plane, which are the base of the graph. The script use end and beginning points.
    • There are some examples in the script, see pictures above
  • There is parameter for the number of runs
  • The is a parameter for Kernel size in pixel
  • The is a parameter for number of smoothings
  • The size of the rasterization grid is by default 300 pixels 
  • The size of the derivative windows grid is by default 1.5 x Kernel size

!! Warning calculations could be long

As outputs 

  • the new graph as polylines
  • I also put a nurbs curve form the polyline (with 100 control points)
  • A mesh representing the accumulation map

Many of the parameters  have an effect on the output, play with them, beware of time. 

Here are some images.

1000 lines random on a rectangle

A inkscape render

Views: 9795

Attachments:

Replies to This Discussion

Hi! May i ask if theres any way i can input curves/polylines instead of lines into the system? 

I Will look at that tomorrow. But it is surely possible. Did you look at the source ?
Have you some examples of curves ?

Oh! 

Tweaked your script slightly by getting curve ends instead of _line.From and _line.To and it worked. I hope i'm doing the right thing, not too experienced with scripting. 

Attached is the simplified file (i removed everything except for the c# script).

Thank you for the reply Laurent! :)

Attachments:

Yes it works, but it is not a great differences because begin and end points  are transformed in line, in reality a lot of points following a line (in Computesampling) and these points are then used to generate the attractions. 

It could be possible to sample the curve instead of lines (made from curves). I don't know if it will change many things. If you are happy with the result you could keep the script like that.  

Is there a way to base it on gpu algorithm?

but it looks like the algorithm itself is for cpu and not designed for parallel computing, am i right?

looked at the alea manual, seems complicated..

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service