POV-Ray : Newsgroups : povray.general : Smooth Edged Spherical Pattern? Server Time
27 Nov 2024 00:35:02 EST (-0500)
  Smooth Edged Spherical Pattern? (Message 1 to 6 of 6)  
From: Skip Talbot
Subject: Smooth Edged Spherical Pattern?
Date: 9 Jul 2009 14:55:00
Message: <web.4a563c89276d72802f67618b0@news.povray.org>
Hey guys, I'm looking for a function or pigment function that creates a single
bump when added to an isosurface.  I've been tinkering with the spherical
pigment but of course that adds or subtracts a full hemisphere of a sphere onto
the surface.  Is there a way to modify this pigment or is there another function
that creates a more bump like feature where the protrusion smoothly blends into
the underlying surface?  I'd like a single occurence of the pattern because I'd
like to control the placement of it, and I've been trying to avoid multiplying
sphere functions together to create a blob like effect because it kills the
rendering time and alters my surface in too many ways.  Any suggestions would
be appreciated.

Skip


Post a reply to this message

From: Warp
Subject: Re: Smooth Edged Spherical Pattern?
Date: 9 Jul 2009 14:58:39
Message: <4a563dde@news.povray.org>
Skip Talbot <ski### [at] aolcom> wrote:
> Hey guys, I'm looking for a function or pigment function that creates a single
> bump when added to an isosurface.  I've been tinkering with the spherical
> pigment but of course that adds or subtracts a full hemisphere of a sphere onto
> the surface.  Is there a way to modify this pigment or is there another function
> that creates a more bump like feature where the protrusion smoothly blends into
> the underlying surface?  I'd like a single occurence of the pattern because I'd
> like to control the placement of it, and I've been trying to avoid multiplying
> sphere functions together to create a blob like effect because it kills the
> rendering time and alters my surface in too many ways.  Any suggestions would
> be appreciated.

  From 1-dimensional functions the most typical "single smooth bump"
function is f(x) = exp(-x*x). Try plotting that with any function plotter
to see it in action.

  I'm certain the same concept can be extended to 3-dimensional functions.
I guess, although I can't be sure, that f(x,y,z) = exp(-x*x-y*y-z*z) might
do the trick. However, without testing I can't know.

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: Smooth Edged Spherical Pattern?
Date: 9 Jul 2009 18:36:05
Message: <4a5670d5$1@news.povray.org>

> Hey guys, I'm looking for a function or pigment function that creates a single
> bump when added to an isosurface.  I've been tinkering with the spherical
> pigment but of course that adds or subtracts a full hemisphere of a sphere onto
> the surface.  Is there a way to modify this pigment or is there another function
> that creates a more bump like feature where the protrusion smoothly blends into
> the underlying surface?  I'd like a single occurence of the pattern because I'd
> like to control the placement of it, and I've been trying to avoid multiplying
> sphere functions together to create a blob like effect because it kills the
> rendering time and alters my surface in too many ways.  Any suggestions would
> be appreciated.
> 
> Skip
> 
> 
With the spherical pattern, you can change the wave type used.

You can try any of those:
sine_wave
cubic_wave
poly_wave


Alain


Post a reply to this message

From: Skip Talbot
Subject: Re: Smooth Edged Spherical Pattern?
Date: 10 Jul 2009 23:13:51
Message: <4a58036f$1@news.povray.org>
Thanks for the replies...

Alain, I had tried the sine_wave, but I should have carried through and 
tried the others.  I got a nice result with the poly_wave and I think 
I'm going to keep that one.

Warp, I also tried your function and couldn't get it to show up.  After 
getting a nice result with Alain's function I'm not going to dig too 
deeply into the math trying to get that function to work, but thanks.

Skip


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Smooth Edged Spherical Pattern?
Date: 11 Jul 2009 08:23:01
Message: <4a588425$1@news.povray.org>
Skip Talbot wrote:
...
> Warp, I also tried your function and couldn't get it to show up.  After 
> getting a nice result with Alain's function I'm not going to dig too 
> deeply into the math trying to get that function to work, but thanks.

Try this:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

isosurface {
   function { y - exp(-(x*x + y*y + z*z)) }
//  function { y + exp(-(x*x + y*y + z*z)) }
//  function { y - exp(-(x*x + z*z)) }
//  function { y + exp(-(x*x + z*z)) }
//  function { y - exp(-z*z) }
//  function { y + exp(-z*z) }
   contained_by { box { -<100, 1.1, 100>, <100, 1.1, 100> } }
   pigment { color White }
}

light_source {
   <1, 3, 2>*100
   colour White
   shadowless
}

camera {
   location <4, 3, -1>
   look_at <0, 0, 0>
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Smooth Edged Spherical Pattern?
Date: 11 Jul 2009 09:48:56
Message: <4a589848@news.povray.org>
Tor Olav Kristensen wrote:
> Skip Talbot wrote:
> ...
>> Warp, I also tried your function and couldn't get it to show up.  
>> After getting a nice result with Alain's function I'm not going to dig 
>> too deeply into the math trying to get that function to work, but thanks.

Now maybe this could be interesting for you:

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare R = 2;

#declare pA = < R,  0,  R>;
#declare pB = <-R, -1,  R>;
#declare pC = <-R,  0, -R>;
#declare pD = < R,  1, -R>;

#declare Ax = pA.x;
#declare Ay = pA.y;
#declare Az = pA.z;
#declare Bx = pB.x;
#declare By = pB.y;
#declare Bz = pB.z;
#declare Cx = pC.x;
#declare Cy = pC.y;
#declare Cz = pC.z;
#declare Dx = pD.x;
#declare Dy = pD.y;
#declare Dz = pD.z;

#declare S = 1.0;

#declare Fn = function { exp(-S*(x*x + y*y + z*z)) }

#declare FnA = function { Fn(1.0*x, 1.0*y, 1.0*z) }
#declare FnB = function { Fn(0.5*x, 0.5*y, 0.5*z) }
#declare FnC = function { Fn(3.0*x, 1.0*y, 1.0*z) }
#declare FnD = function { Fn(1.5*x, 1.5*y, 1.5*z) }

isosurface {
   function {
     y
     + FnA(x - Ax, y - Ay, z - Az)
     - FnB(x - Bx, y - By, z - Bz)
     - FnC(x - Cx, y - Cy, z - Cz)
     - FnD(x - Dx, y - Dy, z - Dz)
   }
   max_gradient 4
   contained_by { box { -<100, 2, 100>, <100, 2, 100> } }
   pigment { color White }
}

light_source {
   <1, 2, -2>*100
   colour White*1.4
   shadowless
}

camera {
   location <0, 2, -3>*10
   look_at <0, 0, 0>
   angle 20
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

-- 
Tor Olav
http://subcube.com


Post a reply to this message

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