Grasshopper

algorithmic modeling for Rhino

Does anyone know how to rotate a floorplan to the best position based off a series of points in galapagos?

                                                                                  Thanks,

                                                                                      Kory

Views: 2658

Attachments:

Replies to This Discussion

Please define "best".

--

David Rutten

david@mcneel.com

Poprad, Slovakia

We are trying to orient our floorplans according to specific views.  So we would like to set up a series of points (monuments, buildings, etc.) and have our floor plans orientation be adjusted to the best possible view of these points. 

Hey Kory, here is my answer from the little I understood...

You should first define what "best possible view" means in a quantitative and/or parametric way. For example if point 1 (the upper most) has a coefficient of 1 in a scale from 0-1, and the rest have a coefficient of 0, it's clear that the floor plan should be orientated in the direction of point 1.

So basically what you have is coefficients and directions (vectors): give each point a coefficient, and multiply it by its vector, and then add all the vectors together. You don't need Galapagos at all. 

If what your aim is something else, please clarify it. 

What I meant was, if I have two different floor plate layouts, can you give me an algorithm that tells me which one is better and which one is worse? Galapagos needs something more specific than "best possible view". It needs a single number that conveys the goodness of a specific view.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

How do we input a single number like you are talking about?  We would like, just say, the center point of a particular side to be the view point, and then let that point be oriented in a position such that that particular side has the best views of a particular series of attractions.  I tried to sketch this below to show you what we mean.  

I am not sure how exactly to give a side a  number value like you said?

Let's take a step back and talk about comparisons. Unless you're dealing with fuzzy or quantum logic, a comparison is a boolean operation. A is either worse than B, better than B, or indistinguishable from B. As a simple example, let's say we're comparing numbers and we're looking for high numbers. If A=3.5 and B=6.1 then B is obviously better than A. So far so good.

 

Now let's say that A and B are in fact not just one number, but two numbers. So A={3.5, 8.2} and B={6.1, 0.7}. Which is better, A or B? The correct answer is "I don't know". More information is needed to make the evaluation. Here are some more complicated rules that could be used for comparing A to B:

  1. If all numbers in A are higher than all numbers in B, A is better. If all numbers in A are lower than all numbers in B, B is better. Otherwise A and B are indistinguishable.
  2. Only compare the highest number in A to the highest number in B.
  3. Only compare the lowest number in A to the lowest number in B.
  4. Compare the average of all numbers in A to the average of all numbers in B.
  5. Compare the sum of all numbers in A to the sum of all numbers in B.
  6. Compare the product of all numbers in A to the product of all numbers in B.
  7. Compare the first number in A to the first number in B. Then compare the second number in A to the second number in B etc. etc. Afterwards whoever has won the most partial comparisons, wins the war.

 

I could go on but you get the point. If you're comparing more than individual numbers, you have to supply a rule (or algorithm) that defines what "better", "worse" and "indistinguishable" mean.

 

So let's try and apply this to your problem of view directions. You have a space with a window and you want to maximize the number of landmarks visible from the window because then you'll be able to sell the space for a higher price right? Now it matters of course where in the room the viewer is standing as that gives you a cone of vision:

However we should probably assume that we're trying to optimize the orientation for the average of all positions. This means that landmarks directly in front of the window should have higher value because they will be visible from more locations inside the room.

This then gives you a value-map where you can convert view-angles to comparable numbers:

 

The image above shows how the position of a landmark affects the ultimate fitness of the orientation. I've used a linear falloff, but perhaps in your case you want a different function. Landmarks that are near the central view-axis will have a fitness contribution of 1, landmarks that are on the edge of visibility have a fitness contribution of 0.

 

It's also possible to assign individual weights to landmarks. Perhaps being able to see E is better than being able to see both A and B. If you want individual weight per landmark, you'll have to multiply those weights by the view factor contribution:

 

 

So now we have all the information to compute the ultimate fitness value (a single number remember!) for a specific orientation. It will be the sum-total of all landmark weights multiplied by all view factors:

 

F = VA×WA + VB×WB + ... + VZ×WZ

Where F is the fitness value, V? is the view factor and W? is the weight.

That, at any rate, is the theory. To translate it into GH speak, you'll probably need a [Vector Angle] component for measuring landmark angles. An [Expression] or [Remap Domain] component for translating angles into view-factors. A multiply component to combine your view-factors with your landmark-weights and a [Mass Addition] component to put it all together.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I understand the theory behind it and what the logic is, but now we are having trouble translating that into grasshopper. How do we assign a "weight" to a specific point?

By having a list of numbers, one for each landmark point (see attached)

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

Oh, the file won't open correctly because of the panel, you'll have to manually add one or specify some other set of 9 numbers instead.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Instead of using a slider to specify (and optimize) a single rotation angle, you could also generate a bunch of angles at the same time and graph the fitness results. Here I created 500 angles between 0.0 and 2*pi.

You can see that the fitness landscape has two peaks with the current weight and locations of landmarks, one ever so slightly higher than the other.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Awesome, much appreciated that makes perfect sense and is exactly what we were looking for.

Ill be sure to send you some of the final work when we are done and show you the progress we have made with Galapagos with your help.

Thanks again


Surge and Kory 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service