





 
 




 
 


Hi,
For a cylinder along the x axis, the equation is :
function { y*y + z*z  R }
Ok, but how to make an isosurface cylinder like povray cylinder from two
points?
I thought to :
 compute distance from p2 to p1.
 compute the two angles from p1 to p2
 make x axis isosurface cylinder
 rotate the isosurface of the two angles
 translate to p1
Do you see a simpler solution ?

kurtz le pirate
compagnie de la banquise
Post a reply to this message


 
 




 
 


function { sqrt(pow(y,2) + pow(z,2))  5 }
Searching "povray cylinder isosurface"
yields:
http://wwwf9.ijs.si/~matevz/docs/PovRay3.50b/povdoc_082.html
Which says
To get a cylindrical surface we can use the following function.
function { sqrt(pow(x,2) + pow(z,2))  1 }
In 2 dimensions it describes a circle, since it is constant in the 3rd
dimension, we get a cylinder:
So just replace x with y, and the last number is the radius.
Hope that helps.
Post a reply to this message


 
 




 
 


Le 07/03/2016 16:28, kurtz le pirate a écrit :
>
> Hi,
>
>
> For a cylinder along the x axis, the equation is :
> function { y*y + z*z  R }
>
> Ok, but how to make an isosurface cylinder like povray cylinder from two
> points?
>
Is it an European or an African Swallow ?
Oh, wrong movie.
A plain cylinder or an open cylinder ?
>
> I thought to :
>  compute distance from p2 to p1.
>  compute the two angles from p1 to p2
>  make x axis isosurface cylinder
>  rotate the isosurface of the two angles
>  translate to p1
>
> Do you see a simpler solution ?
>
For a close cylinder, keep the function as it is and use the
contained_by box to get the extremities. (something like
box { <0, 1.1*R, 1.1*R> , < length(p2p1), 1.1*R, 1.1*R> }
Assuming you took a box from x == 0 to x == length(p2p1),
you can use Reorient_Trans(x , p2p1) from transform.inc,
then translate to p1.
Done.
For an open cylinder, add the *open* keyword.
Post a reply to this message


 
 




 
 


Le 160307 10:28, kurtz le pirate a écrit :
>
> Hi,
>
>
> For a cylinder along the x axis, the equation is :
> function { y*y + z*z  R }
>
> Ok, but how to make an isosurface cylinder like povray cylinder from two
> points?
>
>
> I thought to :
>  compute distance from p2 to p1.
>  compute the two angles from p1 to p2
>  make x axis isosurface cylinder
>  rotate the isosurface of the two angles
>  translate to p1
>
> Do you see a simpler solution ?
>
>
>
>
> 
> kurtz le pirate
> compagnie de la banquise
There is no easy way to directly make an arbitrary oriented cylinder
between two random points.
Use vlength() to find the distance between the two points.
Create the cylinder from <0,0,0> to vlength along an axis of your choice.
Rotate the cylinder as needed using the reorient() macro.
Translate to P1
Post a reply to this message


 
 




 

