import traer.physics.*; import traer.animation.*; final float NODE_SIZE = 10; final float EDGE_LENGTH = 20; final float EDGE_STRENGTH = 0.12; final float SPACER_STRENGTH = 1000*2; final float K=0.1; int selectedpoint = 0; float scale=1.0; ParticleSystem physics; Smoother3D centroid; int disptext[]={ 1,0}; String displaystring; String names[] = new String[3000]; int firstfree=0; int w[][] = new int[3000][3]; int wfirstfree=0; int type[]=new int[3000]; int posts[]=new int[3000]; int npart=0; int conv[]=new int[3000]; int convb[]=new int[3000]; int nspring=0; int conv2[]=new int[3000]; int locked[]=new int[3000]; void setup() { size( 600, 600 ); smooth(); // frameRate( 24 ); strokeWeight( 2 ); ellipseMode( CENTER ); physics = new ParticleSystem( 0, 0.25 ); centroid = new Smoother3D( 0.8 ); initialize(); PFont font; font = loadFont("UniversLTStd-Light-48.vlw"); textFont(font, 14); textAlign(CENTER); loadmodel("1.html"); displaystring="Extropy list Jan 2007"; } void deletemodel() { physics.clear(); selectedpoint = 0; names = new String[3000]; firstfree=0; w = new int[3000][3]; wfirstfree=0; type=new int[3000]; posts=new int[3000]; npart=0; conv=new int[3000]; convb=new int[3000]; nspring=0; conv2=new int[3000]; locked=new int[3000]; } void loadmodel(String filename) { //-------------------------- // String lines[] = loadStrings("http://lists.extropy.org/pipermail/extropy-chat/2007-January/date.html"); String lines[] = loadStrings(filename); for (int i=0; i < lines.length; i++) { int index = lines[i].indexOf("
  • "); if (index != -1) { int index2=lines[i].indexOf("[extropy-chat] "); String subject = lines[i].substring(index2+15,lines[i].length()); int si= insert(subject); String name = lines[i+2].substring(3,lines[i+2].length()); int ni = insert(name); winsert(ni,si); type[ni]=0; type[si]=1; } } for (int i=0; i < firstfree; i++) { int s=0; for (int j=0; j < wfirstfree; j++) { if ((w[j][0]==i || w[j][1]==i ) && (w[j][2]>1)) s=s+1; } if (s>0) { Particle p = physics.makeParticle(); p.moveTo( random( -1, 1 ), random( -1, 1 ), 0 ); // p.setMass(1+.2*posts[i]); conv[i]=npart; convb[npart]=i; npart+=1; } } for (int i=0; i < wfirstfree; i++) { if (w[i][2]>1) { Particle p = physics.getParticle( conv[w[i][0]] ); Particle q = physics.getParticle( conv[w[i][1]] ); conv2[nspring]=i; nspring++; // addSpacersToNode( p, q ); physics.makeSpring( p, q, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH*5/w[i][2] ); } } for ( int i = 0; i < physics.numberOfParticles(); ++i ) { Particle p = physics.getParticle( i ); for ( int j = 0; j < physics.numberOfParticles(); ++j ) { Particle q = physics.getParticle( j ); if (q != p) physics.makeAttraction( p, q, -SPACER_STRENGTH, 20 ); } } //-------------------------- } int insert(String s) { int i; for (i=0; i