POV-Ray : Newsgroups : povray.general : Help to set this product on Pov-Ray Server Time
23 Apr 2024 03:30:18 EDT (-0400)
  Help to set this product on Pov-Ray (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Help to set this product on Pov-Ray
Date: 22 Dec 2017 19:15:01
Message: <web.5a3d9f0e9a3fbe025cafe28e0@news.povray.org>
"Pablo" <Pab### [at] gmailcom> wrote:

> Hey Bald Eagle, I tried doing the way you said but i only could to make a
> isosurface sin sphere and how its name says, its a sphere but I need a kind of
> water drop. Wich funcion could I use with the sin to make this shape? Not sure
> if im explaining well

Is this close enough to what you need?

http://news.povray.org/povray.binaries.images/thread/%3Cweb.5a31dcc89a8d03875cafe28e0%40news.povray.org%3E/

First I defined a "sine sphere" - just like I assume you've accomplished, but as
a function.

Next I made an isosurface using that function, but replaced y with and equation
to non-linearly scale it.

Then I stretched it by scaling <1, n, 1>

Then i just made a leg with a sphere sweep, and used it 3 times, rotating +120
deg for the next two.

Hope that helps - post your results (and code) in the binary images thread!

Good luck!


Post a reply to this message

From: Pablo
Subject: Re: Help to set this product on Pov-Ray
Date: 24 Dec 2017 09:15:01
Message: <web.5a3fb54d9a3fbe02255e9bf00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Pablo" <Pab### [at] gmailcom> wrote:
>
> > Hey Bald Eagle, I tried doing the way you said but i only could to make a
> > isosurface sin sphere and how its name says, its a sphere but I need a kind of
> > water drop. Wich funcion could I use with the sin to make this shape? Not sure
> > if im explaining well
>
> Is this close enough to what you need?
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5a31dcc89a8d03875cafe28e0%40news.povray.org%3E/
>
> First I defined a "sine sphere" - just like I assume you've accomplished, but as
> a function.
>
> Next I made an isosurface using that function, but replaced y with and equation
> to non-linearly scale it.
>
> Then I stretched it by scaling <1, n, 1>
>
> Then i just made a leg with a sphere sweep, and used it 3 times, rotating +120
> deg for the next two.
>
> Hope that helps - post your results (and code) in the binary images thread!
>
> Good luck!

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)


Post a reply to this message

From: Bald Eagle
Subject: Re: Help to set this product on Pov-Ray
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

From: Alain
Subject: Re: Help to set this product on Pov-Ray
Date: 24 Dec 2017 18:10:05
Message: <5a4033cd@news.povray.org>
Le 17-12-24 à 09:10, Pablo a écrit :

> 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)
> 
> 

You need to use the Y component to alter the X and Z components.

Using #include"functions.inc" then using f_sphere(x,y,z,Radius) will be 
much faster as it will use compiled code instead of a user defined function.

Also, look at my older posts : I sugest using some other base shapes 
that are already pointy at one pole and round at the other. You only 
have to stretch those if you want to.

Assuming that your sphere start at 1 unit radius and is centered at the 
origin, then you can do this :
sqrt( x*x*(y/2+1.00001) + y*y + z*z*(y/2+1.00001) )
[slow]
OR
f_sphere( x*(y/2+1.00001) + y + z*(y/2+1.00001),1 )
[faster for the exact same shape]

This will scale horizontally by an amount that depend on the Y position. 
The "+0.00001" ensure that the scaling never drop to zero, and the "+1" 
shift it down so that you get a point at the bottom.

For the ribs, the best way is to use a function made out of the radian 
pattern, modified by a frequency, and using sin_wave to ensure a correct 
wavy surface shift.
As I proposed elsewhere:

#declare F_Ribs= function{pattern{(radial frequency 10 sin_wave 
color_map{[0 rgb 0][1 rgb 1]}).red}}
Adjust the frequency value to get the desired number of ribs. Here, you 
get 10 ribs.
The color_map is used to replace the default one.
".red" is used to get a single float and not a colour vector. I could 
have used .green, .blue or .grey to get the same effect. .grey will 
evaluate slower than the other 3.

