POV-Ray : Newsgroups : povray.general : Help to set this product on Pov-Ray : Re: Help to set this product on Pov-Ray Server Time
12 Jul 2025 16:09:18 EDT (-0400)
  Re: Help to set this product on Pov-Ray  
From: Bald Eagle
Date: 24 Dec 2017 11:25:01
Message: <web.5a3fd3d69a3fbe025cafe28e0@news.povray.org>
"Pablo" <Pab### [at] gmailcom> wrote:

> Wow, that's exactly what I want to do! But I don't know what equation to
> non-linearly you have put instead of the y on the "sine sphere". That's the
> point for me. So it's this function:
>
> sqrt( x*x + y*y + z*z ) - 0.9
>             + sin( 12*atan2(x, z) )*0.051
>
> (isn't it?) but on both y's that appear on the sqrt what should I replace for?
> Thanks for all the attention. (I haven't seen the work you done seting the
> product until today, i'm new on this web site. I'm so thankful, seriusly)

So,
I first used an example equation for a sin sphere
#declare P = function {sqrt (x*x + y*y + z*z) - 0.9 + sin (12*atan2 (x, z)
)*0.05}
(probably from the drop-down insert menu)

Then I used that in an isosurface
#declare Central = isosurface {function { P(x, y*(1.05-y/4), z) }
....
and stretched it a bit
scale <1, -3, 1>
....
}

That non-linear scaling by variable substitution comes right out of:
http://www.econym.demon.co.uk/isotut/substitute.htm
(scroll about half-way down)

Note that when you have a lot of things going on, it's sometimes easier to break
your equations and variable substitutions down into separate more easily
handled, understood functions that can be combined.

So the above could also be done like:

#declare Y = function {y*(1.05-y/4)}
#declare P = function {sqrt (x*x + Y*Y + z*z) - 0.9 + sin (12*atan2 (x, z)
)*0.05}
#declare Central = isosurface {function { P(x, Y, z) } ...

Note that the function Y is capitalized to differentiate it from the vector y or
the function variable y that both get reserved by the POV-Ray parser.
Also the function Y has to be declared before function P, since P uses Y in its
definition.



So, here we've quickly slapped together something that has the desired
attributes of the goal, which with a lot of blathering and hand-waving is
probably fine for an "artist's conception" but as an _engineer_, I'd be looking
to understand how the variables control the absolute dimensions of the shape,
such that if the goal becomes "It needs to be THIS high, and THIS wide....
then you could define height and width variables and have the dimensions of the
shape calculated based on those.
Maybe you'd want deeper or shallower waves on the sine sphere..
"Given a material of density d, it can weight no more than W...)
(What is the volume of the sine sphere?)


"But when great and ingenious artists behold their so inept performances, not
undeservedly do they ridicule the blindness of such men; since sane judgment
abhors nothing so much as a picture perpetrated with no technical knowledge,
although with plenty of care and diligence. Now the sole reason why painters of
this sort are not aware of their own error is that they have not learnt
Geometry, without which no one can either be or become an absolute artist; but
the blame for this should be laid upon their masters, who are themselves
ignorant of this art."
The Art of Measurement. 1525.



(I came a cross a better quote, which IIRC was attributed to Archimedes, but I
can't seem to be able to find that one again.)


Post a reply to this message

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