algorithmic modeling for Rhino
Hi All.
With the new changes to data matching in gh0.9, I'm wondering if others feel that paths should be retained when a component with two inputs has a simple input matching a tree. I've attached an example of string concat. Note my paths as input have an offset first path, which is lost (unless I add a new data matching component). You can add a lot of these components for a project I've been studying so I'd vote for an adjustment of the present behaviour.
As an associated task, we needed to have a data tree comprising a string of the path with matching paths. Only solution I came up with was a script component. Is there a way to do so without doing this?
Thanks in advance,
Jon
Tags:
Hi Jon,
I have also posted a similar wish/question on data tree management in this discussion. I was looking into "from scratch" definition of branches rather than a dynamic/parametric approach like yours, which would actually cover my end of the story too.
The behavior on the first example indeed seems bizarre.
+1 for that.
Best,
M.
I agree that the behavior in the first concat component seems a bit odd; I would expect it to preserve the tree data. What makes it even stranger is that if you flip your A and B inputs, it DOES preserve the paths, leading me to believe this is some kind of bug.
I'd also like to point you toward my "tree frog" path tools (rename pending) which might aid in this situation. In particular, given the two non-matching path structures you have (0-10) and (11-20), you can use the "Match Paths" component to coerce the one to follow the structure of the other. In general you can also use "Assign paths" to assign an arbitrary, user-generated path structure to any set of data.
There is also a component in the same toolset which does something very similar to your script, with the added functionality of producing a copy of each path for each data item (so a tree with four items in a particular branch would get 4 identical copies of that branch path in the output.) Not sure if that's useful to you (especially since you've already written the script you wanted), but maybe it is.
If you wanted to accomplish all the same with native components, I believe it is possible but a little clunky. See attached for a native example.
...leading me to believe this is some kind of bug.
Actually no, it is working the way I designed it to work, so it's an arguable design flaw rather than a bug. The concatenate component is provided with two data trees, a small one containing only a single branch {0} and a larger one containing 10 branches {10} -> {19}. The output data of a component depends almost exclusively on the determination of the master parameter. The master parameter is considered to be the guiding light when it comes to cooking up output data tree paths. This master parameter is determined as follows (at least under the current logic):
Changing the selection of MPs is a dangerous business as it may very well break existing files that rely on a specific data tree layout. That being said, if a significantly better algorithm is proposed I'm happy to make this change. Do note that the algorithm cannot depend on the number of branches in a data tree. This is how it used to work and it resulted in some very unpredictable behaviour as the number of branches often depends on specific inputs and can therefore easily change when -say- a slider is dragged. The detection of MPs should be stable enough to not depend on something as volatile as that.
A possible (non-breaking) change that could fix these issues is to add GUI for manually picking master parameters. This is however a very (very) expert user level feature so it would be nice if we could improve the default behaviour first.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
It's actually not a bad idea to special case {0} paths, though even that might cause sudden discontinuities in certain cases. I'll fiddle around with it, see if it solves more than it breaks.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by