Morphing from one Gyroid to another

To vary the iso value with position, one way is to take the expression for the gyroid and add another term which increases the value by some amount depending on position.
Here trying with the isosurface script I just posted here.
The key part if you want to modify it is line 163-166

Math.Sin(P.X) * Math.Cos(P.Y) +
      Math.Sin(P.Y) * Math.Cos(P.Z) +
      Math.Sin(P.Z) * Math.Cos(P.X)
      + 0.05 * P.Z

The Sin and Cos parts are the implicit approximation to the gyroid, then it adds a small factor of height with 0.05 * P.Z which gives this:

graded_gyroid.gh (10.1 KB)

6 Likes