I would like to know if there is any way to use the "Add 3d Function Surface" addon via the python interface.

I have an equation that describes a surface in the three-dimensional space that I can use to make a mesh object as described in this answer. What I would like to know is if there is any way to do such a thing via the python interface.

As an example, I would like to be able to do something like:

def mysurface(u, v):
return numpy.array([u*v, u-v, math.pow(u, 2)])

add_mesh_from_surface_equation(func = mysurface, urange = [0, 10], vrange = [0, 10], ustep = 0.01, vstep = 0.01)


Is it possible to do something like this?

• The question you linked to creates a surface described by equations, yet your example code is making a surface based off a numpy array. Which are you trying to do? If you have actual equations, it should be very simple to call the functions used by the add3d surface function. Oct 2 '14 at 18:49
• As far as I understood from the question that I linked (and from using that addon) it is capable of making a 3D mesh out of a function that parametrizes a surface with a map from R^2 to R^3, i.e., (u, v) -> (x, y, z). You then specify some range and step and the mesh is built. mysurface(u, v) was intended to be that kind of function, mapping 2 values in 3. I just added numpy.array to make it clear it was a vector I meant, but please don't take it literally since I have no idea on how to actually do it! ;) Oct 2 '14 at 19:09

bpy.ops.mesh.primitive_z_function_surface(div_x=20, div_y=17)