Does anybody know any good algorithm to script equipotential curves from an electric field of a given set of charges? :eyebrowlift:
Not that I know of but I have been wondering the same! if you are really strong in C++ you could use CGAL (www.cgal.org) and make a Python interface to their powerful surface mesh generator. There is already a Python interface for CGAL but not for this function I think.
If you are working on proteins, there are already several programs who do stuff like this, such as GRASP.
My answer is not very helpful, but something you may consider is to use computational tools like Matlab and Octave. They offer tools for calculating and plotting equipotential curves, as well as a rich environment for doing simulations and calculations. You can then export data you want to visualize in Blender, and use the Python API to import and manipulate the data.
Matlab is very expensive, but if you are a student or researcher/engineer there is a high probability that your institution/firm has site licenses.
If visualization is all you need, you could consider using the POV-Ray language (isosurface objects). This kind of thing is much easier to raytrace than to calculate explicitly in terms of curves.
thanks sjoerd and propell!
Actually, its more a step to resolve a geometrical problem (a bit hard to explain but if i find a way to represent those equipotential curves i could post a result to be more clear…). In fact i need those curves to define some area limitations (those of the electric charges) or at least some points on thise curves to aproximate them by drawing some polylines. I already obtained some results with the lines of forces which starts from those point charges to go to another ones or far to infinity. --To see what i mean take a look at: http://alumnus.caltech.edu/~muresan/projects/esfields/field.html
(in this link, equipotential curves represents ‘colinear charges’)–
And i know there is a way to obtain those curves from the lines of forces because equipotential curves cross the lines of forces perpendiculary at the point of the same charge. It would probably be more easy to obtain those curves from preexisting tools like you indicate me or even with Mathematica and then to export the data in .cvs or anything else, but i think that all the data needed is in those previous curves: the lines of forces. So now i could reformulate a bit more precisely my problem: how could i obtain equipotential curves from prexisting charges and liens of forces? And the first step would be to set a mathematical formula for that in order to elaborate an algorithm before scripting… I already did those steps for the lines of forces, see: http://blenderartists.org/forum/showthread.php?t=106598&highlight=field
I am neither a physicist nor a computer graphics scientist, but that’s not how I would solve it… I would define a lot of rays parallel to all three axes and for each ray compute all the points where the potential E is equal to a certain threshold v… so basically you fill in x and y into the equation and find all values of z that satisfy E=v. That should be doable with Mathematica. The hard part would be to connect those points, but hopefully you don’t need that.