Grasshopper

algorithmic modeling for Rhino

Morning!

Context

I'm conducting a view study, and attempting to map the percent of available views back onto panels on a buildings surface. I'm using LadyBug's View Rose component to do this.

Problem

When mapping a spectrum of colors back onto surfaces, I'm getting an identical gradient on every surface rather than a unique color that corresponds to the surface. Additionally, if I explode the meshes to grab the face of it, the gradient mapped onto the resulting mesh is different. (See attached screenshots)

Acknowledgment

I realize this stems from a my failure to understand rather fundamental GHop data management issues, and would love to actually understand what is going on here.

Thanks!

Views: 2123

Attachments:

Replies to This Discussion

If you upload your grasshopper file (with associated Rhino file, or internalized data) then we can take a closer look.

Thanks for the reply, Brian. I've uploaded the Gh file.

Hi Weston, unfortunately my GH crashes when loading your file...

BUT!

I took another look and I think it's just a simple list management issue like you suspected.

Here is what is currently happening:

And this is what you want (I think):

The only difference here is I have grafted the inputs to the Mesh Color component. When you first start dealing with grafting/data trees/branches it can seem kind of tricky, but it's not too bad once you get the hang of it.

In this case, you have a list of objects, and a list of colors. You know that you want mesh 1 to match up with color 1, mesh 2 with color 2, etc.

But GH doesn't necessarily know this. In general, if you have two lists and they both have exactly the same number of items, and they are both in a flat list, things will work out.

If that's not the case, you can use the graft component (or right click and input or output and select graft). It will take each individual item in the list and give it it's own "Path." It's basically an ID that usually looks something like {0} or {0;0;0} or similar.

So you graft the first list of 5 meshes, and mesh #1 now has an ID of {0}, mesh #2 has an ID of {1} and so on.

Then you graft the color list. Color #1 has an ID of {0}, color #2 has {1} and so on.

Now when those two lists go into the Mesh Color component, it knows exactly which meshes should go with which color.

I think what was happening in my first photo (which is similar to what is happening to you) is that the Mesh Color component sees 5 meshes (that each have some number of faces (triangles), lets say 12. And it sees 5 colors. It looks to me that it thinks we want to have all 5 colors apply to each mesh, so it says - Mesh #1 face 1 of 12, you get color 1. Mesh #1 face 2 of 12, you get color 2. etc. and it does this for each mesh cube. 

This explanation is all a bit simplified but hopefully it helps.

Best,

Brian

Hi Brian,

Sorry to hear that my file kept crashing your Grasshopper. This was indeed a simple list management issue, your explanation was super helpful, and I got it to work out. I appreciate you taking the time to give me some background - next time around, I'll have a much better understanding!

Thanks!

Where is the file that was crashing? I'd like to try it.

Hi David,

I tried reopening it and realized that it wasn't a crash, just a long unresponsive hang. After letting it sit for awhile it finally loaded. It looks like a Lady Bug component called "View Rose" took 2 minutes to compute with the supplied internalized geometry being fed to it.

Edit: I would upload the file here, but it looks like weston removed it from his post and I don't want to post it again if he wants it private for some reason. 

Fair enough. If it's a plug-in causing a long computation time I don't particularly care any more :)

Hi Brian and David,

As Brian guessed, I took the file down because I wanted parts of the context to be private. I felt like the example he posted will do a great job of helping anyone else with this question, and my example isn't needed to help illustrate. Hope that's okay.

Thanks again for the help!

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