POV-Ray : Newsgroups : povray.off-topic : Vector flood fill? : Re: Vector flood fill? Server Time
3 Sep 2024 15:13:15 EDT (-0400)
  Re: Vector flood fill?  
From: andrel
Date: 16 Nov 2010 10:59:55
Message: <4CE2AA7C.7050707@gmail.com>
On 16-11-2010 15:03, andrel wrote:
> On 16-11-2010 4:35, Darren New wrote:
>> Darren New wrote:
>>> I'm thinking you could probably triangulate all the areas between
>>> verticies.
>>
>> FWIW, it looks like
>> http://en.wikipedia.org/wiki/Delaunay_triangulation
>> is getting me on the way.
>
> you can use it to generate such a maze though

Probably even more useful if I include the triangles.
Algorithm:
- generate random points in a field (in this case surrounded by lines of 
fixed border points, and I removed points to close to one another to get 
a more even distribution).
- create a delauney triangulaton
- find all edges of the triangles
- pick a starting triangle
- repeat
	- find a triangle that was not used yet and shares an edge with this one
		- if you can not find one try another used triangle until you do
	- remove the edge
	- mark new triangle as used
	- pick a new used triangle (I first try this new one, seems to give 
nicely complicated mazed, other choices give other mazes.)
- until all triangles are used

remaining edges form the walls of a maze.


Post a reply to this message


Attachments:
Download 'amaze2.png' (30 KB)

Preview of image 'amaze2.png'
amaze2.png


 

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