Ordering data back to original two branches

I’m trying to script ‘a rebranching “back to the original two branch structure,” ’ I tried some ways but it is difficult for me and none of my trials worked.

Do you might know how I can rebranch the resulted items back to the original two branches?

Later on, I am going to work with more than two branches, but for now, I have to understand this problem first.

Thanks in advance for your response.

20181113 problem rebranch 00.gh (25.0 KB)

Uhmm, it has to do something with ‘replace,’ but I do not know how to replace the ‘zero’s’ with the ‘cuts’ for the first curve.

I’m not really following.

Does this accomplish what you are trying to do?

Thank you Rickson,

In response to your question, I am going to work with more branches, so exploding the tree is not an option for me.

I need to let the starting branches all through the same process and end up with shattered curves sorted to the original branches. So, I start with 3 branches and need to end up with 3 branches including all the shattered curves; 4 branches resulting in 4 branches with shattered curves; and so on.

how about this?

20181113 problem rebranch 00_re.gh (24.6 KB)

1 Like

Unfortunately, in my case I am not able to implement it correctly. Not all the curves are shattered.

Do you might know what I am doing wrong?

20181113 problem rebranch 01.gh (37.2 KB)

I think I understand it now. Thank you for the guidelines.

Uhm… I still cannot solve it in other situations.

Do you might know what I am doing wrong?
Or does somebody else might know that?

20181113 problem rebranch 02.gh (42.5 KB)

Trying it for two hours and then just doing it in a minute…

1 Like

I would not try to solve this with datatrees, but a very simple closest point query will make your life a lot easier.

If this had to scale “bigly” (e.g. 10k+ curves), I would use scripting/RTree’s to solve this problem. (Or just wait a bit).

20181113 problem rebranch AVW.gh

1 Like

Thank you, hmmm, I am not able to implement it correctly.
It does not work in my case.

Do you might know, with the example you gave me, how to implement it correclty?

My weapon of choice.

20181113 problem rebranch 02_requires Elefront.gh (28.1 KB)

Requires elefront.

1 Like

@ForestOwl What’s the problem?

1 Like

It cuts where it not has to cut. The separate grids cuts each other somehow.

Thank you. Sorry, my posts are a little bit confusing. Uhmm, what I tried to achieve is to make more than two grids.
Is this script meant to work for that?

Yep. It shouldn’t cut in other planes.

1 Like

Okay. Hmm, it cuts in other ‘grids/planes.’
I don’t know what I am doing wrong.

Yup, all dependent on attribute filtering to create branches/relationships.

Context of the entire workflow is preferred, to avoid confusion and redundancy.

You will notice a error. There are two grid linear lines that should be in the Boundary. Use the elefront match properties on those to match their respective attributes.

The Elefront process allows for manual editing on occasion :slight_smile:

Preferably that attribute would be assigned earlier in the process, avoiding the dispatch.

1 Like

Can you show an image of what shows that? The planes are very close together, so a top view is not so easy to spot problems.

Now that I think of it, check your units in rhino (units command), and the absolute tolerance to something like 1/1000th of the smallest curve your have. I was using a absolute tolerance of 0.001 for this solution.