Point flows on Meshes

Hello!

I had been trying to figure out how to achieve a somewhat vector-field like line flow on a mesh. My ambition is to somewhat evenly cover most of the mesh surface with the flow lines while reducing overlap / crossing over of the lines as much as possible.

My approach uses the looping in Anemone to create incremental movement of points which are then interpolated.

My starting point was a typical water-flow simulation where the points populated on a mesh are moved down on the z-axis. The closest point on a mesh is then extrapolated. This would be repeated x times and the resultant points interpolated into curves.
I had found this works well, but the paths quickly bunch up into valleys (as water would). My attempts of adding a point attractor / repellant to reduce some of the overlap and allow the lines to cover more of the geometry were not successful. Rough sketch of what i am trying to. achieve in this step below:


The last step I am trying to incorporate within the looping is twisting of the lines around the ‘peaks’ of the mesh. This twisting would need to die down with the distance from the peak. I am using a vector which is a tangent of the closest point on the mesh edge. This somewhat works, but the lines bunch up and cross each other.

Struggling quite a bit now to balance all these vectors. My goal is to have somewhat uniformly wrapped the mesh in sinuous lines, the lines would ideally have no sharp turns.
Is my approach of the anomeone feasible? Would it be better to treat it as a vector field problem (not sure how to work with vector fields on somewhat complex mesh). How could i prevent the lines from ‘bunching up’, crossing each other or overlapping?

Any thoughts or resources would be greatly appreciated.
IG - 241011.gh (6.3 MB)

Many thanks!

Hello
my plugin NAutilus allows to flow along mesh, it can transform slopes to vector and rotate them.
So you will have a vector field. Then you can use my tool to flow points along vector field. ANd if field is too dense it is possible to suppress some curves.
The only drawback here is that it doesn’t work on big mesh. So I had to scale it to 1/1000.

here along slope


45°

70°

IG - 241011 LD.gh (6.3 MB)

See there also

For the twist I have a component that gives vector for a given slope. But as in your geometry slopes are everywhere it doesn’t give what you want.

The second way is to tween 2 vectors field using a scalar field representing a distance to the curves you choose. You just have to generate a value [0 1] on each point of the mesh, then
Vector = Vector (x°) * alpha + Vector (0°)*(1-alpha)


Small distance from the curves and sharp change

Less sharp

You can rely on slope

or not

3 Likes

This is brilliant work Laurent, many thanks for sharing.
I will dwelve into NAutilus and report back- the screenshots in your post looks incredibly promising.

Here the 2 last scripts, surely a bit modified. Ask if some parameters are not clear.
For the tweening you could also use more conventional attractor with GraphMapper or custom function.

IG - 241011 LD2.gh (6.3 MB)
IG - 241011 LD3.gh (6.3 MB)

1 Like

Hi Laurent,
Thanks again for the help - I’ve had a chance to play with Nautilus today - very exciting set of tools.
I am having a hard time understanding the methodology you had used to tween two sets of vector fields.
As an alternative to the previous rotation around the ‘peaks’ I had been trying to generate the twisting around the perimeter of the mesh though Weight on mesh from curve. I was hoping to for the lines to hit the peak edges perpendicularly, but struggling to get this to look right - please see screenshot below.

The lines orient towards the centre of the mesh and generate an undesirable ‘seam’. Should I be connecting another Weight on mesh from curve component to have the field lines hit the peak edges at around 90 degrees?

Fields from scalar weights are not easy especially on 3d shape. But if we come back to what we know and image a shape where weight is altitude. If you set a weight just on the perimeter it means the perimeter is at “weight” altitude but the peak altitude is not constant so flow will not arrive perpendicular. You have to set a weight to peaks, the simple trick here is so to true Boundary, by default the weight will be 0, so you’ll have to

image

Lets take this shape with weight on perimeter to -5


If boundary is set to false the hole is not flat

if true


small exemple mesh smooth weight.gh (13.7 KB)

Tweening means take a Vector field (a vector for each point of the mesh here)
0° one


45° there

So now in order to tween lets say you have a value [0, 1] value at each point of the mesh (represented by a grey)

for each point of mesh a tween vector could be written
Vector(Point) = Vector0°(Point)Value(point) + Vector45°(Point)(1-Value(point) )
Black vector if color/value/weight is black/0
White vector if color/value/weight white/1


small exemple mesh smooth weight tweening.gh (21.7 KB)