Stop Scale factor on point intersection

Dear my friends
I’ve created circles and a rectangle.
I can control the dimension of the rectangle too.

when I change scale factor I want to stop it when the points intersect to the rectangle.

STOP Scale on points.gh (9.8 KB)

please download attach files.
when I want to increase and decrease the amount of scale factor and amount of rectangle I want automatically stop it on point intersection between points and rectangle.
how can i do it?

ok so here’s what i got from your description, which is half working (only every other stop - because of the exponential nature of scale):
STOP Scale on points_re.gh (12.5 KB)


now ditch that and…

…here’s what i suggest you examine & works much better:
STOP Scale on points_re_re.gh (12.1 KB)

Dear Amir
Thank you for your reply

but its not algorithm that i want.

1st: i want to set a rectangle with custom size that i want with no change in dimension of circles and distance between theme. (please do not change rectangle base)
STOP Scale on points rev1.gh (8.3 KB)

2nd : i want to SCALE circles until they (points) connect to the rectangles.

I can do this with hand but i want to sure the connection occured correctly.
for example:
in this picture you see we have created a rectangle with this size : x=600 y=200
now i want to change the scales.
I want to have a stop when the points intersect to the top and right side of rectangular.
like this:

but I do not want to stop on this situation.

I can bake it and do it with rhino snap function but I want to do it with parametric algorithm.

I am waiting for an answer.
is there any way?

I’m still not completely clear on what you are trying to do. Is it something like this? This only snaps to scale to the top line of the rectangle, as you have shown.

STOP Scale on points rev2.gh (14.6 KB)

Thank you very much for your reply
but i got error as you see bellow.
ERROR%20M

please help me to solve it.
i installed GHPYTHON but still have an error.

It’s probably because I’m using Rhino 6 and the latest GH. I will see if I can make it compatible when I get back to my computer.

1 Like

STOP Scale on points rev3.gh (20.0 KB)

updated your script to snap to top & right of rectangle. i exchanged multiplications for expressions so it’s compatible to RH5. @tube did you at least work on the problem while you were waiting for a solution?

2 Likes

Dear Amir
Thank you very very much for your help.
I work on problem and I am learning GHPYTHON.
Thank you again.