algorithmic modeling for Rhino

Parametric Surface using Variable Expression

If you know parametric surface well -- or to be more specific, you know how to construct 3D surfaces using parametric equations -- it is a smooth transition from mathematical tools (such as Mathcad or Mathematica) to Grasshopper. In Mathcad, the equation for a parametric surface is:

For those who love spirograph may find it familiar. In Grasshopper, the definition looks like this:

Downloaded Grasshopper definition file: paramsurf01.ghx

In which I use Variable Expression component to hold the functions (parametric equations) for x, y, and z coordinates of the surface. Remember to set the data matching to Cross Reference so that u and v make up a 2D matrix.

And the result model of this exercise is:

Views: 7602


You need to be a member of Grasshopper to add comments!

Join Grasshopper

Comment by Steve Lewis on March 7, 2017 at 9:57pm
You could look at the MACAW plug in for Mathcad prime
Comment by xirja on April 16, 2011 at 7:10am
Cross referencing, of course!  Equalizing span length on the mesh, aha!  Thank you.
Comment by Rodrigo Medina on February 10, 2010 at 8:14pm
Nice Work!!
Comment by June-Hao Hou on December 9, 2009 at 12:19am
Here are some useful information regarding using .NET framework to talk to Mathematica:
1. What is MathLink?
2. Calling DLLs from Mathematica
3. .NET/Link
Comment by shensansi on December 8, 2009 at 10:25am
Try to understand,whole night,no luck....
how to bridging mathematica with GH?
how to export a file from Mathematica and then open it in Rhino(which format?)
how to have Mathematica send back a nurbs surface?
is there somebody can teach me ,Thanks in advance
Comment by June-Hao Hou on November 26, 2009 at 6:19pm
Thanks for Jon's reply for the issue of implement the solution in GH. There is no common solution, or common parametric form, for such kind of surfaces. You have to solve them case by case. However, bridging Mathematica with GH would be a good idea to do so -- simply let the professional do the jobs. Though I haven't tried it yet, you might be interested in the ActiveX/VB support in Mathematica which allows you to "talk" to Windows applications.
Comment by Joao Bravo da Costa on November 26, 2009 at 7:55am
Thanks for your reply, Jon.

Yes, the equation is a1Sin(x)sin(2y)sin(3z) + ..... = 0. I know GH can't solve equations in that format; that's why I asked if June or anyone else knew how to rewrite the equation in parametric format -- i.e. x = ..., y = ..., z = ... This is a matter of translation, which I don't know how to do.

How do you connect Mathematica to GH? All I could manage till now was to export a file from Mathematica and then open it in Rhino. It seems like you use a more direct method -- I'd love to learn it.
Comment by jon kontuly on November 26, 2009 at 6:57am
I don't think you can do this in grasshopper.
Although the math is a bit beyond me if you look closely at the wolfram page you mentioned it is really the solution set to
a1Sin(x)sin(2y)sin(3z) + ..... = 0
that creates the surface and grasshopper does not have the ability, as far as I know, to solve equations.
You can, however, connect Mathematica to Grasshopper, solve the equation in Mathematica and have Mathematica send back a nurbs surface. I have never done anything as complex as this equation but I have tested the concept on simple curves. The problem I ran into when trying this is that it would work for one parameter but when I tried to change the parameter the whole thing would crash. Then I got busy and haven't worked on it for awhile.
Comment by Joao Bravo da Costa on September 11, 2009 at 11:28am
Excellent work, thank you for sharing it.

I would like to ask you a question regarding a similar exercise: Do you know of a method to build a surface from an equation given in a non-parametric form? I have been trying with this one:

You can find more about this class of surfaces in
Comment by Lars Renklint on June 16, 2009 at 2:09am
Very nice, thank you for sharing.





  • Add Photos
  • View All


  • Add Videos
  • View All

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service