# Create surface from equation

Hi,

I am trying to create a surface (or mesh) defined by an equation - namely a superquadric.

I have written this superquadric.py (1.7 KB) script that can give the points of this surface that produces this:

.

Using the tool “Mesh from Points” seems to use these points as control points and the resulting mesh does not pass through them, rather it sits inside them.

Is there a better way to create a mesh that uses the points as vertexes of the mesh?
Or, more simply, is there a way to create a surface directly from an equation?

Ideally the result would produce something like the “MeshEllipsoid” function but with the shape defined by the equation.

Thanks!

I assume your equation can output things in order (row by row). If so, you can run an interpolated curve through each of the rows of points, then Loft through the curves to create the surface.

This also looks like something you can do in Grashopper to generate the surface automatically from the equation.

Another possibility might be Surface from point grid if the rows all have the same number of points. Not sure that this can actually produce a closed surface though.

–Mitch

Not really, It essentially creates a point in one quadrant then mirrors it around to the others. I also had to do some workarounds to get it to solve the case where cos(pi/2) ==0 and not a slightly negative number (which then creates problems when you raise it to a fractional power) and it adds these points last.

I think I can redo it to output the points row by row although it is unfortunate that there is not an option to have a surface that passes through the selected points and not just near them.

I havent used grasshopper yet although I was hoping to be able to add this to another script I am working on. Is this possible with GH?

http://www.rhino3.de/_develop/__v3_plugins/math/

I’m not sure it will work on V5, but if you have V4 around it could be worth a look

1 Like

Argh! That is exactly what I am looking for! Alas, I am new to rhino and only have V5. It would be nice to have something similar for v5

@wattzie It should work in V5 32 bit: http://www.rhino3d.com/new/dev

1 Like