Sunday, 7 March 2021

Explaining and animating how cloakfish swim

In the two previous posts I wrote about parts of The Book that provide background information about how animals move on Furaha. There will be four double-page spreads showing such themes in The Book, about rusps, spidrids, tetrapters and cloakfish. 

I thought the cloakfish one would be easy, until I decided that it was high time I also made some progress towards a short CGI documentary I wrote about earlier, the one with cloakfish biodiversity as its main subject. That is a very big job and it is quite possible that I will fail on the programming side. But nothing ventured, nothing gained, so I went ahead and put some hours into Matlab programming. My strategy to design diverse cloakfish is to write editors that allow shapes to be designed with ease. The programmes then proceeds to make ‘3d meshes’, the basic working material for 3D design. How to get from meshes to nice photorealistic images is another story altogether. 

Click to enlarge; copyright Gert van Dijk

These are the editor screens. The user places control points here and there, which are then connected by a spline function. This results in nice smooth curves, useful for organic shapes. Panel A shows the body designer with a default shape. The inset shows a separate window controlling cross-sections of the beastie. By changing both shape and cross sections interesting forms can be produced. Panel B is the cloak editor. Apart from determining the shape of the cloak it also allows control over cloak movement, such as number of waves, wave amplitude, cloak curvature, thickness, etc. Panel C does something similar for the four front fins, and panel D shows the resulting output for the default shapes. 

Click to enlarge; copyright Gert van Dijk

With a few minutes’ worth of tinkering, you get this relatively slender cloakfish, probably a reasonably fast swimmer. 

Click to enlarge; copyright Gert van Dijk

Or this short and bulky ‘short-sleaved cloakfish’.

Click to enlarge; copyright Gert van Dijk

Or even this highly derived cloakfish, in which the cloaks are no longer ribbons, but shaped like penguin wings. They function in much the same way. 

 But the main point of this post was to show how the cloaks move. To do that, I had a look at the literature, and I found some papers on knifefish, but to my surprise more papers about artificial robot fish with similar fins. Apparently, people all over the world are working on robot fish, which is nice. Less nice is that some work at defence institutes, so what are they preparing for? Killer fish robots? Must we really? 

Click to enlarge; from: Liu, Curet. Swimming performance of a bio-inspired robotic vessel with undulating fin propulsion. Bioinspir. Biomim. 13 (2018) 056006 1748-3190/aacd26

Anyway, here is an example of robot ribbon fin design. The artificial cloak design followed exactly the same reasoning as my virtual cloakfish designs. Such papers make a distinction between ‘oscillation’ and ‘undulation’. If a cloak, ribbon or fin swings side-to-side as a whole, the word ‘oscillation’ is used, and when waves travel along the length of the cloak, it is ‘undulation’. But the distinction is not all that clear; it depends on the number of waves travelling along the cloak. If there is less than one wave on the cloak or fin at a time, then the movement largely concerns the fin as a whole, so the movement edges towards oscillation. Here is a YouTube film explaining the difference

Pure oscillatory sideways movement are useless, because they do not propel the beast forwards. The animation above shows such an almost pure sideways movement of the cloaks. The movement would push water away from the cloak, resulting in a force towards the attachment of the cloak (the ‘dagger’). In knifefish, with just one cloak underneath the body, this force ‘heaves’ the body up. With four cloaks, the dagger will not be going anywhere, so this is just a waste of energy. We want water to be pushed backwards. The cloaks push water backwards when its parts are at an angle to the direction of movement. These parts produce forwards thrust. 

Let’s equip our default cloakfish with exactly one wave per cloak. One half of that wave will be angled towards the left, and the other half towards the right. Both produce sideways forces, but these should cancel one another out. The robot designers reported that the robots swam nicely with just one wave per cloak. Mind you, the robots usually had just one cloak, like the knifefish. 

The animation also shows one other trick: if you look closely, you can see that the cloaks do not sway much at front, and the amplitude of the wave increases towards the back of the animal. I borrowed that from real biology, as at least rays and knifefish do this. 

Let’s now equip our knifefish with 2 waves per cloak. The parts of the wave that are useful for swimming are now at a steeper angle towards the direction of movement, nearing perpendicular to it. I thought that this should increase the propulsive force a lot, but work on the robot fish did not agree. The velocity did not increase much, but the robot was more stable, which is intriguing. Real knifefish have more than two fins on their ribbon fins at one time, so there must be an advantage in that. 

Click to enlarge; from: Blevins, Lauder. Rajiform locomotion: three-dimensional kinematics of the pectoral fin surface during swimming in the freshwater stingray Potamotrygon orbignyi.  The Journal of Experimental Biology 2012; 215, 3231-3241

This image is from a paper about ray fin movement. The fins as a whole move up and down (so they oscillate), while there are ripples along the edges of the fins (so they also undulate). Nature seems to like combinations better than separations. The edges of the fins curl up and down, so they do not move as if there are completely stiff rays in them. 

I decided to build that in too, so here is a ‘curly-cloaked cloakfish’. I like it. One odd thing about these cloakfish animations is that it is not immediately obvious how they work, when you see the movement. It is also not easy to find an angle, when you rotate the objects, from where it is easy to get an immediate overview just how the animal is built. That can be seen as a disadvantage, or, in reverse, as an advantage, because it underlines that we are looking at an alien shape. 

By now, cloakfish ‘evolution’ has progressed to allow a variety of body and cloak shapes. Shapes range from ‘long-sleeved’ cloakfish with long narrow ribbon fins with multiple waves along their surface, to very short star-shaped cloakfish with narrow wings that fly through the water. That is certainly enough material for two explanatory pages in The Book, and should be enough for a short documentary too. But that will depend on me improving my skills as regards merging and smoothing 3D meshes.