POV-Ray : Newsgroups : povray.advanced-users : Making Patterns with functions Server Time
31 Aug 2024 22:16:00 EDT (-0400)
  Making Patterns with functions (Message 26 to 35 of 45)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Alain Martel
Subject: Re: Making Patterns with functions
Date: 14 Feb 2024 09:48:33
Message: <65ccd2c1$1@news.povray.org>
Le 2024-02-13 à 22:24, Bald Eagle a écrit :
> This one's sort of like dice.
> 
> mod (floor(x)+floor(y), 2) somehow is NOT the same as even (floor(x)+floor(y))
> 
> IIRC, Bill Pokorny mentioned something about how floor isn't quite "right".
> 
> anyway, this is the last one for the night.
> 
> - BW
Another that play tricks with your eyes...


Post a reply to this message

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 14 Feb 2024 20:50:00
Message: <web.65cd6cdcd81b84791f9dae3025979125@news.povray.org>
This is very similar in concept to the Voronoi pattern, and indeed, if the
"annular rings" are fine enough, one gets the visual impression of Voronoi cells
filled with a concentric ring pattern.

I just did this for fun, to illustrate a practical pattern to use for ripples in
water, malachite, rhodochrosite, wood, "jawbreaker" candies, etc, and to
implement an example that makes use of splines, loops, pseudorandom numbers, and
a discrete set of "basis functions" that are evaluated "en-masse".

Enjoy the "bubbles".

(Speaking of which, this could be a fun one to apply iridescence to...)

I'd have to think about how to vary the "radius" of each seed point, and then
apply the true bubble intersection formula to get a nice foam cross-section.
Foam isosurface, anyone?

- BE


Post a reply to this message


Attachments:
Download 'mathpatterns1.png' (704 KB)

Preview of image 'mathpatterns1.png'
mathpatterns1.png


 

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 19 Aug 2024 19:45:00
Message: <web.66c3d8a8d81b84791f9dae3025979125@news.povray.org>
Triply Periodic Minimal Surface

left - open
right - closed
plane - pigment {function {TPMS}}

This one is called "SplitP"


Post a reply to this message


Attachments:
Download 'implicitlattice.png' (711 KB)

Preview of image 'implicitlattice.png'
implicitlattice.png


 

From: jr
Subject: Re: Making Patterns with functions
Date: 20 Aug 2024 01:40:00
Message: <web.66c42b6cd81b8479c7a7971d6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> plane - pigment {function {TPMS}}

v nice.  I bet it would be "lush" as a woven fabric/cloth.

(light-green with envy :-))


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 20 Aug 2024 08:15:00
Message: <web.66c48845d81b8479a2cb7a7025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> v nice.  I bet it would be "lush" as a woven fabric/cloth.

There's a better one for that, I think - the "Honeycomb" that I found in a
paper.
Kinda looks like a "dog bone" wood patch that alternates in directions like a
checkerboard.

A lot of these are, incidentally, used for support-fill for 3D printing
applications - so Kenneth may have a very practical interest.

Since they can partition space into 2 parts acting as a membrane in between,
when they are given thickness and made of metal, they are being evaluated as
heat-transfer devices, very much like a car radiator works.
The key factor being the very high surface area able to be contained in a very
small space.

> (light-green with envy :-))

You shouldn't be.  You can copy-paste equations as well as I can.  :P

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 21 Aug 2024 21:05:00
Message: <web.66c68e1ad81b84791f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
>
> > v nice.  I bet it would be "lush" as a woven fabric/cloth.
>
> There's a better one for that, I think - the "Honeycomb" that I found in a
> paper.
> Kinda looks like a "dog bone" wood patch that alternates in directions like a
> checkerboard.

Sometimes these things are a little easier to write using some helper functions.

#declare S2P = function (V) {sin (tau*V/L)}
#declare C2P = function (V) {cos (tau*V/L)}
#declare T = 0.5;
#declare N = 1;
#declare Honeycomb = function (X, Y, Z) {pow(S2P(X)*C2P(Z) + S2P(Z) + C2P(X), N)
- pow(T, N)}


Post a reply to this message


Attachments:
Download 'implicitlattice.png' (600 KB)

Preview of image 'implicitlattice.png'
implicitlattice.png


 

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 22 Aug 2024 19:10:00
Message: <web.66c7c4ebd81b84791f9dae3025979125@news.povray.org>
I think I was playing around with the AI again, and the simplest function caught
my eye.

Slumbering neurons were roused, and I realized that although I didn't have
access to POV-Ray, I _did_ have access to Desmos.

Graphing cos(x) * sin (y) revealed a very surprising pattern, and I did a little
bit of follow-up development from there.  Subtracting a constant in between 0
and 1 changes the pattern from circles, to squircles, to squares.

So then, I had to transition between simple graphing, and mapping equations to a
plane with functions.  I had a surprisingly difficult time getting the lines to
match the dots at the proper slopes, and I had to introduce fudge factors to get
the lines to accurately match the frequency of the dots.

