Force-based 3D graph drawing in AS3

I decided to extend my last graph drawing algorithm - I added a "z" coordinate (for position, forces etc.). I used Away3DLite libraries for drawing a graph.

Drawing a graph from the input

I created the ability to draw a concrete graph. The input looks like this:
numberOfVertices:edge,edge,edge,edge
where "edge" has this form
fromVertex-toVertex

Examples

Name Code (insert into app above)
Stick 2:1-2
Triangle 3:1-2,2-3,3-1
Ring $C_7$ 7:1-2,2-3,3-4,4-5,5-6,6-7,7-1
Star 4:1-2,1-3,1-4
Tetrahedron 4:1-2,2-3,3-1,1-4,2-4,3-4
Cube 8:1-2,2-3,3-4,4-1,5-6,6-7,7-8,8-5,1-5,2-6,3-7,4-8
Octahedron 6:1-2,2-3,3-4,4-1,1-5,2-5,3-5,4-5,1-6,2-6,3-6,4-6
Icosahedron 12:1-2,2-3,3-4,4-5,5-1,6-7,7-8,8-9,9-10,10-6,1-11,2-11,3-11,4-11,5-11,6-12,7-12,8-12,9-12,10-12,1-6,6-2,2-7,7-3,3-8,8-4,4-9,9-5,5-10,10-1
Dodecahedron 20:1-2,2-3,3-4,4-5,5-1,6-7,7-8,8-9,9-10,10-6,1-11,2-12,3-13,4-14,5-15,6-16,7-17,8-18,9-19,10-20,11-16,16-12,12-17,17-13,13-18,18-14,14-19,19-15,15-20,20-11
Diabolo 11:1-2,2-3,3-4,4-5,5-1,6-7,7-8,8-9,9-10,10-6,11-1,11-2,11-3,11-4,11-5,11-6,11-7,11-8,11-9,11-10
Fano plane 7:1-2,2-3,3-4,4-5,5-6,6-1,1-7,2-7,3-7,4-7,5-7,6-7,2-4,4-6,6-2
4D cube 16:1-2,2-3,3-4,4-1,5-6,6-7,7-8,8-5,1-5,2-6,3-7,4-8,9-10,10-11,11-12,12-9,13-14,14-15,15-16,16-13,9-13,10-14,11-15,12-16,1-9,2-10,3-11,4-12,5-13,6-14,7-15,8-16
The Drum (???) 18:1-2,2-3,3-4,4-5,5-6,6-1,1-7,7-2,2-8,8-3,3-9,9-4,4-10,10-5,5-11,11-6,6-12,12-1,7-8,8-9,9-10,10-11,11-12,12-7,13-14,14-15,15-16,16-17,17-18,18-13,1-13,13-2,2-14,14-3,3-15,15-4,4-16,16-5,5-17,17-6,6-18,18-1
$K_{10}$ The Ball 10:1-2,1-3,1-4,1-5,1-6,1-7,1-8,1-9,1-10,2-3,2-4,2-5,2-6,2-7,2-8,2-9,2-10,3-4,3-5,3-6,3-7,3-8,3-9,3-10,4-5,4-6,4-7,4-8,4-9,4-10,5-6,5-7,5-8,5-9,5-10,6-7,6-8,6-9,6-10,7-8,7-9,7-10,8-9,8-10,9-10
Benzene 12:1-2,2-3,3-4,4-5,5-6,6-1,1-7,2-8,3-9,4-10,5-11,6-12
Cyclohexane 18:1-2,2-3,3-4,4-5,5-6,6-1,1-7,2-8,3-9,4-10,5-11,6-12,1-13,2-14,3-15,4-16,5-17,6-18
Methane 5:1-2,1-3,1-4,1-5

If you have created some interesting graphs, write them into comments (name of the graph and it's code) and I will add them to the table. Thanks!

Old comments (closed because of spam)

2 Comments

  1. Werkov said:

    Awesome!

    Benzene: 12:1-2,2-3,3-4,4-5,5-6,6-1,1-7,2-8,3-9,4-10,5-11,6-12
    Cyclohexane (not real): 18:1-2,2-3,3-4,4-5,5-6,6-1,1-7,2-8,3-9,4-10,5-11,6-12,1-13,2-14,3-15,4-16,5-17,6-18
    Methane: 5:1-2,1-3,1-4,1-5

    January 7th, 2011
  2. Fred said:

    Both 2D and 3D are fun.
    Algo, code… nothing public ?

    June 29th, 2012