POV-Ray : Newsgroups : povray.binaries.animations : Re: Point distribution on sphere (3 Attach.: 574, 378 & 396 kb) Server Time
19 Jul 2024 17:09:39 EDT (-0400)
  Re: Point distribution on sphere (3 Attach.: 574, 378 & 396 kb) (Message 1 to 4 of 4)  
From: Christoph Hormann
Subject: Re: Point distribution on sphere (3 Attach.: 574, 378 & 396 kb)
Date: 31 Aug 2002 10:44:41
Message: <3D70D659.437FF5AC@gmx.de>
Tim Nikias wrote:
> 
> I've implemented three algorithms of the ones that
> were described in the links some fellow POVers gave
> me in povray.general a few days ago.
> 
> [...]

Nice.  Code?

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tim Nikias
Subject: Re: Point distribution on sphere (3 Attach.: 574, 378 & 396 kb)
Date: 31 Aug 2002 11:44:51
Message: <3d70e473$1@news.povray.org>
The typical question... :-)

I've got to clean it up a little before I make it
available, and I'm still tweaking on the thresholds
for the electrostatic repulsion. If I don't limit the forces
acting on a node, they squirm about way too much,
and it takes more iterations till it reaches a stable
state. If I use too low values, it just takes forever.
I need to find a simple way of refining the threshold
on the fly.

Also, I mean hey, your Christoph Hormann, you're
the one coding with springs all the time, aren't you?

Here's the momentary snippet:

//This loop calculates forces
 #declare A_Counter = 0;
 #while ( A_Counter < Sphere_Nodes-1 )
  #declare B_Counter = A_Counter+1;
  #while ( B_Counter < Sphere_Nodes )

   #declare
Act_Dir=vnormalize(Sphere_Node[A_Counter]-Sphere_Node[B_Counter]);
   #declare This_Force=1/ pow(
vlength(Sphere_Node[A_Counter]-Sphere_Node[B_Counter]),2);
   #declare Force[A_Counter]=Force[A_Counter]+(Act_Dir*This_Force);
   #declare Force[B_Counter]=Force[B_Counter]-(Act_Dir*This_Force);

  #declare B_Counter = B_Counter + 1;
  #end
 #declare A_Counter = A_Counter + 1;
 #end

//This one adds them to the positions
 #declare Counter=0;
 #while (Counter < Sphere_Nodes)
  #if (vlength(Force[Counter])>Sphere_Force_Threshold)
   #declare
Force[Counter]=vnormalize(Force[Counter])*Sphere_Force_Threshold;
  #end
  #declare
Sphere_Node[Counter]=vnormalize(Sphere_Node[Counter]+Force[Counter])*Sphere_
Radius;
  #declare Counter=Counter+1;
 #end


Sphere_Node is the array which holds the positions, and some declarations
should be pretty self-explanatory when checking the code...
--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> Nice.  Code?


Post a reply to this message

From: Mark James Lewin
Subject: Re: Point distribution on sphere (3 Attach.: 574, 378 & 396 kb)
Date: 1 Sep 2002 20:13:55
Message: <3D72AE31.2090504@yahoo.com.au>
I like this alot! I wonder whether you could cut down on your itterations by 
randomly distributing the points on the sphere before the electrostatic repulsion 
starts.

MJL


Post a reply to this message

From: Tim Nikias
Subject: Re: Point distribution on sphere (3 Attach.: 574, 378 & 396 kb)
Date: 2 Sep 2002 00:29:41
Message: <3d72e935$1@news.povray.org>
That does work, yes, but I wanted to compare
similiar starting condititions, and how well the system
works with clumped nodes...

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> I like this alot! I wonder whether you could cut down on your itterations
by
> randomly distributing the points on the sphere before the electrostatic
repulsion
> starts.


Post a reply to this message

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