  | 
  | 
 
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
It is fast. It only took 3s to render on my fx-8350 computer.
#declare height = 0.5;
#declare poly_n = 6;
#declare poly_r = 0.5;
#declare cycle_r = 0.13;
#declare an = 2*pi/poly_n;
#declare poly_thr = poly_r*cos(an/2);
#declare bound=max(cycle_r,poly_r);
#declare multi = 1000;
#declare poly_obj =
polynomial{
4,
xyz(0,2,2):multi*1,
xyz(2,0,1):multi*2*height,
xyz(1,0,2):multi*2*(poly_thr-cycle_r),
xyz(2,0,0):multi*(-pow(height, 2)),
xyz(0,0,2):multi*(-pow(cycle_r - poly_thr, 2)),
xyz(1,0,1):multi*2*height*(-2*poly_thr + cycle_r),
xyz(1,0,0):multi*2*pow(height,2)*poly_thr,
xyz(0,0,1):multi*2*height*poly_thr*(poly_thr - cycle_r),
xyz(0,0,0):multi*(-pow(poly_thr*height, 2))
sturm
}
#declare mockup2 =
difference{
    cylinder{
    <0,0,0.0>,<0,0,height>, bound
    }
    #for(i, 0, poly_n-1)
        object{
        poly_obj
        inverse
        rotate <0,0,degrees(an*i)>
        }
        plane{
        <1,0,0>,-poly_thr
        rotate <0,0,degrees(an*i)>
        }
    #end
}
mockup2
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
On 05/08/2015 02:08 AM, And wrote:
> I was trying to make lofting shape. And here is the fruit.
Very good!
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
Cousin Ricky <ric### [at] yahoo com> wrote:
> On 05/08/2015 02:08 AM, And wrote:
> > I was trying to make lofting shape. And here is the fruit.
>
> Very good!
Thanks!
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
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
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
"And" <49341109@ntnu.edu.tw> wrote:
> It is fast. It only took 3s to render on my fx-8350 computer.
>
> #declare height = 0.5;
> #declare poly_n = 6;
> #declare poly_r = 0.5;
> #declare cycle_r = 0.13;
> #declare an = 2*pi/poly_n;
> #declare poly_thr = poly_r*cos(an/2);
> #declare bound=max(cycle_r,poly_r);
> #declare multi = 1000;
>
> #declare poly_obj =
> polynomial{
> 4,
> xyz(0,2,2):multi*1,
> xyz(2,0,1):multi*2*height,
> xyz(1,0,2):multi*2*(poly_thr-cycle_r),
> xyz(2,0,0):multi*(-pow(height, 2)),
> xyz(0,0,2):multi*(-pow(cycle_r - poly_thr, 2)),
> xyz(1,0,1):multi*2*height*(-2*poly_thr + cycle_r),
> xyz(1,0,0):multi*2*pow(height,2)*poly_thr,
> xyz(0,0,1):multi*2*height*poly_thr*(poly_thr - cycle_r),
> xyz(0,0,0):multi*(-pow(poly_thr*height, 2))
> sturm
> }
>
> #declare mockup2 =
> difference{
>     cylinder{
>     <0,0,0.0>,<0,0,height>, bound
>     }
>
>     #for(i, 0, poly_n-1)
>         object{
>         poly_obj
>         inverse
>         rotate <0,0,degrees(an*i)>
>         }
>         plane{
>         <1,0,0>,-poly_thr
>         rotate <0,0,degrees(an*i)>
>         }
>     #end
> }
>
> mockup2
:)
Wonderful toy!
It is possible to play year. :)
Substituting different figures, we receive different forms.
 Post a reply to this message 
 
Attachments: 
Download 'scene.jpg' (7 KB)
 
  
Preview of image 'scene.jpg'
   
   
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
Stephen <mca### [at] aol com> 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 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
Then it will blend it from f_1(x,y) to f_2(x,y)
from z=h to z=0
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
"And" <49341109@ntnu.edu.tw> wrote:
> Stephen <mca### [at] aol com> 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}
>    }
> }
Whether it is possible to make the universal scheme of transition from a curve
to the n-gons?
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
"LanuHum" <Lan### [at] yandex ru> wrote:
> :)
> Wonderful toy!
> It is possible to play year. :)
> Substituting different figures, we receive different forms.
Thank you. Your word made me happy all day long.
 
 Post a reply to this message 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
Sorry!
Example for my early post
 
 Post a reply to this message 
 
Attachments: 
Download 'polynom.jpg' (39 KB)
 
  
Preview of image 'polynom.jpg'
   
   
 | 
  | 
 
 |   |  
 |   |  
 | 
  | 
 | 
  | 
 
 |   |  
 
 | 
  |