POV-Ray : Newsgroups : povray.general : Help to set this product on Pov-Ray Server Time
22 Dec 2024 13:32:48 EST (-0500)
  Help to set this product on Pov-Ray (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Pablo
Subject: Help to set this product on Pov-Ray
Date: 13 Dec 2017 18:00:00
Message: <web.5a31b08317bf9c73a4fa3e4d0@news.povray.org>
Hi everyone, i'm Pablo, first-year engineer design student and I have to make up
this product on pov ray. How would you make it? Sphere_sweep? It doesnt look so
realistic:(
Thanks

This is the product:
http://e01-expansion.uecdn.es/assets/multimedia/imagenes/2017/08/24/15035604280222.gif


Post a reply to this message

From: Bald Eagle
Subject: Re: Help to set this product on Pov-Ray
Date: 13 Dec 2017 19:00:01
Message: <web.5a31befc9a3fbe025cafe28e0@news.povray.org>
"Pablo" <Pab### [at] gmailcom> wrote:
> Hi everyone, i'm Pablo, first-year engineer design student and I have to make up
> this product on pov ray. How would you make it? Sphere_sweep? It doesnt look so
> realistic:(


I'd say that the central portion ought to be an isosurface with a spherical
equation modified with a sine wave, then asymmetrically scaled (see "Non-linear
scale").

See the Insert Menu, under Special Shapes, Isosurfaces by basic function,
Isosurface sin sphere .
Then scale it:
http://www.econym.demon.co.uk/isotut/substitute.htm

Then add sphere-sweep legs, or an isosurface equivalent.

http://www.econym.demon.co.uk/isotut/more.htm#spline
http://www.econym.demon.co.uk/isotut/splines.htm


Post a reply to this message

From: Alain
Subject: Re: Help to set this product on Pov-Ray
Date: 13 Dec 2017 20:09:36
Message: <5a31cf50$1@news.povray.org>
Le 17-12-13 à 17:59, Pablo a écrit :
> Hi everyone, i'm Pablo, first-year engineer design student and I have to make up
> this product on pov ray. How would you make it? Sphere_sweep? It doesnt look so
> realistic:(
> Thanks
> 
> This is the product:
>
http://e01-expansion.uecdn.es/assets/multimedia/imagenes/2017/08/24/15035604280222.gif
> 
> 
> 
As Bald Eagle said, but I'd start with the piriform internal function 
that you can find in functions.inc

#include "functions.inc"

Then, you can use f_piriform(x,y,z, Strength).
Alternatively, you may rather want to use half of 
f_lemniscate_of_gerono(x,y,z, Strength).

In both cases, you want to scale up along the main axis.

f_piriform_2d and f_lemniscate_of_gerono_2d are more complexe 
implementations that allow more control over the shape, like making it 
more or less rounded.
Take a look at the sample scene i_internals.pov to get a better 
understanding of the working of those.

For the ribbing, I'd use #declare f_radial = function {pattern {radial 
sin_wave frequency 12}} to be added (go inward) or subtracted (go 
outward) from the above function.
Adjust frequency if you want more or less ribs.


Post a reply to this message

From: Pablo
Subject: Re: Help to set this product on Pov-Ray
Date: 22 Dec 2017 15:50:01
Message: <web.5a3d6e319a3fbe02255e9bf00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Pablo" <Pab### [at] gmailcom> wrote:
> > Hi everyone, i'm Pablo, first-year engineer design student and I have to make up
> > this product on pov ray. How would you make it? Sphere_sweep? It doesnt look so
> > realistic:(
>
>
> I'd say that the central portion ought to be an isosurface with a spherical
> equation modified with a sine wave, then asymmetrically scaled (see "Non-linear
> scale").
>
> See the Insert Menu, under Special Shapes, Isosurfaces by basic function,
> Isosurface sin sphere .
> Then scale it:
> http://www.econym.demon.co.uk/isotut/substitute.htm
>
> Then add sphere-sweep legs, or an isosurface equivalent.
>
> http://www.econym.demon.co.uk/isotut/more.htm#spline
> http://www.econym.demon.co.uk/isotut/splines.htm


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


Post a reply to this message

From: Alain
Subject: Re: Help to set this product on Pov-Ray
Date: 22 Dec 2017 18:10:27
Message: <5a3d90e3@news.povray.org>
Le 17-12-22 à 15:42, Pablo a écrit :
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> "Pablo" <Pab### [at] gmailcom> wrote:
>>> Hi everyone, i'm Pablo, first-year engineer design student and I have to make up
>>> this product on pov ray. How would you make it? Sphere_sweep? It doesnt look so
>>> realistic:(
>>
>>
>> I'd say that the central portion ought to be an isosurface with a spherical
>> equation modified with a sine wave, then asymmetrically scaled (see "Non-linear
>> scale").
>>
>> See the Insert Menu, under Special Shapes, Isosurfaces by basic function,
>> Isosurface sin sphere .
>> Then scale it:
>> http://www.econym.demon.co.uk/isotut/substitute.htm
>>
>> Then add sphere-sweep legs, or an isosurface equivalent.
>>
>> http://www.econym.demon.co.uk/isotut/more.htm#spline
>> http://www.econym.demon.co.uk/isotut/splines.htm
> 
> 
> 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
> 
> 

If you play with the x,y, and z parameters, tou can stretch ans squish 
the shape.
(x,y/3,z,...) will stertch your shape vertically by a factor of 3. It's 
similat to scale<1,3,1>.

You can also perform some non-uniform scalling:
(x,sqr(abs(y)),z,...) (x, y*(x+z), z, ...) ...

If you want to have a wavy shape, you can add or substrace a function to 
another:
#declare f_radial = function{pattern{dadial frequency 20 sin_wave rotate 
90*x}};
function{f_sphere(x,y,z) + f_radial(x,y,z)}


Post a reply to this message

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

Goto Latest 10 Messages Next 5 Messages >>>

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