Grasshopper

algorithmic modeling for Rhino

HI fellows,

I agree that the concept of Null Item is very very useful ,but i cant see the same thing for Empty Branch.

I am confused when and why an empty branch appears? and I even doubt it is a necessary for Empety Branch??For example, I have a list of 59 line-like curve and 12 breps. I use the BCX component to show the intersection conditions .What I expect is, if they intersect somewhere, point(s) is dectected, if not ,a null item appears.But now empety branch appears.Then I found it's much harder to handle these empty branches than null items.For short, see picture below:

what I expect here is: {0;0;0},{0;0;1},{0;0;2},and otner empty branches contains one null item each..And I cant insert a null into an empty branch..So my wish this time is Empty Branch would be canceled or at lest reconsidered..what do you think??hope someone can help me out~

Views: 865

Replies to This Discussion

Hi Alpha,

yes, it is indeed quite difficult to handle empty branches, but I think their existence is necessary. When you intersect a line with a brep, and they don't intersect, I wouldn't expect a null item, I'd expect an empty list. It's not that an intersection failed, but there were no intersections.

You can use a Clean component to remove empty branches, going the other way is much harder.

There probably should be more components to modify and 'repair' data trees. And there probably should be more matching algorithms that make it easier to work on two distinct but partially overlapping trees.

I don't really have any answers. If you're often running into a specific problem then I can write a component that solves that particular issue, but I haven't been able to figure out a catch-all solution for this so far.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David,

Thanks for the reply .I agree with you that not all things fit all persons .But this time I cant use the cleaning-branches way ,for these empty/null things are important and meaningful .

When you intersect a line with a brep, and they don't intersect, I wouldn't expect a null item, I'd expect an empty list.

On the condition of these words, if I donot insist an empty list/item, how could I achieve my goal? What I intend to do in mind is :
1.After the BCX, I got 708(12*59) paths.
2.Then I can use PathMapper to modify the data tree to 59 paths .
3.The 59 paths will show me whether and where lines intersect breps .Each path contains nulls and/or points(the total number of null items and points should be 12 ). I use IsNull and GateAnd to generate a new data trees .The new trees contains 59 branchs and each branch contains a boolean value.
4.After that,I flatten the tree and transform booleans to 0&1s by using a integer param.
5.At last I can use there integers to do some counting by using MassAddition.

Now,howerer,the PathMapper would wipe out empty branches and I donot like that.So I tries to insert null items to these empty branches and transform them to be normal paths ,with no luck. I am awaiting for your advice.Thanks.
Hi David,could you explain sth on the following picture??Thanks~~

Only the BCX component give out empty branches and the other intersection component would give null instead .
Well, this is clearly wrong since it's inconsistent. I know why this is happening and I can make it more consistent, but I'm not going to touch the code until I have a good solution for this particular problem (it's a tough one :)

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David, thanks for let know you would modify the inner code sometime .

I have found a way inserting null items into branches(empty or not) .I failed because I tried to insert null at index 0 instead of other places last night .Now I am kind of confused why I cant insert items at index 0??

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