And, finally, you get this :

isosurface{
  function{
   threshold 0
    f_sphere( x*(y/2+1.00001), y, z*(y/2+1.00001),1 )
   +F_Ribs( x*(y/2+1.000011), 0, z*(y/2+1.000011))
   max_gradient 2.5
   }
  scale <1,3,1>
  }


Post a reply to this message

From: Pablo
Subject: Re: Help to set this product on Pov-Ray
Date: 25 Dec 2017 07:15:00
Message: <web.5a40eb459a3fbe02255e9bf00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Pablo" <Pab### [at] gmailcom> wrote:
>
> > Hey Bald Eagle, I tried doing the way you said but i only could to make a
> > isosurface sin sphere and how its name says, its a sphere but I need a kind of
> > water drop. Wich funcion could I use with the sin to make this shape? Not sure
> > if im explaining well
>
> Is this close enough to what you need?
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5a31dcc89a8d03875cafe28e0%40news.povray.org%3E/
>
> First I defined a "sine sphere" - just like I assume you've accomplished, but as
> a function.
>
> Next I made an isosurface using that function, but replaced y with and equation
> to non-linearly scale it.
>
> Then I stretched it by scaling <1, n, 1>
>
> Then i just made a leg with a sphere sweep, and used it 3 times, rotating +120
> deg for the next two.
>
> Hope that helps - post your results (and code) in the binary images thread!
>
> Good luck!

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)


Post a reply to this message

From: Pablo
Subject: Re: Help to set this product on Pov-Ray
Date: 25 Dec 2017 08:25:00
Message: <web.5a40fbcc9a3fbe02255e9bf00@news.povray.org>
"Pablo" <Pab### [at] gmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "Pablo" <Pab### [at] gmailcom> wrote:
> >
> > > Hey Bald Eagle, I tried doing the way you said but i only could to make a
> > > isosurface sin sphere and how its name says, its a sphere but I need a kind of
> > > water drop. Wich funcion could I use with the sin to make this shape? Not sure
> > > if im explaining well
> >
> > Is this close enough to what you need?
> >
> >
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5a31dcc89a8d03875cafe28e0%40news.povray.org%3E/
> >
> > First I defined a "sine sphere" - just like I assume you've accomplished, but as
> > a function.
> >
> > Next I made an isosurface using that function, but replaced y with and equation
> > to non-linearly scale it.
> >
> > Then I stretched it by scaling <1, n, 1>
> >
> > Then i just made a leg with a sphere sweep, and used it 3 times, rotating +120
> > deg for the next two.
> >
> > Hope that helps - post your results (and code) in the binary images thread!
> >
> > Good luck!
>
> 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)

Oups, sorry I thought I haven't sent the message but it was the server that it
was not refreshed. I am trying with yout help, i will post the news. Thanks
again for the attention


Post a reply to this message

From: Bald Eagle
Subject: Re: Help to set this product on Pov-Ray
Date: 25 Dec 2017 10:50:01
Message: <web.5a411dc19a3fbe025cafe28e0@news.povray.org>
Hi Alain,

I gave that a whirl, and needed to modify it a bit to get it to work.

Not sure if I'm getting the same shape as you're suggesting.



#include "functions.inc"

#declare F_Ribs =
function {
 pattern {
  radial
  frequency 10 sine_wave
 }
}

#declare Central = isosurface {
 function {f_sphere (x*(y/2+1.00001), y, z*(y/2+1.00001), 1)
 + F_Ribs (x*(y/2+1.000011), 0, z*(y/2+1.000011)) -0.3
 }
 threshold 0
 accuracy 0.0001
 max_gradient 145
 contained_by {box {<-1,-1,-1>*2, < 1, 1, 1>*2}}
 scale <1, -3, 1>
}


Post a reply to this message

