POV-Ray : Newsgroups : povray.newusers : Spline Server Time
25 Nov 2024 15:23:48 EST (-0500)
  Spline (Message 1 to 8 of 8)  
From: Oleguer Vilella
Subject: Spline
Date: 15 Jun 2005 11:10:29
Message: <42b044e5$1@news.povray.org>
Hi,

Can I modulate this isosurface using a linear_spline?

======================================
#declare S = function {
   spline {
     linear_spline
    -1.0, < 0.5, 0, 0>,
    -0.5, < 0,   0, 0>,
     0.01,< 0.2, 0, 0>,
     0.5, <-0.2, 0, 0>,
     1, <-0.2, 0, 0>
   }
 }


isosurface {
function { abs(S(x, y, z)) - Thickness  }
max_gradient 2
contained_by{box{ <-36, -20, 147> <280, 20, 150> }}
pigment { color Green}
finish { ambient 0.2 diffuse 0.8 phong 1 }
translate <10, -40, -116>}
======================================

Thanks in advance.

Regards,
Oleguer Vilella


Post a reply to this message

From: Mike Williams
Subject: Re: Spline
Date: 15 Jun 2005 13:13:26
Message: <FRmy7EAVFGsCFwS7@econym.demon.co.uk>
Wasn't it Oleguer Vilella who wrote:
>Hi,
>
>Can I modulate this isosurface using a linear_spline?

It's not clear what you are trying to achieve with that code. It's
possible to fix it in various different ways to achieve various
different results. The main problem is that splines are three functions
of one variable, not one function of three variables, so instead of
S(x,y,z) you have to use the three functions S(?).x S(?).y and S(?).z,
where "?" could be x, y or z.

Take a look at the examples on these pages for some ideas of what can be
achieved. I believe that all the examples work equally well if you
change them to linear splines.

http://www.econym.demon.co.uk/isotut/more.htm
http://www.econym.demon.co.uk/isotut/splines.htm

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Spline
Date: 15 Jun 2005 15:06:03
Message: <42b07c1b@news.povray.org>
Hi Mike,

Thanks a lot for replying my post.

Well, I'm understanding somethings.
First your code:
======================================
#declare S = function {
   spline {
     natural_spline
     -1, < 0.5, 0, 0.0>,
    -0.5, < 0.2, 0, 0.4>,
    0.01, < 0.2, 1, 0.2>,
     0.5, < 0.4, 0, 0.4>,
       1, < 0.0, 0,-0.2>

   }
 }

isosurface {
  function { y - S(x).x - S(z).z  }
  max_gradient 2
  pigment { color Green }
   translate <170, 5, -90>}
======================================
To make it larger I have to increse the number of point, isn't it?
And, if I want to reduce the height?

I want to create a surface like this:
======================================
#declare  Q = function {y - 9*cos(x/3/8) - 3*sin(z/3/8)}

isosurface {
 function { abs(Q(x,y,z)) - 1  }
  max_gradient 2
  contained_by{box{ <-36, -20, 147> <280, 20,150> }}
  pigment { color Green}
  finish { ambient 0.2 diffuse 0.8 phong 1 }
  translate <10, -40, -116>
======================================
But it's only a simple sine and cosine function. I want a function to make 
the surface go up and go down. I think a spline would be a good idea.

What do you think Mike?

Regards,
Oleguer









news:FRm### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
>>Hi,
>>
>>Can I modulate this isosurface using a linear_spline?
>
> It's not clear what you are trying to achieve with that code. It's
> possible to fix it in various different ways to achieve various
> different results. The main problem is that splines are three functions
> of one variable, not one function of three variables, so instead of
> S(x,y,z) you have to use the three functions S(?).x S(?).y and S(?).z,
> where "?" could be x, y or z.
>
> Take a look at the examples on these pages for some ideas of what can be
> achieved. I believe that all the examples work equally well if you
> change them to linear splines.
>
> http://www.econym.demon.co.uk/isotut/more.htm
> http://www.econym.demon.co.uk/isotut/splines.htm
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Spline
Date: 15 Jun 2005 16:48:14
Message: <OOeA8GA0OJsCFwDM@econym.demon.co.uk>
Wasn't it Oleguer Vilella who wrote:
>I want a function to make 
>the surface go up and go down. I think a spline would be a good idea.
>
>What do you think Mike?

Perhaps something like this:


#version 3.6;

global_settings {assumed_gamma 1.0}

camera {location  <0,50,-160> look_at <0,0,0>}

background {rgb 1}

light_source {<-30, 100, -30> color rgb 1}

// ----------------------------------------

#include "colors.inc"

#declare S = function {
   spline {
     linear_spline
    -1.0, < 0.5, 0, 0>,
    -0.5, < 0,   0, 0>,
     0.01,< 0.2, 0, 0>,
     0.5, <-0.2, 0, 0>,
     1, <-0.2, 0, 0>
   }
 }

#declare Length = 100;
#declare Height = 50;
#declare Thickness = 10;

#declare  Q = function {y - Height*S(x/Length).x}

isosurface {
 function { abs(Q(x,y,z)) - Thickness  }
  max_gradient 2
  contained_by{box{ -<Length, Height+Thickness, Thickness> 
                     <Length, Height+Thickness, Thickness> }}
  pigment { color Green}
  finish { ambient 0.2 diffuse 0.8 phong 1 }
}  


This is rigged for the container box to just fit as long as the spline
values stay between -1.0 and +1.0.


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Spline
Date: 15 Jun 2005 17:33:35
Message: <42b09eaf@news.povray.org>
Hi again Mike,

