POV-Ray : Newsgroups : povray.newusers : Simple isosurface : Re: Simple isosurface Server Time: 19 Aug 2019 14:22:16 GMT
 Re: Simple isosurface
 From: Le Forgeron Date: 8 Mar 2016 13:00:11
```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(p2-p1), 1.1*R, 1.1*R> }

Assuming you took a box from x == 0 to x == length(p2-p1),
you can use Reorient_Trans(x , p2-p1) from transform.inc,
then translate to p1.
Done.

For an open cylinder, add the *open* keyword.
```