POV-Ray : Newsgroups : povray.programming : Infinate cylinders Server Time
5 Nov 2024 20:18:14 EST (-0500)
  Infinate cylinders (Message 1 to 5 of 5)  
From: ouroborus
Subject: Infinate cylinders
Date: 19 Jul 1999 19:26:11
Message: <3793B451.295DB2FE@hotmail.com>
"shapes.inc" defines a cylinder of infinite length that runs along the
X axis as:

#declare Cylinder_X =
 quadric
  {<0, 1, 1>,
   <0, 0, 0>,
   <0, 0, 0>, -1
  }

Is there some similar way to generate an infinite 2D array of these
cylinders along with some way to either control their spacing or
diameter?

Ouroborus


Post a reply to this message

From: Lummox JR
Subject: Re: Infinate cylinders
Date: 19 Jul 1999 23:21:58
Message: <3793EB85.5A15@aol.com>
our### [at] hotmailcom wrote:
> Is there some similar way to generate an infinite 2D array of these
> cylinders along with some way to either control their spacing or
> diameter?

Interesting idea, that. I'm not sure to what extent it would be
possible.
The problem, insofar as I understand it, is that a ray could intersect
an infinite number of these cylinders--or possibly none at all. Assuming
the worst-case scenario, there has to be a way to decide which set of
intersections to use, since the shape could be used in a CSG object
which would require a number of intersections to be found for
comparisons. Throw in the possibility of several of these arrays
interacting in a CSG, and you've got yourself a worst-case scenario.

I think the only way this could reasonably be done would be to use an
isosurface, a la the Superpatch. A function like this might do the
trick:

#declare cylarray = function {
sqr(x-floor(x+0.5))+sqr(z-floor(z+0.5))-0.25 }

floor() doesn't exist in the current Superpatch--it needs to be added
in. I've got such a modification working myself, though. Heck, maybe
I'll try to render a scene like this to show you.

Lummox JR


Post a reply to this message

From: ouroborus
Subject: Re: Infinate cylinders
Date: 24 Jul 1999 20:28:26
Message: <379A5A7D.B479CB61@hotmail.com>
our### [at] hotmailcom wrote:
> 
> "shapes.inc" defines a cylinder of infinite length that runs along the
> X axis as:
> 
> #declare Cylinder_X =
>  quadric
>   {<0, 1, 1>,
>    <0, 0, 0>,
>    <0, 0, 0>, -1
>   }
> 
> Is there some similar way to generate an infinite 2D array of these
> cylinders along with some way to either control their spacing or
> diameter?

While a #while loop would do a good job of simulating such an array, I
was hoping for a poly, cubic, quartic or quadric that would produce such
a shape (an infinate 2D array of infinately long cylinders).


Post a reply to this message

From: Nieminen Mika
Subject: Re: Infinate cylinders
Date: 26 Jul 1999 03:13:23
Message: <379c0a93@news.povray.org>
our### [at] hotmailcom wrote:
: While a #while loop would do a good job of simulating such an array, I
: was hoping for a poly, cubic, quartic or quadric that would produce such
: a shape (an infinate 2D array of infinately long cylinders).

  I don't think you can make any repeating pattern with a polynomial
equation. I may be wrong though...
  Usually for repeating patterns you need some repeating function (like sine
or cosine). It may be possible with the superpatch.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Robert Dawson
Subject: Re: Infinate cylinders
Date: 12 Aug 1999 12:52:12
Message: <37b2fbbc@news.povray.org>
Nieminen Mika <war### [at] cctutfi> wrote in message
news:379c0a93@news.povray.org...
> our### [at] hotmailcom wrote:
> : While a #while loop would do a good job of simulating such an array, I
> : was hoping for a poly, cubic, quartic or quadric that would produce such
> : a shape (an infinate 2D array of infinately long cylinders).
>
>   I don't think you can make any repeating pattern with a polynomial
> equation. I may be wrong though...

    Nope, absolutely right.

    Trig functions will give a reasonable approximation, but to get real
cylinders I'd want to use fractional_part or something similar:

    x = sqrt(1 - (2*y - round(2*y)*(2*y-round(2*y))

-Robert Dawson


Post a reply to this message

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