POV-Ray : Newsgroups : povray.binaries.images : randomish (~38K) Server Time
14 Aug 2024 01:19:38 EDT (-0400)
  randomish (~38K) (Message 1 to 8 of 8)  
From: PoD
Subject: randomish (~38K)
Date: 7 Jan 2003 07:44:38
Message: <3e1acbb6@news.povray.org>
I was playing around with generating geometric shapes using random 
numbers constrained by certain conditions.

This one uses the following algorithm

start with a point in space
while n < some_number
   add plus or minus one to one of x,y or z
   if the new point is within a certain volume ( in this case, near 
the 		    surface of a sphere)
   add the new point and a cylinder connecting this and the previous 

     point

I'm using Python to do the calcs and output a pov file, since it's much 
faster that way and easier to keep track of which points are occupied 
and which pairs are connected.

Anyway I thought this one looked niceish with most of the allowed 
segments in place.


Post a reply to this message


Attachments:
Download 'pipes.jpg' (38 KB)

Preview of image 'pipes.jpg'
pipes.jpg


 

From: Florian Brucker
Subject: Re: randomish (~38K)
Date: 7 Jan 2003 13:24:52
Message: <3e1b1b74$1@news.povray.org>
hey!

this is really nice. i love this background/lightning/whatsoever. how did
you do it? media?

greetings:florian


Post a reply to this message

From: Edward Coffey
Subject: Re: randomish (~38K)
Date: 8 Jan 2003 04:05:35
Message: <3E1BECB3.30708@alphalink.com.au>
PoD wrote:
> I was playing around with generating geometric shapes using random 
> numbers constrained by certain conditions.
> 
> This one uses the following algorithm
> 
> start with a point in space
> while n < some_number
>   add plus or minus one to one of x,y or z
>   if the new point is within a certain volume ( in this case, near 
> the             surface of a sphere)
>   add the new point and a cylinder connecting this and the previous
>     point

Do you have other constraints - like the number of times a point may be 
visited? It would be interesting to see if it could fill much of the 
volume if you only let it visit each point once.


Post a reply to this message

From: PoD
Subject: Re: randomish (~38K)
Date: 8 Jan 2003 06:59:43
Message: <pan.2003.01.08.11.59.41.263190@internode.on.net>
On Wed, 08 Jan 2003 20:17:39 +1100, Edward Coffey wrote:

> PoD wrote:
>> I was playing around with generating geometric shapes using random
>> numbers constrained by certain conditions.
>> 
>> This one uses the following algorithm
>> 
>> start with a point in space
>> while n < some_number
>>   add plus or minus one to one of x,y or z if the new point is within a
>>   certain volume ( in this case, near
>> the             surface of a sphere)
>>   add the new point and a cylinder connecting this and the previous
>>     point
> 
> Do you have other constraints - like the number of times a point may be
> visited? It would be interesting to see if it could fill much of the
> volume if you only let it visit each point once.

At the moment it will go to any of the adjacent points regardless but tags
the point as having a sphere and the two points as having a cylinder so
that only one object will be created.

I'll have to try only visiting empty points.  I suspect that large areas
would become 'walled off' unless a lot of the volume was allowed to be
used.


Post a reply to this message

From: Edward Coffey
Subject: Re: randomish (~38K)
Date: 8 Jan 2003 07:13:31
Message: <3E1C18BE.80607@alphalink.com.au>
PoD wrote:
> On Wed, 08 Jan 2003 20:17:39 +1100, Edward Coffey wrote:
>>Do you have other constraints - like the number of times a point may be
>>visited? It would be interesting to see if it could fill much of the
>>volume if you only let it visit each point once.
> 
> 
> At the moment it will go to any of the adjacent points regardless but tags
> the point as having a sphere and the two points as having a cylinder so
> that only one object will be created.
> 
> I'll have to try only visiting empty points.  I suspect that large areas
> would become 'walled off' unless a lot of the volume was allowed to be
> used.

Yes I imagine so. Perhaps you could make some kind of simple re-routing 
routine such that if your pipe layer got stuck he could find out if any 
of the blocking pipes were trivially re-routable, and if so, move them 
to a different route to allow the pipeline to continue on through.

I can't imagine why you would bother, but it might be fun.


Post a reply to this message

From: Florian Brucker
Subject: Re: randomish (~38K)
Date: 8 Jan 2003 09:30:30
Message: <3e1c3606$1@news.povray.org>
> I can't imagine why you would bother, but it might be fun.

i tried to do something similar - i wrote a macro which would make a random
path through a rectangular area (only 4 directions, left, up, right, down).
it was for creating a maze afterwards. i used a recursive method, as to have
the chance to avoid dead ends. it came out that the recursion level got to
deep very fast. pov only allows 200 nested conditionals, which was far too
little... (perhaps only my code was that bad? *g*)

but in your case it could be done. perhaps you should allow to reuse a point
if a dead end is reached...

greetings:florian


Post a reply to this message

From: Buke9
Subject: Re: randomish (~38K)
Date: 9 Jan 2003 00:18:40
Message: <3e1d0630@news.povray.org>
Very sweet me likes : )


Post a reply to this message

From: PoD
Subject: Re: randomish (~38K)
Date: 9 Jan 2003 06:52:44
Message: <pan.2003.01.09.11.52.42.11283@internode.on.net>
On Wed, 08 Jan 2003 23:25:34 +1100, Edward Coffey wrote:

> PoD wrote:
>> On Wed, 08 Jan 2003 20:17:39 +1100, Edward Coffey wrote:
>>>Do you have other constraints - like the number of times a point may be
>>>visited? It would be interesting to see if it could fill much of the
>>>volume if you only let it visit each point once.
>> 
>> 
>> At the moment it will go to any of the adjacent points regardless but
>> tags the point as having a sphere and the two points as having a
>> cylinder so that only one object will be created.
>> 
>> I'll have to try only visiting empty points.  I suspect that large areas
>> would become 'walled off' unless a lot of the volume was allowed to be
>> used.
> 
> Yes I imagine so. Perhaps you could make some kind of simple re-routing
> routine such that if your pipe layer got stuck he could find out if any of
> the blocking pipes were trivially re-routable, and if so, move them to a
> different route to allow the pipeline to continue on through.
> 
> I can't imagine why you would bother, but it might be fun.

Yeah, maybe. I only took about 10 minutes writing the code to do this
algorithm and maybe an hour playing around with various constraints.
I might look into some more complex routing stuff some time.
Another idea I had was to make an animation where the pipes are added one
at a time, maybe with each pipe growing from the start to the end point.
In fact that idea sounds really simple, I might start on that now :)


Post a reply to this message

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