  front
docs

## 3D Blobs - Duffer's Guide

You can find information about 2-dimensional blobs elsewhere in this site, but what really interests me is 3D blobs.
3D blobs are defined just the same as the 2D versions, except that the function for density at a given point in 3D space of (x,y,z) is:-

!------------------------------------------------------------
! x and y are the co-ordinate values given as input

LET distance = sqr ( x*x + y*y + z*z) !Calc distance from centre
IF distance > strength THEN
LET density = 0               !Outside max_r, density=0
ELSE
LET fraction = (distance/strength)
!Convert distance to the
!range 0 to 1
LET density = (1-fraction^2) ^ 2
!calculate density function
ENDIF
!------------------------------------------------------------

(Note the use of ^2 instead of ^4 in the final assignment statement).
We now have a definition of a whole surface. Let us assume that we have n blobs. For each of the blobs we have xn, yn, and zn which define the centre point of each blob, and sn which is the strength value. The surface is defined by the equation:-

n
_
\   density (xi, yi, zi ,sn) = 1
/_
i = 1