POV-Ray : Newsgroups : povray.general : how to make a revolution plot from a parametric function? : Re: how to make a revolution plot from a parametric function? Server Time
8 Jul 2024 14:20:49 EDT (-0400)
  Re: how to make a revolution plot from a parametric function?  
From: xslittlegrass
Date: 6 Jun 2014 10:40:01
Message: <web.5391d25035ccce6f1e36f4d20@news.povray.org>
"JimT" <nomail@nomail> wrote:
> > Is it possible to create a revolution plot directly from a parametric function?
> >
> > For example, I have a 2d parametric function
> >
> > x[u]=Cos[u]*(1 + 2 Cos[2 u])
> > y[u]=Sin[u]*(1+2Cos[2 u])
> >
> In this case, yes.
>
> Since x = rcos(theta) and y = rsin(theta) in standard polars, your parametric
> equations are just saying
> r   = 1+2cos(2theta)
>     = 1+2cos^2(theta)-2sin^2(2theta)
>     = 3cos^2(theta) - sin^2(2theta)
>     = (3x^2 - y^2)/r^2
> r^3 = (3x^2 - y^2)
> Square to pick up the negative r lobes
> r^6 = (3x^2 - y^2)^2
> In 2D
> (x^2+y^2)^3 = (3x^2 - y^2)^2
> To go to 3D, to be axi-symmetric around the x axis, replace y^2 with y^2+z^2.
> Replacing x^2 by x^2+z^2 would be axi-symmetric around the y axis. A similar
> shape, but the large lobe rotates to a "disk".
>
> #include "colors.inc"
>
> #declare surftest =
> isosurface {
>  function { pow(x*x+y*y+z*z,3)-pow(3*x*x-y*y-z*z,2)}
> // evaluate 356*Min_factor,  sqrt(356/(356*Min_factor)),  0.7
>  max_gradient 1500
>  all_intersections
>  contained_by { sphere { 0 3}}
>  clipped_by {box {-3 3}}
>  pigment {Red}
>  finish { phong 0.6 reflection 0.2 }
> }
> object{surftest }
> background{White}
> light_source { <20,20,20> color 1}
> camera{location <0, 0, 20> look_at <0, 0, 0> angle 40}
>
> Produces the surface.Note the rather large max_gradient. For a while, with
> smaller max_gradient, I wasn't getting anything.
>
> Thanks,
>
> JimT

Thanks. That's very helpful.
But can we get the most outer surface of the plot? I mean can we make the
surface into a single solid object without all the internal structures?
And what does this line mean "evaluate 356*Min_factor,
sqrt(356/(356*Min_factor)),  0.7" ?


Post a reply to this message

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