# Attractor problem

Hi

Please help me fix this defintion. I would like to add more than one point attractor to control orientation of circles. Currently it only react to a single point…

att test.3dm (153.5 KB) attractor test.gh (6.8 KB)

I’m trying to achieve something like this.

1 Like
2 Likes

Hi Joseph

Thank you for the quick response.

Just tried (attached), is there a way to smooth the transition more? just like the ref image I’ve posted on my original post…

1 Like

You might want to see this similar topic.

4 Likes

Except for projecting the circles to the World XY plane, I believe that code does exactly the same thing as what I posted above. Not quite sure yet how to smooth out the transition between points.

2 Likes

Thought I recognised that image @HS_Kim!

It might be easier to think about how combine the information from two points rather than use closest point, which then often gives rise to the hard transition you’re trying to avoid @samuel.ryu. For example, you could take the distances for all attractors, and then ‘reward’ those points that are close by (using an inverse power law or something, see attached) - then you will get a smooth transition as you move close to a particular attractor.

You can then use this resultant number to do something, rotate a circle, scale it, whatever. Keeping it to 2D just simplifies the whole setup in my humble opinion, but you could convert this number to a vector direction/magnitude if desired. Anyway, here is an example which is kind of similar to the right hand side of your original image example (just inverted).

attractorPowerLaw.gh (13.4 KB)

Granted it’s not exactly the same, but hopefully it will lead you in the right direction.

John.

4 Likes

That’s a nice, long winded way of explaining exactly what I’ve been trying to do with this but so far, I haven’t come up with a way of applying it to the vector that aims the circles/disks.

Here is an updated version of my earlier post with code added to generate random attractor points.

attractor_2020Aug24b.gh (15.1 KB)

By the way, no Rhino file is needed for this.

2 Likes

Yeah, it’s tricky and probably more than the primer lets on tbh.

Essentially, if you get the vectors and then multiply them by this inverse power, it works. Bit more involved than I was expecting though tbh, maybe there’s a simpler way than this.

attractorPowerLaw_vectors.gh (13.7 KB)

John.

2 Likes

If you replace the Circle ‘R’ (Radius) input with the HexGrid ‘S’ (Size) input value so all the circles are the same size, you get a result very similar to what I’m seeing in my own efforts. A large “flat spot” at the center (average point?) of the attractor point cloud:

I’ve been trying to avoid that - without success so far - but I have other things to do…

2 Likes

Indeed @Joseph_Oster, but I think the flat circles are fine right? It’s more the smooth transition between the individual objects that Samuel wanted to solve. If you invert the radius you get something similar to the original post I think. This is just my take, but personally wouldn’t use closest point when doing this because then you get the ‘Voronoi’ lines where one point jumps to a different attractor. Maybe there’s a way to get it to work with the closest point, but anyway, back to work as you say!!

2 Likes

I hear you @johnharding, you’re on the right track. I immediately abandon the closest point approach when I started to work on smoothing the transitions but hoped for something different, where flat disks appear only under the attractor points and nowhere in between them. The surface directions of the disks would flip at those ‘Voronoi boundaries’ but they would be ‘edge on’ from above. Only a mirage, perhaps?

Looking again at the third panel of @samuel.ryu’s “trying to achieve” example, it looks like the disks might be edge on at the attractor points and flatter in between? Same problem though.

2 Likes

Indeed, they flip when they switch to the other point. I guess you’ll never have a consistent distance between points for the general case, so it’s difficult to adjust to avoid some sort of seam.

I really must do more work, but this is a little additive! I think we’ve pretty much exhausted this thread However, if you align ellipses along the vector field for the definition I posted above you can avoid the flat areas in between. A bit like pollen grains aligning themselves in a stream (kind of!). Changing the power changes the influence over the vector field, it’s actually kind of fun to see it changing into the Voronoi as the power increases, in this case from x^-1.5 to x^-2.5.

attractorPowerLaw_Pollengrains.gh (10.8 KB)

Right, dinner time now…

John.

4 Likes

This turning into the Voronoi as the power increases is a nice property of Shepard interpolation
The weighted average component can also be handy for this sort of thing

shepard_ellipses.gh (28.2 KB)

7 Likes

Beautiful but only 2D ellipses, not the 3D vector oriented circles called for by the OP (@samuel.ryu ).

2 Likes

Ah, didn’t see that. It has the plane, so in that case simply rotate the circle about one of its axes instead:

shepard_ellipses_rotate.gh (43.8 KB)

10 Likes

That looks good, especially with a few changes:

• Use DePlane ‘Y’ axis instead of ‘X’ to rotate the circles.
• Change the second Wav (Weighted Average) 'I input slider from 0.755 to 2.0.
• Change the slider connected to the Ins (Insert Items) ‘I’ input from 0.081 to 0.070 (or lower - minor)

I’ve never used Wav (Weighted Average) and will have to play with it to understand it. Clever!

Two things I noticed:

1. There is no circle/disk below each attractor point because those points are Null, due to “Null Vectors”.
2. When the attractor points are moved up (or down) per the original post, weird things happen.
2 Likes

Thank you John, really appreciate your help.

2 Likes

Thank you Joseph!

1 Like

Thank you for the explanation and definition.

1 Like

Thanks HS_Km!

1 Like