POV-Ray : Newsgroups : povray.advanced-users : Making Patterns with functions Server Time
13 Oct 2024 18:59:57 EDT (-0400)
  Making Patterns with functions (Message 36 to 45 of 46)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: ingo
Subject: Re: Making Patterns with functions
Date: 23 Aug 2024 01:40:00
Message: <web.66c820a4d81b847917bac71e8ffb8ce3@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.

An old one by Alex Kluchikov, not a simple function though:

---%<------%<---

// Alex Kluchikov, 2003
// mailto: klk### [at] ukrnet, akl### [at] mailru
// Feel free to modify/use in any form
include "functions.inc"

camera{
 location -5*z
 look_at 0
 }

// we can get angle from gradient
#declare frad=function{
 pattern{radial}
 }

#declare fboz1=function{
 pattern{crackle form <1,0,0> scale 1}
 }

#declare fboz2=function{
 pattern{bumps noise_generator 3 rotate 60 scale 1.2}
 }

#declare fboz3=function{
 (sin(x+23)*sin(y+2)+sin(x*2.33443+11)*sin(y*2.4332+76)+sin(x*1.133443+32)*sin(y*1.234332+8)+3)*1/6
 }

#declare f1=function(x,y,z){
  (sin(fboz1(x,y,z)*24*pi
   +frad(fboz1(x,y,z)-fboz1(x,y-.07,z),0,fboz1(x,y,z)-fboz1(x+.07,y,z))
//gradient calculation
   *2*pi
//   +clock*pi*2 // uncomment to animate
   )+1)*(1/2)
   *(1-fboz1(x,y,z))
 }

#declare f2=function(x,y,z){
  (sin(fboz2(x,y,z)*24*pi
   +frad(fboz2(x,y,z)-fboz2(x,y-.07,z),0,fboz2(x,y,z)-fboz2(x+.07,y,z))
//gradient calculation
   *2*pi
//   +clock*pi*2 // uncomment to animate
   )+1)*(1/2)
 }

#declare f3=function(x,y,z){
  (sin(fboz3(x,y,z)*24*pi
   +frad(fboz3(x,y,z)-fboz3(x,y-.07,z),0,fboz3(x,y,z)-fboz3(x+.07,y,z))
//gradient calculation
   *2*pi
//   +clock*pi*2 // uncomment to animate
   )+1)*(1/2)
 }

#declare curles_1=texture{pigment{
  function{f1(x,y,z)}
  scale .25}
  finish{ambient 1}
  }

#declare curles_2=texture{pigment{
  function{f2(x,y,z)}
  color_map{[.45,color rgb 0][.55,color rgb 1]}
  scale .25}
  finish{ambient 1}
  }

#declare curles_3=texture{pigment{
  function{f3(x,y,z)}
  color_map{[.45,color rgb 0][.55,color rgb 1]}
  scale .25}
  finish{ambient 1}
  }

plane{
 -z,1
  //use curles_1, curles_2 or curles_2
  texture{curles_1}
 }
---%<------%<------
ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 23 Aug 2024 06:40:00
Message: <web.66c866d9d81b84791f9dae3025979125@news.povray.org>
Ha!
I think I have one of his "curles" patterns printed out somewhere here in a
pile.
I was just sifting through the archives and pulling out anything that seemed to
pop out.

Hopefully you know a few more - as you can tell, I love this stuff.


Post a reply to this message

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 23 Aug 2024 15:35:00
Message: <web.66c8e447d81b84793bc22bca25979125@news.povray.org>
I've also been interested in making this pattern:

http://sambrunacini.com/wp-content/uploads/2020/10/pursuit.png

and I could have sworn it has an actual NAME that I found once, and now I of
course can't find again.

Also of interest would be a metal diamond-plate pattern - the "honeycomb"
pattern that I posted for jr has that alternating direction / row attribute that
might be a good starting point for modification.


Post a reply to this message

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

> Also of interest would be a metal diamond-plate pattern - the "honeycomb"
> pattern that I posted for jr has that alternating direction / row attribute that
> might be a good starting point for modification.

#declare YY = 0.625;
#declare Plate1 = function {select (1-pow(sin(2*pi*x)*cos(2*pi*YY) +
sin(2*pi*YY)*cos(2*pi*z) + sin(2*pi*z)*cos(2*pi*x), 2), 0, 0, 1)}


