5

Using math nodes to create geometry in geometry nodes

I'm trying to create some geometry using math nodes in geometry nodes see image below of what I'm trying to create. Yes I know I could model a half circle and a line to get it but the goal is to use an equation to make it parametric.

img0

I can create a sine wave.

img1

img2

But when I try and use greater than 0 node I get what looks to be the start of a square wave.

im3

Attached Blend file below

Rick T
  • 4,391
  • 1
  • 20
  • 64

1 Answers1

8

The greater than Math node returns 1 (greater than) or 0 (smaller or equal).

You probably want the Maximum option instead of the Greater than:

Maximum math node

note that clamping a sine wave will not give you half circles, for that you will need other formula:

$$ \begin{cases} 0 & \texttt{if } M> 2r \\ \sqrt{r^{2}-\left ( M-r \right )^{2}} & \texttt{if } M \leq 2r \end{cases} $$ $$$$

  • $\mathbf{M}=\operatorname{mod}\left(x+r,\ 2r+s\right)$
  • $\mathbf{r}=\text{radius}$
  • $\mathbf{s}=\text{spacing}$

Geo nodes half circle wave 1

half circle wave 1

Or since you know the cirlce radius and the spacing between, you can put vertices in optimal positions: Geo nodes half circle wave 2

half circle wave 2

Hulifier
  • 6,048
  • 1
  • 8
  • 24
  • 1
    Wonderful! I know the rule that says not to sing the praises and thanks here, but this is just great! – quellenform May 19 '22 at 21:33
  • I was just about to do y=sin(ax)+sin(y)) with a maximum node and call it a day hahah....then I saw yours WOW!!!....I'm going to try and work your solution out just to see if I can fully understand it. – Rick T May 19 '22 at 21:58
  • 1
    @RickT I did the formula using desmos, take a look if you find it easier to understand with a graph: https://www.desmos.com/calculator/qcyponl18l – Hulifier May 19 '22 at 22:07
  • Will do, desmos is a great site! – Rick T May 19 '22 at 22:38