Yeah, but, let me sometime to think a bit more. I will tray your answer 
later, I think that I'm starting to understand it.
Fisrt I'm going to tray one of your exemples from your website, I think that 
could work properly and then I will study your post.
Surely your answer is completly correct and I prefer to see it later.

Thank your ver much for your help.

I will explain me results later :).

Best regards,
Oleguer



news:OOe### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
>>I want a function to make
>>the surface go up and go down. I think a spline would be a good idea.
>>
>>What do you think Mike?
>
> Perhaps something like this:
>
>
> #version 3.6;
>
> global_settings {assumed_gamma 1.0}
>
> camera {location  <0,50,-160> look_at <0,0,0>}
>
> background {rgb 1}
>
> light_source {<-30, 100, -30> color rgb 1}
>
> // ----------------------------------------
>
> #include "colors.inc"
>
> #declare S = function {
>   spline {
>     linear_spline
>    -1.0, < 0.5, 0, 0>,
>    -0.5, < 0,   0, 0>,
>     0.01,< 0.2, 0, 0>,
>     0.5, <-0.2, 0, 0>,
>     1, <-0.2, 0, 0>
>   }
> }
>
> #declare Length = 100;
> #declare Height = 50;
> #declare Thickness = 10;
>
> #declare  Q = function {y - Height*S(x/Length).x}
>
> isosurface {
> function { abs(Q(x,y,z)) - Thickness  }
>  max_gradient 2
>  contained_by{box{ -<Length, Height+Thickness, Thickness>
>                     <Length, Height+Thickness, Thickness> }}
>  pigment { color Green}
>  finish { ambient 0.2 diffuse 0.8 phong 1 }
> }
>
>
> This is rigged for the container box to just fit as long as the spline
> values stay between -1.0 and +1.0.
>
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

From: B  Gimeno
Subject: Re: [es] Spline
Date: 21 Jun 2005 14:24:56
Message: <42b85b78$1@news.povray.org>

news:42b09eaf@news.povray.org...
> Yeah, but, let me sometime to think a bit more. I will tray your answer
> Fisrt I'm going to tray one of your exemples from your website, I think
that


que no.


No te lo tomes a mal, tal vez te ahorre malos ratos, como el de aquella



las mejores putas de europa)

felices renders
--
light_source{0,1}#macro C(r,p)cylinder{x*-2,x*2,.9 pigment { rgb
p} /* B Gimeno estoeslarealidad */ rotate p*90 } #end difference
{box {-1,1} C(z /* http://usuarios.lycos.es/game2413 */,x)C(x,y)
C(z,z) pigment{rgb 2} rotate 45 translate z*4} // www.povray.org


Post a reply to this message

From: Oleguer Vilella
Subject: Re: [es] Spline
Date: 22 Jun 2005 02:24:18
Message: <42b90412@news.povray.org>
Yeah, my mistake.

Thanks Bruno, its try.

Regards,
Oleguer



news:42b85b78$1@news.povray.org...

> news:42b09eaf@news.povray.org...
>> Yeah, but, let me sometime to think a bit more. I will tray your answer
>> Fisrt I'm going to tray one of your exemples from your website, I think
> that
>

> que no.


> No te lo tomes a mal, tal vez te ahorre malos ratos, como el de aquella




> las mejores putas de europa)
>
> felices renders
> --
> light_source{0,1}#macro C(r,p)cylinder{x*-2,x*2,.9 pigment { rgb
> p} /* B Gimeno estoeslarealidad */ rotate p*90 } #end difference
> {box {-1,1} C(z /* http://usuarios.lycos.es/game2413 */,x)C(x,y)
> C(z,z) pigment{rgb 2} rotate 45 translate z*4} // www.povray.org
>
>


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Spline
Date: 22 Jun 2005 03:04:35
Message: <42b90d83$1@news.povray.org>
Well I was playing with splines using them as a function and I think I 
understood them.
Now I'm going to try to to do another thing.

Thank you very much for your help and for your quick relpy.

Best regards,
Oleguer




news:OOe### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
>>I want a function to make
>>the surface go up and go down. I think a spline would be a good idea.
>>
>>What do you think Mike?
>
> Perhaps something like this:
>
>
> #version 3.6;
>
> global_settings {assumed_gamma 1.0}
>
> camera {location  <0,50,-160> look_at <0,0,0>}
>
> background {rgb 1}
>
> light_source {<-30, 100, -30> color rgb 1}
>
> // ----------------------------------------
>
> #include "colors.inc"
>
> #declare S = function {
>   spline {
>     linear_spline
>    -1.0, < 0.5, 0, 0>,
>    -0.5, < 0,   0, 0>,
>     0.01,< 0.2, 0, 0>,
>     0.5, <-0.2, 0, 0>,
>     1, <-0.2, 0, 0>
>   }
> }
>
> #declare Length = 100;
> #declare Height = 50;
> #declare Thickness = 10;
>
> #declare  Q = function {y - Height*S(x/Length).x}
>
> isosurface {
> function { abs(Q(x,y,z)) - Thickness  }
>  max_gradient 2
>  contained_by{box{ -<Length, Height+Thickness, Thickness>
>                     <Length, Height+Thickness, Thickness> }}
>  pigment { color Green}
>  finish { ambient 0.2 diffuse 0.8 phong 1 }
> }
>
>
> This is rigged for the container box to just fit as long as the spline
> values stay between -1.0 and +1.0.
>
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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