POV-Ray : Newsgroups : povray.binaries.images : polygon to circle loft : Re: polygon to circle loft Server Time
7 Nov 2024 15:35:10 EST (-0500)
  Re: polygon to circle loft  
From: And
Date: 10 May 2015 08:40:01
Message: <web.554f5097908ae421bad22bea0@news.povray.org>
Stephen <mca### [at] aolcom> wrote:
> On 08/05/2015 07:08, And wrote:
> > I was trying to make lofting shape. And here is the fruit.
> >
>
> It is not low hanging fruit. :-)
> If it is not a trade secret. How did you blend the hexagon into a circle?
>
> --
>
> Regards
>      Stephen

Thanks for your compliment!

Well, it is not a trade secret. And the idea is simple.
I represent it by isosurface then it will be clear:

#declare r = 0.3;
#declare h = 0.3;

#declare f_1 =
function(x,y){
max(x-0.1, y-0.1, -(x+0.1), -(y+0.1) )
}

#declare f_2 =
function(x,y){
sqrt(x*x+y*y) - r
}

#declare f_blend =
function(x,y,z){
(z/h)*f_1(x,y) + (1-z/h)*f_2(x,y)
}


isosurface {
  function {f_blend(x,y,z)}
  contained_by { box { <-0.5, -0.5, 0>, <0.5, 0.5, h> } }
  accuracy 0.001
  max_gradient 40

  texture {
            pigment{ color rgb<1,1.0,0.95>*1.1}
            finish { phong 1}
   }
}


Post a reply to this message

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