Simplify option needs to get universal

OK,

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 !

6 Likes

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.

Yes pleaaaase !
:slight_smile:
Gimme gimme gimme a component after midnight :notes:
Won’t someone help me chase the grafting away ? :notes:

One question, if a tree contains a single path, what should happen in the following cases:

  1. multiple zeroes: \{0;0;0\} \rightarrow \{0\}
  2. a single non-zero: \{0;3;0\} \rightarrow \{3\}
  3. multiple non-zeroes: \{0;3;2\} \rightarrow \{3;2\}

Basically, the rule in GH2 I came up with is “remove all zeroes, but if you end up with an empty path, add one zero back in”. Is that satisfactory?

1 Like

This works for me, as it just cancels the graft when I don’t want it AND also works for a single path :

I would go for something siple like that, and let the user do his own custom path mapping in freaky cases like the ones you mention.

I’d prefer to keep the behaviour the same as it would be in GH2 then.

Ugh… My magic bullet doesn’t work because the graft component adds a root instead of a branch.
Pulling my hair out at this point…

I WANT this little blue Intrauterine device !!!

You’ll have to wait until the next Rhino6 release. Usually Tuesdays if you are on the Service Release Candidate schedule.

OK, great ! For the name, I vote for “Sensical Simplify”… oh, wait…
In the mean time, I figured that I can use this for components like Graft :

I called it Suirify. Logged under RH-48257.

9 Likes

Genius

Oh, I finally know why it is called this name.In our Chinese, David is really 皮(PI=playful).

2 Likes

Here’s a dynamic component that can simplify to X depth of paths.

The name comes from two clusters I’ve been using a lot:
image

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;

also attached gh file
abx.gh (16.7 KB)

3 Likes