Point Waves

by Tuğrul Yazar | May 29, 2023 15:02

Here is another basic exercise in Grasshopper[1]. This exercise “Point Waves” creates wave-like deformations on the grids of points.

point waves

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) and value (A), and sorts the list of keys from smallest to largest, while simultaneously changing the order of the values ​​in the value list. Thus, we have a list of points ordered parallel to the distances. Note that we flattened both lists. We connect ordered points to the P input of the Point Oriented (Pt) component. Then we manipulate the Z coordinates with a Graph Mapper[2].

point waves[3]

We obtained evenly spaced numbers between 0 and 1 with the help of a standard Range component. Then connected it to a standard Graph Mapper (Graph). Thus, we generated intervals, which are always between 0 and 1. This guarantees the working algorithm, regardless of the number of points. We used List Length (Lng) component to find the number of segments this range should be divided into. The output of the Graph Mapper (Graph) is the numbers that are determined by the function curve. This falls between 0 and 1. Since these settings are the default settings of Graph Mapper (Graph), there is no need to make any changes. We multiply the outputs of Graph Mapper (Graph) ​​using Multiplication (AxB). Finally, we connect the result to the W input of Point Oriented (Pt). This makes the points shift in the Z-axis.

Here is the Grasshopper file for the point waves:

2023_05_29-grasshopperDownload[4]
Endnotes:
  1. Grasshopper: https://www.designcoding.net/category/tools-and-languages/grasshopper/
  2. Graph Mapper: https://www.grasshopper3d.com/forum/topics/graph-mapper
  3. [Image]: https://www.designcoding.net/decoder/wp-content/uploads/2023/05/2023_05_29-point-waves-def.jpg
  4. Download: https://www.designcoding.net/decoder/wp-content/uploads/2023/05/2023_05_29-point-waves.gh

Source URL: https://www.designcoding.net/point-waves/