POV-Ray : Newsgroups : povray.newusers : Simple isosurface : Re: Simple isosurface Server Time: 19 Aug 2019 14:36:57 GMT
 Re: Simple isosurface
 From: Alain Date: 8 Mar 2016 18:38:42
Le 16-03-07 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