Post a reply to this message


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

Preview of image 'mathpatterns2.png'
mathpatterns2.png


 

From: jr
Subject: Re: Making Patterns with functions
Date: 25 Aug 2024 02:50:00
Message: <web.66cad352d81b8479f5bfc9b06cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> > 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)}

plane with "Honeycomb" pattern, seen through "kaleidoscope".


regards, jr.


Post a reply to this message


Attachments:
Download 'ktpms.png' (440 KB)

Preview of image 'ktpms.png'
ktpms.png


 

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

> plane with "Honeycomb" pattern, seen through "kaleidoscope".

Wheee!   Nice job.  :)

Can you adjust the symmetry?  Have 6-fold, or 7?

After playing with this stuff a bit, it seems like that whole sin*cos xy yz zx
thing has a lot of potential as a base pattern to do all sorts of interesting
things with.  Even just the threshold can change the apparent look quite a bit.
And then you have the orthogonal plane value/slice to vary.

We can square the whole sum, square the terms, take the root, etc.

- BW


Post a reply to this message

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

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> Wheee!   Nice job.  :)

start on.  :-)


> Can you adjust the symmetry?  Have 6-fold, or 7?
> After playing with this stuff a bit, it seems like that whole sin*cos xy yz zx
> thing has a lot of potential as a base pattern to do all sorts of interesting
> things with.  Even just the threshold can change the apparent look quite a bit.

yes, I just discovered that replacing "tau" with "pi * scale_factor" and using
slightly different factors, things get real .. interesting.

re your question, I answer with an Obama quote: "Yes, we can" :-)  below is
excerpted from my WIP code:

/* added bailout & max_trace */
global_settings {adc_bailout (1/254) assumed_gamma 1 max_trace_level 255}

/* #mirrors */
#declare n_ = 3;

#declare angle_ = 360 / n_;

/* epsilon */
#declare eps_ = 1e-3;

/* length of tube */
#declare len_ = 10;

/* prism with hole */
#declare pi_ = <.99,0,0>;
#declare po_ = <1.01,0,0>;

#declare pts_ = array [n_][2];

#for (i_, 0, n_-1)
  #local ta_ = vrotate(po_, <0,(angle_*i_),0>);
  #local tb_ = vrotate(pi_, <0,(angle_*i_),0>);
  #local pts_[i_][0] = <ta_.x,ta_.z>;
  #local pts_[i_][1] = <tb_.x,tb_.z>;
#end

/* rotate to centre on -z */
prism {
  linear_spline eps_, len_, 2*(1+n_),
  #for (i_,n_-1,0,-1) pts_[i_][0], #end pts_[n_-1][0],
  #for (i_,0,n_-1) pts_[i_][1], #end pts_[0][1]
  open
  sturm on
  no_shadow
  finish {ambient 0 reflection {1} specular 0}
  rotate <270,0,0>
}


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 27 Aug 2024 20:55:00
Message: <web.66ce7468d81b84791f9dae3025979125@news.povray.org>
This one looks like sliced pita bread or hot dogs buns or something.

#declare Pattern3 = function {tan (3*x) * sin (5*x/2) * sin (z) - 0.1}


Post a reply to this message


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

Preview of image 'mathpatterns2.png'
mathpatterns2.png


 

From: Bald Eagle
Subject: Re: Making Patterns with functions
Date: 28 Aug 2024 15:10:00
Message: <web.66cf754ad81b8479a5a6be6925979125@news.povray.org>
An interesting approach that I'll have to look into further.

https://gcboore.com/pages/trigonometric-functions.html

Might be able to do the same thing with pigment patterns and homebrew function
patterns.


Post a reply to this message

From: yesbird
Subject: Re: Making Patterns with functions
Date: 29 Aug 2024 05:35:15
Message: <66d040d3$1@news.povray.org>
On 28/08/2024 22:06, Bald Eagle wrote:
> An interesting approach that I'll have to look into further.
> 
> https://gcboore.com/pages/trigonometric-functions.html
> 
> Might be able to do the same thing with pigment patterns and homebrew function
> patterns.
> 

Really interesting, looking forward to the results of your experiments !
--
YB


Post a reply to this message

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

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