Exploding XY from Center issue

Hello Grasshoppers

Im feeling stupid again for something that seems simple but just wont work.

I want to explode a model away from a center - Geometry are 4 frames layered on XY and i want these pieces to move a distance away from the center.

Im sure im doing this the wrong way, I tried to find a simple way to do it but the points ID order change even after sorting them… Tried a second method but the mapping (move geometry from a to b of parts keeps just going wrong!

Can you help please?

Explode from Center.gh (46.5 KB)

I drew arrows how they should move away from the center…

I could do this individually per block but feels like bad practice to do in GH… Do i have to create normals to the block’s plane (seems over kill again)… Thanks for enlightening this rusty geometric brain!

Something like this?

2022-04-06 20-30-50.2022-04-06 20_32_23

Explode from Center rev.gh (34.9 KB)



Thanks Diff!

how in the hell does this work at all?

Simple math. :wink:

The Volume component returns a center point for each of your 4 breps. When you average them, you get a center point for the points. By subtracting if from the four center points of the breps, you get four vectors pointing from it to the brep center points. You want to normalize these vectors so that they have a magnitude of 1.0 and that you can then scale them to a desired length by multiplication. The vectors can then be used as transforms to move the breps. That’s it.

GH is awesome!

I had a A+ in geometry 40 years ago… really feeling stupid!

A lot of the solutions we see in GH are just so simple, yet we try to do it simply, it goes amess, defying logic…

Normals… back to basics! Thanks Diff-arch!

Like normals are simple right?

I used to be very, very bad at maths. Now I’m at least decent at computational geometry and maybe trigonometry, even matrices probably.

In my opinion that’s because beginners often try to start with something complex to do something even more complex, without even realizing it.
Oftentimes it is key to start small and simple, with a point, a vector, a plane, a line, or a polyline, before tackling the complex stuff like curves, meshes, and surface.

Above I wasn’t talking about normals to a surface or mesh face. A normalized vector is simply a three-dimensional vector of magnitude 1.0 in your example. It isn’t perpendicular to anything relevant here.

Why doesn’t it work here?

[center test.gh|attachment]

(upload://qkket9d7P7JxKCV56Wel87mCA5o.gh) (13.6 KB)

Figured it out