Grasshopper

algorithmic modeling for Rhino

Hey Guys.

Having a spot of trouble trying to manipulate some trees. I've tried googling every conceivable combination of relevant keywords and come up empty! 

I'm trying to remap paths like so that these:

{0;0;0}(4)

{0;0;1}(4)

...

{0;0;8}(4)

{0;0;9}(4)

{0;1;0}(4)

{0;1;1}(4)

{0;1;2}(4)

{0;1;3}(4)

...

...

...

{5;3;8}(4)

{5;3;9}(4)

Become:

{0;0}(4)

{0;1}(4)

{0;3}(4)

...

{0;9}(4)

{1;0}(4)

{1;1}(4)

...

...

...

{23;9}(4)

If anyone could help, that would be amazing. I've spent hours fiddling and not getting anywhere with the path mapper.

Thanks! :]

Views: 559

Replies to This Discussion

Can you explain the logic between the input and desired output? Because I can't see it from looking at this example.

Hey David, thanks for the reply!

I'm using Bumblebee to get this data into Excel, and it seems pretty strict about the structuring. It needs to be formatted as  {SheetID ; Column} (RowData)

I have a 2D grid of panels, which have a grid of bricks nested in them. These bricks have rotational values that I'm trying to put into excel. 

So the structure is currently: {Panel Column ; Panel-Row ; Brick-Column}(Brick-Row[rotation])

I want to replace the two values for the panel row and column with a single ID which will also form the sheet ID, like so: {Panel[Sheet]ID; Brick-Column}(Brick-Row[Rotation])

I hope that makes sense. I'd post pictures but my definition is incredibly messy! 

In scenarios like these I use metahopper's "wrap" and "unwrap" to perform tree operations. This works just like grasshopper "Group/Ungroup" except  it can handle non-geometric data.
It's a little long-winded but I don't know how do this in a more elegant way. I don't *think* it can be done in one shot with the path mapper, and the only fully-native GH way to do it I can think of is even weirder:
if anyone else has suggestions I'd love to see them. this kind of thing comes up a fair bit, it's a major reason why I wrote metahopper! 

Well, it may not be elegant but it certainly did the trick! Thanks a lot for your help! 

EDIT: I downloaded your plugin - it's great!

Inspired by your question, I wrote improved versions of Unwrap and Wrap - these components take a "Level" designation so you can wrap/unwrap to arbitrary levels of nesting. That makes the case you describe even easier to solve - just two components instead of 6!

Attachments:

That's excellent! Everything was a relative breeze after this! 

Thanks again!

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