pygame is
Simple DirectMedia Layer is
Site Swing

Mesh - 1.1

Luke Endres (fallopiano)



This is a remake of bobbo's Mesh program. At one point I had tried to download bobbo's original program, but his hosting server was down. So I made my own version. All credit goes to him. Also, on a side note, as soon as you create at least 2 or 3 'nodes', the FPS drops very noticeably. Is there any way I could get a better FPS rate?


Added optional anti aliasing and random color (for the lines in between nodes) See README.txt for more info


Home Page:


click to view original size


Mesh - 1.1 - Jun 7, 2009
Mesh - 1.0 - Jun 7, 2009 account Comments

If you wish to leave a comment with your account, please sign in first.

June 9, 2009 9:35pm - Luke Endres - nickname: (fallopiano)
wait no im wrong :D if you look at bobbo's, how do you think that he was able to keep every line anti-aliased?
June 7, 2009 9:48pm - Luke Endres - nickname: (fallopiano)
actually, you are drawing everything every frame. I added a file called, which contains some vars (2 as of now. anti_aliased, and rand_colors). I added some code to make it recognize those vars, and then i turned random_colors on. Everytime that the user clicks. it changes the color to a (rand1-255,rand1-255,rand1-255) color. Once i did that, the color of each line changes every frame. I'll upload a new version.
June 7, 2009 9:37pm - Ian Mallett - nickname: (geometrian)
LOL "cannot convert float infinity to long" :D
The antialiased thing can't really be helped, unless you draw everything every frame.
June 7, 2009 8:59pm - Luke Endres - nickname: (fallopiano)
I actually did use your code :) It was nice and clean so I decided to use it. In fact, when I first started this whole pygame thing, I used your base code to start out my projects.

But ya thanks ALOT. Credit will be given. I was getting like, 25 FPS before... now im about ~650 :D

Two more problem :) If you switch the rendering of the lines to anti aliased, and then you add a bunch of nodes, the anti aliased 'effect', if you will, of the lines drawn a while ago will actually ware away! Also, when I hid the window window's task bar, I got around 10,000 FPS and then python crashes, saying: "line 82, in main
print "FPS = "+str(int(round( Clock.get_fps() )))+str(" -- Dots: ")+str(len(Dot_List))
OverflowError: cannot convert float infinity to long"

:s but ya thanks alot for the help!
June 7, 2009 8:03pm - Ian Mallett - nickname: (geometrian)
Code style looks A LOT like mine--did you use my basecode ( perchance? XD

Suggestions: Change line 79 to a continue, not a break. Then, move DotInRange(), line 98, to line 72--that way, it will only try to add lines when it needs to. You can also use Psyco to improve that even more. Another thing, because the dots and lines are static, you can just draw them on the screen--you don't have to redraw them every frame. Making these changes helps A LOT :D

Here's my version, with other minor changes: Here's a screenshot of the modified version in action. Note the framerate and dot number:
June 7, 2009 7:17pm - Luke Endres - nickname: (fallopiano)
oops! sorry. I meant to say 'Is there any way I could get a better FPS rate?'
June 7, 2009 7:00pm - pymike - nickname: (pymike)
clock = pygame.time.Clock()

(in loop)

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)