POV-Ray : Newsgroups : povray.advanced-users : Springs Server Time
29 Jul 2024 00:26:31 EDT (-0400)
  Springs (Message 1 to 8 of 8)  
From: Tim Nikias v2 0
Subject: Springs
Date: 7 Nov 2003 18:36:43
Message: <3fac2c8b@news.povray.org>
So, here's the deal:
I've got an array of points which are almost evenly distributed on the
surface of a sphere (using my Electro-Static-Repulsion Macro). Now, what I
want to do, is add springs between ALL nodes, so that the sphere will try to
keep its spherical hull EVEN THOUGH it will be pulled down by gravity onto
some surface (a plain for now, I will add trace() calls later).

In effect, what I want to do is create a macro which will enable me to place
a droplet of water onto any surface with proper surface tension to avoid
that typical "half-sphere on an object" look.

My question is: can anyone explain to me, or give me a link, how to properly
model springs based on distance, e.g. the formulaes to make springs act
stronger when two points get too close or too distant, but don't do much
within a certain vicinity of a given distance?

Thanks in advance,
Tim

PS: I've tried google with "springs math" and such, but I think I'm using
the wrong keywords. It's late, I've got to admit that... :-)

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 04.11.2003


Post a reply to this message

From: Christoph Hormann
Subject: Re: Springs
Date: 8 Nov 2003 03:32:02
Message: <rmlu71-s33.ln1@triton.imagico.de>
Tim Nikias v2.0 wrote:
> So, here's the deal:
> I've got an array of points which are almost evenly distributed on the
> surface of a sphere (using my Electro-Static-Repulsion Macro). Now, wha
t I
> want to do, is add springs between ALL nodes, so that the sphere will t
ry to
> keep its spherical hull EVEN THOUGH it will be pulled down by gravity o
nto
> some surface (a plain for now, I will add trace() calls later).
> 
> In effect, what I want to do is create a macro which will enable me to 
place
> a droplet of water onto any surface with proper surface tension to avoi
d
> that typical "half-sphere on an object" look.
> 
> My question is: can anyone explain to me, or give me a link, how to pro
perly
> model springs based on distance, e.g. the formulaes to make springs act

> stronger when two points get too close or too distant, but don't do muc
h
> within a certain vicinity of a given distance?

For (linear) springs the force is:



where x is the current length, l the unextended length and k the 
stiffness.  See recent thread in p.b.a. as well.

But note that to simulate a droplet on a surface, even if only the 
stationary result and not the dynamic movement, will not work with 
purely springs,  You need the internal pressure as well so the volume of 

the droplet is preserved.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 25 Oct. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Springs
Date: 8 Nov 2003 04:16:00
Message: <3facb450@news.povray.org>
> But note that to simulate a droplet on a surface, even if only the
> stationary result and not the dynamic movement, will not work with
> purely springs,  You need the internal pressure as well so the volume of
> the droplet is preserved.

Well, yeah, I'll have to look into that. But I'll first try and see how far
I can get with using just springs. Thanks for the formula!

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 03.11.2003


Post a reply to this message

From: Mikael Pohjola
Subject: Re: Springs
Date: 8 Nov 2003 04:21:27
Message: <oprybax7zv0x9foi@news.povray.org>
On Sat, 08 Nov 2003 09:22:19 +0100, Christoph Hormann 
<chr### [at] gmxde> wrote:
>
> For (linear) springs the force is:
>


No, the force is:

   F = -k*dx,
where dx is the displacement from the equilibrium. For a spring with 
length l it gives:

   F = -k*abs(x-l)

The energy of the spring is on the other hand given by:

   E = 1/2*k*(x-l)^2

-Mikael Pohjola

-- 
light_source{20*y,1}#macro _(M,X,Y,P)#macro L(N,D)#if(N)#declare 
P=P+D;box{-
0.5,0.5translate z*mod(9*P.gray,4)pigment{rgb P}rotate 45*x+clock*y 
translate
P}L(N-1,D)#end#end#if(M)L(mod(M,8)<mod(X,3)mod(Y,3)1>-1)_(div(M,8)div(X,3)div
(Y,3)P)#end#end _(2301603551,12850,60365,20*z-5*x)plane{y,-9pigment{rgb 1}}


