POV-Ray : Newsgroups : povray.newusers : Simple isosurface Server Time: 25 Jun 2019 19:42:15 GMT
  Simple isosurface (Message 1 to 4 of 4)  
From: kurtz le pirate
Subject: Simple isosurface
Date: 7 Mar 2016 15:28:15
Message: <56dd9e0f$1@news.povray.org>
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

From: Bald Eagle
Subject: Re: Simple isosurface
Date: 8 Mar 2016 04:55:00
Message: <web.56de5a74cc28218a5e7df57c0@news.povray.org>
function { sqrt(pow(y,2) + pow(z,2)) - 5 }

Searching "povray cylinder isosurface"
yields:
http://www-f9.ijs.si/~matevz/docs/PovRay-3.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

From: Le Forgeron
Subject: Re: Simple isosurface
Date: 8 Mar 2016 13:00:11
Message: <56deccdb$1@news.povray.org>
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.


Post a reply to this message

From: Alain
Subject: Re: Simple isosurface
Date: 8 Mar 2016 18:38:42
Message: <56df1c32$1@news.povray.org>
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


Post a reply to this message

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