designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Wave Generator

April 17, 2024 | Algorithms
#grasshopper #noise #parametric-surface #rhino-python #wave

Here is a wave generator code I developed using Grasshopper and Python. While searching for a solution to the realistic water simulations, I came up with the Gerstner Waves. I tried to implement it. However, I came up with this final result, which is not a Gerstner Wave generator, but a much simpler one. It combines many user-fed wave components and calculates the resulting single wave. I played with this code for hours with different components. So, it is worth trying and maybe developing more. For example, a steepness parameter might be a very good addition to make it closer to a trochoidal wave (such as the Gerstner wave). For now, this works as expected.

Wave Generator animation

This Grasshopper and Grasshopper Python implementation generates custom waves. It has several user inputs such as the size and the time value (for animation). Most importantly a user can define and input many waves using a Panel component. The amplitude, wavelength, direction, frequency, and phase shift of these waves are the inputs. The output of the Grasshopper definition is a grid of points. You can use these points to create NURBS or mesh surfaces and animate them through the t Number slider. The code is using native Grasshopper components. So, you don’t need to install any add-ons. However, Weaverbird might be a good addition if you want to make the resulting meshes smoother.

import rhinoscriptsyntax as rs
from math import *
import ast
def gerstner_wave_height(x, y, wave):
	wavelist = ast.literal_eval(str(wave))
	A = wavelist[0]
	lambda_ = wavelist[1]
	theta = pi / wavelist[2]
	phi = pi / wavelist[3]
	tt = t + wavelist[4]
	dot = x * cos(theta) + y * sin(theta)
	return A * cos(2 * pi / lambda_ * dot - tt + phi)
step_x = sx / (n - 1)
step_y = sy / (n - 1)
coordinates = []
for i in range(n):
	x = i * step_x
	for j in range(n):
		y = j * step_y
		z = sum(gerstner_wave_height(x, y, wave) for wave in waves)
		coordinates.append([x, y, z])
p = rs.AddPoints(coordinates)
Wave Generator Grasshopper definition
Wave Generator grasshopper, noise
Grasshopper definition (GH)Download

Cite this post

Yazar, T. (2024, April 17). Wave Generator. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/wave-generator/

Related Posts

Point Waves

May 29, 2023

Here is another basic exercise in Grasshopper. This exercise “Point Waves” creates wave-like deformations on the grids of points. The major function of the definition is to calculate the distances from every point of a grid to an attractor point, with the help of Distance (Dist). Then it sorts them from the smallest to the largest (= closest to farthest) with the Sort List (Sort) component. This component takes and matches two lists of the same size, called key (K)…

Graph Waves with Attractor Geodesic

January 25, 2012

The regular component design technique can be further improved by adding several manipulations. The purpose of this study was to create a surface component that reacts to an inherent parameter (actually a geodesic curve on the surface). However, within the process of parametric modeling, diverse formal potentials emerged. Most interesting results are achieved by adding a graph parameter to control the waves of reaction while splitting the surface as stripes. It is created in the recently updated version (0.8.00066) of…

Perlin Noise Generator

August 20, 2023

Perlin noise is a gradient noise function that has been widely used in computer graphics, procedural generation, and various other applications to generate natural-looking patterns. Here is my brief exploration of the Perlin Noise Generator. Although I didn’t fully follow the traditional steps the result looks similar. I started with the square grid and generated random gradient vectors on every grid corner. Then, I implemented the original algorithm’s dot product method. To calculate the value of a point in this…

Modeling Waves Relief

December 16, 2024

Relief in the context of art and sculpture refers to a technique where a three-dimensional form is created on a flat surface. The object or figure “protrudes” from the background, creating depth and texture. In this short tutorial video, I am modeling waves relief using the basic drawing and modeling commands of the Rhinoceros software. Here, I use the point surface command. Because, in Rhinoceros, generally we describe the parametric surfaces as four-sided objects. So, this exercise is a basic…

Dual Polyhedra in Grasshopper

October 7, 2025

Exploring dual polyhedra in Grasshopper is an interesting topic. In this post, I try to generate the dual of any polyhedron using Rhino Python and possibly Grasshopper. I developed this code for Rhino Python earlier here, and now I have converted it into a Grasshopper-Python component for better usability. I start the process by breaking the polyhedron into individual faces and gathering the corner points of each face. These points become the vertices of the dual polyhedron. Then, for each…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #polyhedra
    • #tutorial
    • #robot
    • #rhinoceros
    • #boolean
    • #kuka-prc
    • #parametric-curve
    • #tessellation
    • #design-object
    • #image-sampler
    • #relief
    • #linear-algebra
    • #terrain
    • #sandblasting
    • #stone
    • #dome
    • #animation
    • #art
    • #contouring
    • #interlocking
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement