I imagine the center of gravity to be at (0, 0, 0). The angular velocity is (0, 0, ω) and the velocity of a point at (x, y, z) in the blob is ω(y, −x, 0). I exploit two symmetries here. p(x, y, z) = p(−x, y, z) from the fact that spinning in either direction leads to the same shape, and p(x, y, z) = p(x, y, −z) for the North-South symmetry. The surface of the blob consists of the ends of the posts. The computational inner loop computes p1 for every combination of post-end and post. I propose a 2D post array with length as the only post state. Existence of post_{ij} is just L[i][j]>0. Occasionally it is necessary to circumnavigate the existing posts looking for where new posts are needed.
For each post position in the grid for which the post length is greater than 0 or next to such a post, we calculate the potential. This will inaugurate new posts as needed and even serve two blob configurations. When we trim a post do not make its length negative but leave it at 0. The post will effectively disappear with simple logic as its length is set to 0. We need to segregate posts into blobs in order not to leak stuff from one blob to another. I imagine that two blobs will always be divided by a plane but I don’t plan on a solution for this until it is needed.
Just now (2017 Aug) this feels like the easiest plan. See this about multi threading.
Some evolving C code. p1 is the same function in both Scheme and C. The p2 in C is Scheme’s px. This is a working backup that computes a nearly constant potential on the surface of a ball.
The potential at (x, y, z) of a uniform post from:
expression | post limits | mass = length |
p1(x, y^{2} + z^{2}) | (0,0,0) to (1,0,0) | 1 |
p2(x, y^{2} + z^{2}) | (−1,0,0) to (1,0,0) | 2 |
p3(L, x, y^{2} + z^{2}) | (−L, 0, 0) to (L, 0, 0) | 2L |
(p1 0 0 x) is close to log(2)−log(x) = log(2/x)
2π(Integral from 0 to w of x(log(2/x))) = 2π(w^2/4 + 0.5(log(2/w)))