Post a reply to this message

From: Christoph Hormann
Subject: Re: Springs
Date: 8 Nov 2003 04:42:02
Message: <etpu71-5r9.ln1@triton.imagico.de>
Mikael Pohjola wrote:
>> For (linear) springs the force is:
>>

> 
> 
> No, the force is:
> 
>   F = -k*dx,
> where dx is the displacement from the equilibrium. For a spring with 
> length l it gives:
> [...]

Oops, i should not post before breakfast...

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 25 Oct. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Andrew Coppin
Subject: Re: Springs
Date: 8 Nov 2003 07:43:54
Message: <3face50a@news.povray.org>
Mmm... someone else playing with springs... ;-)

You're welcome to have a look at the code I used for my spring mesh... In my
implementation, the springs go "slack" below a certain length, but it would
be easy enough to comment out the requisit #if statement to cause repulsion
as well as attraction. (Small note: for God's sake, get the endpoints the
right way round! lmao...)

I suspect a fully-interconnected mesh would a) take ages to calculate, but
more importantly b) be unnecessary. I doubt the atoms on one side of a drop
of water are in any way directly effected by the atoms on the opposite side
of the drop...

Someone else has already pointed out that the internal pressure of the drop
is important; I would use a volumetric model. I would create a sphere, with
"nodes" throughout its interior, and with each node linked to its nearest
neighbors only. The important thing is that the nodes on the surface are
doubly-linked to their neighbors - isn't that how *real* surface tension
happens?

If you only want to deform a drop as it rests on some surface, that will
probably work... (I presume you're gonna use blobs or some such to turn all
these nodes into something that looks like a "surface"?) Will probably fail
for animation of more complex effects - you would need the nodes to be
attacted to their *nearest* partners, which might change if there's
significant movement... but it would work ok just for this.

Actually, I was planning to try some things like this myself - that's why I
developed the spring mesh... Hmm... if only I had more time...

Thanks.
Andrew.


Post a reply to this message

From: Peter Popov
Subject: Re: Springs
Date: 8 Nov 2003 09:16:50
Message: <j0upqvcbjhb1a9iofh4hktjgcm9gh5ng26@4ax.com>
On Sat, 8 Nov 2003 00:35:05 +0100, "Tim Nikias v2.0" <tim.nikias (@)
nolights.de> wrote:

>In effect, what I want to do is create a macro which will enable me to place
>a droplet of water onto any surface with proper surface tension to avoid
>that typical "half-sphere on an object" look.

Well, I'm sorry to say that but it is likely that this approach will
not work.

First of all, water is incompressible for all practical purposes. So
you will have to enforce a constant volume in the equation and also
make sure that the distance between two adjacent nodes does not change
(it *may* due to discretization but that's always a problem of
approximation).

You will need to upgrade your model to that of an elastic hull.
Represent your sphere as a mesh with the vertices being the masses and
the edges being the springs. On each iteration, calculate the new
positions of the vertices as you would do normally. Then calculate the
volume. Then apply volumetric pressure to each triangle proportional
to its area, in the direction of its normal and inversely proportional
to the relative change in volume. Of course for each vertex you would
need to find the resultant force from the pressures applied to the
triangles that share it. Rinse, wash, repeat.

This of course is also far from the real thing but is at least much
closer that simple mass-spring.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Anton Sherwood
Subject: Re: Springs
Date: 11 Nov 2003 02:50:30
Message: <3fb094c6@news.povray.org>
Tim Nikias v2.0 wrote:
 > In effect, what I want to do is create a macro which will enable me
 > to place a droplet of water onto any surface with proper surface
 > tension to avoid that typical "half-sphere on an object" look.

Surface Evolver can generate such shapes.  (See 
http://www.susqu.edu/brakke/evolver/examples/examples.htm - search the 
page for "mound".)

You could run Evolver for various settings (what would be inputs to your 
macro) and extrapolate a model from the results.

-- 
Anton Sherwood, http://www.ogre.nu/


Post a reply to this message

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