Magnet simulation

I’m trying to simulate the magnetic field like shown below. I tried to use P_Law example to create magnetic charges.
However I can’t get the simulation to look the the image shown above. I’m attaching the gh file that I had been working on.
Bar (29.5 KB)
Thanks in advance!

1 Like

Hey !

I’d use the native Grasshopper field components. Is this what you’re looking for?

Cheers (15.4 KB)


You’ve tagged kangaroo, so it seems you are searching for a dynamic simulation, not static.
Also, simplifying a magnetic field with 2 opposite charges is good only for a small amount of cases, for magnetic dipoles and such.

Months ago i watched about making a non-static 3d magnetic simulator (as it seems it doesn’t exist).
I dived into wikipedia … complex stuff, 3d gradient vector fields and such, it managed to make the correct fields, but i were far from implementing inertia/moments, collisions… my math knowledge is only from high school and building proper c# classes is hell in this scenario.

Anyway, this is really interesting.

1 Like