Grasshopper

algorithmic modeling for Rhino

i am currently stuck on a logical problem in a study that i'm working on. i have a bunch of rectangles, populated on a surface and they mostly have different sizes. what i'm trying to do is to calculate the distance between two points on these rectangles, and scale them according to the distance between these two points. so in the end i want to achieve a result which is like "if the distance is closer than others, scale that rectangle with a smaller numeric value, and while the distance getting bigger (more far) scale that rectangle with a bigger numeric value." 

i have created all the necessery things about calculating the two points on rectangles which will be my referring data in scaling, but i'm stuck on the creation of inverse logic in scaling factor. 

to re-sum my problem again (as i defined it in a complicated way); i have rectangles,for example if the distance between two opposite points on a rectangle is 4cm, it will be scaled with 2. if the distance is 3, it will be scaled with 1, and if the distance is 2, the rectangle will be scaled with 0,5. (numbers are just to explain my idea, values are not important.)

i guess i need a domain, and somehow i need to cross bound my domain and the list which includes the data of the distances in inverse way than use them as scale factors.

any ideas?

PS: i can add the definition or images of my situation, but the values or the definition that i 'm working on is not so important, in my opinion if i understand the logic, we can solve it. i can add them if you need these files while helping me to solve this problem.

Views: 2120

Replies to This Discussion

I think your problem is about remapping the distances. 

Attachments:

thank you for your reply. i tried your definition, and you may be right, remapping distances may solve my problem. but when i try to use my modified new scale factors through remapped distances, it tries to scale the total amount of items out of each item, so it results a mass. how can i use this remapped scale factors to scale each rectangle with a factor to corresponding ratio, so that every rectangle will be scaled once. do you have any further ideas for that?

Hi Ibrahim,

Jesus will probably help you, but just maybe this will too.
Is there any specific amount of distance values related to your rectangles?
Here is an example of the ones you mentioned (4,3,2cm):

Attachments:

thank you, the definition that you've sent is fulfilling the function that i'm trying to achieve, but what i'm really trying to do is the automate the calculation phase according to the input, so that i won't need to put values to define the result. but your definition definitely will help me to understand the logic of the progress. now i'm working on it, i'll let you know the results.

Hi djordje, 

I thought I could do a discontinuous remapping using the remap component, but it doesn't seem to work. Any thoughts on why it's not working?

Attachments:

Hey my friend,

I can not open your file, you are using newer version than I am.
Although I doubt I could help you, your knowledge seems to surpasses mine.


Maybe you can post a screenshot?

This sounds more like a List problem.

Graft/flatten

Amount of rectanlges/amount of scalefactors

...

Can you post a defenition or picture?

i'm posting the definition that i'm working on. what i'm trying to do is creatin a sunshading system to a façade via image sampler, and when i created the system, i wanted to  have a more curvilinear flow between the offsetted and narrow pieces. so i thought i can scale them in one axis in a sequential way so that it would seem more like a sea wave, rather than a ugly perpendicular extrusion :) 

Attachments:

Dedackelzucht is right, it's a list problem. If your using my definition you have to flatten the scaling ratios. Then you can input them into the Scale component. And be sure to use the Polygon center or another point unique to each rectangle as the Center of Scaling. 

Sometimes it also helps one to define as rigorously as possible the problem. My definition uses a continuous mapping, whereas Djordje definition uses a discontinuous mapping.

ok, gonna work on that now and tell the results. thank you.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service