Closest point alignment issue

Hello forum.
I’m trying to configure it so that the squares are all ‘aligned’ with the closest point ‘point’…as shown in the image.
Can someone assist?
Kind regards,

Square1.3dm (42.5 KB) (25.5 KB)

Your image at the lower right is too small. Do this (white group): (28.1 KB)

But don’t do this! Not the “Grasshopper Way”.

1 Like

This (version ‘b’) is a simplified version of what you did. The big red “NO!!!” group is also somewhat simplified by 1) re-using a single -Z vector instead of creating it multiple times and 2) eliminating the Graft Tree components and redundant Curve components. All this was done by code inspection alone, without changing the logic and results.

I am certain the “NO!!!” group can be drastically simplified further by applying more “advanced” GH techniques but haven’t gone that far yet. (23.8 KB)

1 Like

Before I forget, Closest Point was never necessary or appropriate for this problem, It disappeared in version ‘b’ above.

Version ‘c’ (below) replaces that big red “NO!!! ” group with the “Grasshopper Way”. (cyan group) Note the ‘Length’ slider (set to ‘4’) that controls the number of scaled rectangles.

In the process, I inadvertently fixed an error in your code, though it took me awhile to understand it. I scaled all my rectangles before moving them down while you were moving them first and then scaling with the offset center point, which was no longer in the same plane, so Scale was stretching them vertically. OOPS! (25.1 KB)

1 Like

Hello there @Joseph_Oster Joseph
Thank you for your input. Great stuff with the ‘No’
As an extra tweak, can the main squares’ positions be left…but the inner squares’ positions be adjusted?
Currently, when the ‘dot’ [point] is moved across the squares…the inner squares move in lines not individually.
Kind regards,

Whatever that means, I’m sure it can. But you’ll have to clarify your goal? Preferably with some GH code of your own. (using what I have posted in version ‘c’)

If I had an hour to solve a problem and my life depended on the solution, I would spend the first 55 minutes determining the proper question to ask, for once I know the proper question, I could solve the problem in less than five minutes.

– Albert Einstein

1 Like

I’m not trying to guess the intent of your “extra tweak” (I won’t do that), but this yellow group adds a little food for thought, eh? It brings back the “Closest point alignment issue” of the thread by having random yellow attractor points around the circle with each square aligned to the closest point. (29.5 KB)

Thanks for your help with this @Joseph_Oster
I attempted to create a file last night using your example…but the code is complicated for me to understand now and I’m out of my comfort zone.
I would like the out sqaures to be in rows and columns (as in the image).
I’m hoping the image also shows how I would like the inner sqaures to orientate - re: in alignment with the closest point ‘dot’.
I’ve tried to show this for an idiviidual sqaure (see image).
Kind regards,

If you don’t understand what I’ve done then I see no point in doing any more. Besides, you haven’t clarified your “extra tweak” at all, as far as I’m concerned.

My friend, I had a go at your definition because it intrigued me a bit.
My guess is that there is a small miscomunication:
first of all, we are not talking about a ‘closest point’ but an ‘orientation point’
second, I think that what you asked for was already done by @Joseph_Oster (who becomes a little rude at times but he’s a good guy and very helpfull) but you didn’t understand it:
the centers of the squares form lines that are oriented towards the orentation point but it is not perceivable because the corners of the squares form much more pronounced lines (see image 2)
If you were thinking of creating lines towards the point with the corners of the squares that would again not work visualy because the lines from the other three corners of each ‘nest’ would hide it.
from a design point of view I would advice you to go for a different shape (probably circles) as they would not hide the orientation of ‘movement’. (18.1 KB)

Thank you for trying @Joseph_Oster and thank you for your time.
BTW, the ‘tweak’ was my original request - to align the inner squares.
Kind regard,

Hello there @anikolo
The code is perfect.
I’ll take the evening to study how it was done.
Thank you for your intrigue.
Kind regards,

BTW, in oak…
@anikolo and @Joseph_Oster