Blah blah blah - here's the original basic pattern and the triangular grid that
I made based on that.

I also needed to alter my fmod function, and I still need to add another level
of select () to fix the doubling of the lines across N=0.


Post a reply to this message


Attachments:
Download 'mathpatterns2.png' (321 KB)

Preview of image 'mathpatterns2.png'
mathpatterns2.png


 

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 22 Aug 2024 20:35:00
Message: <web.66c7d830d81b84791f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I also needed to alter my fmod function, and I still need to add another level
> of select () to fix the doubling of the lines across N=0.

I fixed that, and then added an averaged texture to throw some color into the
mix, and by using both functions and scaling the original pattern, you can see
how one relates to the other.

Bet you can even see the cubes and hexagons hidden in there...


Post a reply to this message


Attachments:
Download 'mathpatterns2.png' (555 KB)

Preview of image 'mathpatterns2.png'
mathpatterns2.png


 

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 22 Aug 2024 21:40:00
Message: <web.66c7e785d81b84791f9dae3025979125@news.povray.org>
I cannot possibly imagine how they came up with this one.


Post a reply to this message


Attachments:
Download 'mathpatterns2.png' (149 KB)

Preview of image 'mathpatterns2.png'
mathpatterns2.png


 

From: ingo
Subject: Re: Making Patterns with functions
Date: 23 Aug 2024 01:40:00
Message: <web.66c81f9bd81b847917bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Over the last 2 days, I've fallen down the mathematical pattern rabbit hole, and
> have been experimenting with all manner of what can be done with a simple
> pigment {function {}}
> statement.
>

Two older ones for your collection. Thing I found on the web years ago:

---%<------%<---
// Persistence of Vision Ray Tracer Scene Description File
// File: contour.pov
// Vers: 3.5
// Desc: contour plots Idea: Eric Weeks
// http://www.physics.emory.edu/~weeks/ideas/tplot.html
// Date: 2003
// Auth: Ingo Janssen

#version 3.5;

#include "gradients.inc"
//https://news.povray.org/povray.binaries.scene-files/message/%3CXnsA9D7C1F3776F3seed7%40news.povray.org%3E/#%3CXnsA9D7
C1F3776F3seed7%40news.povray.org%3E

global_settings {assumed_gamma 1.0}
camera {location <0,0,-25> look_at 0}

#declare Contour = function(x,y,z,A,B,C,D,E,F,I,J,K,L) {
  E*sin(A*sin(I*x)+ B*cos(J*y))+F*cos(C*cos(K*x)+D*sin(L*y))
}

#declare A =1;
#declare B =1;
#declare C =1;
#declare D =1;
#declare E =1;
#declare F =1;

#declare I =1;
#declare J =1;
#declare K =1;
#declare L =1;

#declare Test  = function(Pf){
   (G_smoothstep(Pf,0.1,0.15)-G_smoothstep(Pf,0.15,0.2))
  +(G_smoothstep(Pf,0.4,0.6)-G_smoothstep(Pf,0.7,.9))
};

plane {
  -z, 0
  pigment {
    function{Contour(x,y,z,A,B,C,D,E,F,I,J,K,L)}

    //function{G_Blinn_Wyvill(Contour(x,y,z,A,B,C,D,E,F,I,J,K,L))}

    //function{Test(Contour(x,y,z,A,B,C,D,E,F,I,J,K,L))}

    //function{abs(Contour(x,y,z,A,B,C,D,E,F,I,J,K,L))}

    //sine_wave
    colour_map {
      [0 rgb 0]
      [1 rgb 1]
    }
  }
  finish {ambient 1}
}
---%<------%<---

---%<------%<---
// POV-Ray 3.7
// Ingo
// found on a Japanese site
// +w1280 +h480 +a0.05 +am3 +ac0.90 +r3
#version 3.7;
global_settings{assumed_gamma 1}
#default{ finish{ambient 0 diffuse 1}}
camera {
  orthographic
  location <0,0,1>
  look_at 0
  right x*image_width/image_height
}
#declare PHI = 1.61803399;

// Shuhei Kawachi
// A>0
#declare ShuheiKawachi = function (x,y,z,A,B){
  ((cos(x)*cos(y)+cos((sqrt(A)*x-y)/B)*
  cos((x+sqrt(A)*y)/B)+cos((sqrt(A)*x+y)/B)*
  cos((x-sqrt(A)*y)/B)))/3///6 + 0.5
}


plane{ <0,0,-1>, 0
  texture {
    pigment {
      //function{(ShuheiKawachi(x,y,z,pi,1.5))}
      function{abs(ShuheiKawachi(x,y,z,pi,1.5))}
      sine_wave
      scale 0.02
    }
    finish {ambient 1 diffuse 0}
  }
}
---%<------%<---

ingo


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.