From: Pablo
Subject: Re: Help to set this product on Pov-Ray
Date: 25 Dec 2017 19:55:00
Message: <web.5a419c199a3fbe02255e9bf00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Hi Alain,
>
> I gave that a whirl, and needed to modify it a bit to get it to work.
>
> Not sure if I'm getting the same shape as you're suggesting.
>
>
>
> #include "functions.inc"
>
> #declare F_Ribs =
> function {
>  pattern {
>   radial
>   frequency 10 sine_wave
>  }
> }
>
> #declare Central = isosurface {
>  function {f_sphere (x*(y/2+1.00001), y, z*(y/2+1.00001), 1)
>  + F_Ribs (x*(y/2+1.000011), 0, z*(y/2+1.000011)) -0.3
>  }
>  threshold 0
>  accuracy 0.0001
>  max_gradient 145
>  contained_by {box {<-1,-1,-1>*2, < 1, 1, 1>*2}}
>  scale <1, -3, 1>
> }

I tried too with the way you propose, Alain, but I have to say that I see it
more difficult so I decided to continue the Bald Eagle's one. I whink I almost
have it, the have the central part but now, my issue (what I thought that would
be the easiest part)is the legs: I tried to do as a sphere sweep with 4 spheres
that I calculated with a b_spline or cubic but the result it gave me hasn't no
sense because it started and ended in someplace i haven't understand so i have
decided to put a linear spline temporary until I have the correct texture and
solve the problem with the sphere sweep. So I think I have the most work done
(thank of you, Alain and Bald Eagle <3!haha)I am postings the resultsi have by
now but I will post the final result when I will have it


Post a reply to this message

From: Bald Eagle
Subject: Re: Help to set this product on Pov-Ray
Date: 25 Dec 2017 20:45:00
Message: <web.5a41a8ff9a3fbe025cafe28e0@news.povray.org>
"Pablo" <Pab### [at] gmailcom> wrote:
I tried to do as a sphere sweep with 4 spheres
> that I calculated with a b_spline or cubic but the result it gave me hasn't no
> sense because it started and ended in someplace i haven't understand so i have
> decided to put a linear spline temporary until I have the correct texture and
> solve the problem with the sphere sweep.


You need to remember that those types of splines need extra points which don't
visibly show up in the sphere sweep.

hit F1 and look up the cubic_spline tutorial in the documentation.

Just add an extra point to the beginning and end (copy the start and finish
points, maybe shift them slightly) and that ought to get you started.

I often use VISO to design such shapes, but you can probably use any graphics
program that will give you the pixel location of the mouse pointer, and there is
also

https://agalena.nfshost.com/b1/software/epspline-prism-and-lathe-editor/

which you might find useful in the future.


Post a reply to this message

From: Alain
Subject: Re: Help to set this product on Pov-Ray
Date: 26 Dec 2017 17:03:11
Message: <5a42c71f$1@news.povray.org>
Le 17-12-25 à 19:47, Pablo a écrit :

> I tried too with the way you propose, Alain, but I have to say that I see it
> more difficult so I decided to continue the Bald Eagle's one. I whink I almost
> have it, the have the central part but now, my issue (what I thought that would
> be the easiest part)is the legs: I tried to do as a sphere sweep with 4 spheres
> that I calculated with a b_spline or cubic but the result it gave me hasn't no
> sense because it started and ended in someplace i haven't understand so i have
> decided to put a linear spline temporary until I have the correct texture and
> solve the problem with the sphere sweep. So I think I have the most work done
> (thank of you, Alain and Bald Eagle <3!haha)I am postings the resultsi have by
> now but I will post the final result when I will have it


A cubic_spline need to start and end with control points. Those points 
are not part of the visible spline. The part that you see start with the 
second point and end with the second to last point.
If you want a sharp bend, then, you need 3 points for that bend : The 
first in line with the segment going into the bend, then one at about 
the center of the bend, then one in line with the segment going away 
from the bend.

In your case, that mean a sphere_sweep with 7 or 8 points as follow :
1) start control point
2) effective start of the spline (you have it)
3) start of the sharp bend
4) middle of the sharp bend (you have it)
5) end of the sharp bend
6?) (optional) middle point of the long segment (you have it)
6 or 7) effective end of the spline (you have it)
7 or 8) end control point


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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