Tree Structure handling in Brep Closest point

Hi,

I’m trying to find the normal vector at a given coordinate of a brep entity. For that, I’m using Brep CP (Closest Pont). The following lists feed this component:

List of surfaces (breps):

List of coordinates:

However, when I input them into Brep CP, the output is not correct and it is because of tree structure, even though I force the list of surfaces to match that of the list of coordinates.

For quality control, I perform this calculation individually by branching the {A,B,C} tree indexes that go into Brep CP and it works perfectly, which proves the problem is not with an incorrect definition of the list of surfaces or the list of coordinates. For clarification {A;B;C} reflect A=brep ID, B=cross section, C=point list.

Brep Closest Point - Tree Structure Problem.3dm (137.3 KB)
Brep Closest Point - Tree Structure Problem.gh (30.5 KB)

Try this:


Brep Closest Point - Tree Structure Problem Solution.gh (41.3 KB)

1 Like

Yes! This totally worked, specially after your last edit. I don’t think I could have reached the solution by myself. Thanks for that!

One last question: what if I would like to preserve the original “empty” branches/indexes coming from the CCX component (coordinate points list/tree)?

Edit: Also, if you could explain what does -3 as index does to List Item, it would be appreciated!

The -3 index means “third from the end”. I used this rather than a positive index in case the input ever needed a deeper branch structure.

1 Like

To keep the empty branches, you can probably just omit the Clean Tree component. I think it became unnecessary when I added the Match.

1 Like