POV-Ray : Newsgroups : povray.binaries.images : voronoi forrest : voronoi forrest Server Time
26 Apr 2024 16:00:12 EDT (-0400)
  voronoi forrest  
From: ingo
Date: 4 Feb 2019 07:59:52
Message: <XnsA9EC8E6578D7Bseed7@news.povray.org>
Proof of concept, voronoi forrest with about a 100 trees and saplings
with non intersecting foliage. 

Generate a bunch of random points. Put them in Voro++ or as I did Tess
https://github.com/wackywendell/tess a python binding to Voro++ (on
windows you need the MS compiler tool thingy). The output I used is a
list of neighbours per point. From that I calculated the nearest
neighbour per point. Devided the distance by two and used that as
radius for a sphere. 

There are other options, one could use the centroid of a voroni cell
and calculate the biggest cell fitting sphere based on that position. 
The Voro++ commandline program can output vertices and normals relative
to a points position. This can easily be used to create a foliage by
using the vertices to construct a union of polygons. Scale the union
down a bit and move it to the right position. The normals could be used
for intersecting multiple planes to create a solid foliage. 

attached are forrest.pov for the first step, the creation of random
points and it writes a python file vorodat.py. That is needed by
vorotess.py, the second step, that does the voro++ thing and writes
POV-Ray arrays to forrest.inc Finally Forrest_spheres.pov uses the
include to make the trees. 

I won't persue this any more for the moment eventhough there are many
possibilties. Also for clouds etc. 

https://www.youtube.com/watch?v=J4-x_sBX9tk

ingo


Post a reply to this message


Attachments:
Download 'forrest_spheres.jpg' (251 KB) Download 'forrest.pov.txt' (3 KB) Download 'forrest_spheres.pov.txt' (1 KB) Download 'vorotess.py.txt' (1 KB)

Preview of image 'forrest_spheres.jpg'
forrest_spheres.jpg

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