hexagon logo

Offsetting nodes to a spherical surface

A recent post - now deleted - asked about offsetting nodes to a spherical surface.
As this may be of general interest I thought it worth posting the answer again but by itself.
 
The way to do this is with a vector pcl field.
If the required radius of the spherical surface is 100. (and this is centred on the global origin) then the vector fields three components are defined with the following equations:
First component : 'X *sqrt ((100.**2)/('X**2+'Y**2+'Z**2))-'X
 
Second component: 'Y *sqrt((100.**2)/('X**2+'Y**2+'Z**2))-'Y
 
Third component: 'Z *sqrt ((100.**2)/('X**2+'Y**2+'Z**2))-'Z
 
This field can now be used as a the vector value for a displacement LBC or to illustrate the directionality and magnitude of the vector as a force lbc.
The images below show such an lbc applied as a force and a displacement on the outside of a cube of dimension 50x50x50 centred on the origin.
 
image.png
Parents Reply Children
No Data