|
|
>
> So, I've been trying half a dozen ways to make a shape, and I managed to work
> out the equations to do it with an isosurface.
> (because OMG are parametrics SLOOOOOOW)
>
>
> Only the frequency of the sine wave for the serrated, lemon-juicer top doesn't
> look right, and it's hard to really see what's going wrong with all of the
> unexpected noise.
>
> #declare ISphereR = 24;
> #declare I_Phi = function {tan(z/x)}
> #declare F_Sphere = function {pow(x,2)+pow(y,2)+pow(z,2) - pow(ISphereR,2)}
you are working with a scale of 1 unit = 1mm, that's still a radius of
57.6 cm, or a diameter of 1.15m.
>
> // a sine wave 80% of full size, with 3 peaks
> #declare F_Wave = function {ISphereR*0.8 * sin(3*I_Phi(x, y, z))}
> // only generate a spherical isosurface for the parts where the height
> // is less than the sine wave function
> #declare I = function {select(F_Wave(x,y,z)-y, 0, 0, 1)}
>
> //----------------For debugging---------------------------
> //#declare S_Wave = function {I(x,y,z)*F_Sphere(x,y,z)}
> //--------------------------------------------------------
> #declare S_Wave = function {select(y, F_Sphere (x, y, z),
> I(x,y,z)*F_Sphere(x,y,z))}
>
>
> #declare Gradient = 5500;
> #declare Min_factor= 0.7;
> #declare I_Surface = isosurface {
> //function {Pattern(x, y, z).red - 0.5}
> function {S_Wave (x, y, z)}
> open
> threshold 0
> max_gradient 5500
> //evaluate Gradient*Min_factor, sqrt(Gradient/(Gradient*Min_factor)), min
> (0.7, 1.0)
> accuracy 0.1
> contained_by {box {<-1, -1, -1>*ISphereR*1.1, <1, 1, 1>*ISphereR*1.1}}
> }
>
Do you realize that
sqrt(Gradient/(Gradient*Min_factor)) = sqrt(1/Min_factorf) ?
For the base sphere, you can use the internal one.
#include "function.inc"
then, use f_sphere(x,y,z, Radius)
Post a reply to this message
|
|