Let’s quit joking.
I get why some components will graft the output, but the simplify option is there to prevent that when the grafting is not desired.
Then it should also work when the input tree has a single path, period.
I don’t care about the futile philosophical reasons ; I just see that it makes a complete mess of my definitions, and requires silly workarounds all over the place !
It’s not a philosophical objection at this point, it’s a cannot-break-existing-file-behaviour objection. Grasshopper 2 has a better simplify algorithm, but the best I can do in GH1 is give you a component which simplifies the way you want.
The name comes from two clusters I’ve been using a lot:
here’s the code for the c# script component
DataTree<object> newTree = new DataTree<object>();
_data.SimplifyPaths();
var y = _data.Paths;
if (pathCount < 1)
{
pathCount = 1;
}
for (int i = 0; i < _data.BranchCount; i++)
{
GH_Path oldPath = _data.Paths[i];
GH_Path p = new GH_Path(oldPath.Indices.Take(pathCount).ToArray());
newTree.AddRange(_data.Branches[i], p);
}
data = newTree;