M7 WIP Brep.Split bugs

I have a C# Grasshopper component that has code that splits one brep with four others.

The code is:

Brep[] splitters = new Brep[] { outrWndTrim, outrMidTrim, innrMidTrim, innrWndTrim };
Brep[] surfs = uppr.Split(splitters, t);

In Rhino 6 the surfs array has 5 breps in it.

In Work In Progress (7.0.20238.17095, 8/25/2020) the C# component Split call returns 6 breps and surfs[0] is null.

I tried to create a grasshopper file with a C# script node to illustrate the problem. It has a third, different, behavior. I assigned surfs to A and got three values (null, trimmed surface, trimmed surface)

What’s going on?!?

I have included the Grasshopper file.

m7brepsplitbug.gh (603.5 KB)

Currently experiencing the same issue with the main components that power my major script now broken.

Hey @jmcauley, @christopher.ho,

Let me know if this works any better.

test_brep_split.gh (232.5 KB)

– Dale

1 Like

That’s what I ended up doing in my gh_components.
Was wondering if the clean part could be done as part of the split function.

It will be in SR 7.5…


1 Like

Thanks Dale.

Its a slightly inefficient but general work around.

I considered it but, surprisingly, there are only about five places in my code where I used Split so I just hacked my indexes to get what I wanted.

I’m prepared to take the hit and alter my code again when the Split method is fixed.

Now that I think about it… I could have written a method that did your hack internally. Then, when the fix was made I could delete the method then fix each location where the compiler flags an error. It would have been quicker.

But no matter, I’m glad the bug is being addressed.