Data Path component gives wrong path

Data Path.gh (13.1 KB)

They are not tree branch path (because tree has 71 branches, but they are only up to 28), they are not item index, then what are they? What do they try to tell?

my guess the data path parameter is doing some crazy casting from the Type Point3d to Type GH_Path that does not make sense at all.

Use Tree Statistics instead !

Construct Path is converting a List of indices into a GH_Path
Deconstruct Path is doing the reverse.

see above example where the 3 points get casted to paths without any sense at all…
11,111,1111 becomes 1117

Data Path_02_tp.gh (14.6 KB)

EDIT: I fixed some formating issues with <kbd>....</kbd>

It took me a while to spot the pattern.

Data Path_02_tp_re.gh (10.5 KB)

Inputting a point to the Data Path component is producing a single element path that equals the distance of the point from world origin rounded to zero decimal places.

Here’s a couple of test files that I used trying to figure this out.

240217a_Data_Path.gh (8.7 KB)

240217b_Data_Path.gh (7.7 KB)

-Kevin

4 Likes

Thank you all!
I changed the title to bug report.

well, to be honest I won’t consider casting stuff as other stuff as a structural functionality in GH, but something that “might work in certain cases”

in this case, Data Path parameter is a container for Data Paths, but I wouldn’t expect it to take whatever input and return its path like Path output of theTree Stat component does?

so what do you expect ?
how to cast for example a
Point3d x=12.34, y=45.67, z=980.76
to a GHPath ?

Maybe the component should just fail.

1 Like

I expect it can return path of an object in data tree structure.

that s the functionality of Tree Statistics

the basic parameter components will just cast to other types.

I just noticed they share exactly the same icon, not saying that they should show same function, maybe Data Path is only for data relaying.

usually Parameters are indeed “just” collectors of data of a certain type

then it might work that you can cast things from one type directly to another type, for instance you can cast Curves as Surfaces, and if they are closed an planar then you will see a surface appear

same thing for Surface / Brep as Meshes, not working for Polylines as Points…

casting is just a way to “try to translate” something into something else directly

so, when you make the example of Data Path Parameter, that is a containere of data of the type “Data Paths”

if you plug there a data-tree of meshes, the subject of the casting is not the data tree of the meshes, but the matter which is contained: it will try to cast each meash as a Data Path, which will result into something extremely weird :slight_smile:

the reason why Data Path Parameter looked like it was producing something odd with Points, is because when you plug a Point into a Number component, it tells you the distance of that point from 0,0,0, you can also interpret that as the length of the vector from 0,0,0 to that point

similarly, Data Path parameter works with integers, so you can see it in action translating points to integers, then adding curly brackets

that’s the reason why I wouldn’t expect Data Path Parameter to output info about the data tree: the data tree itself is not the “thing” that is being cast to a different type

4 Likes

I think every item in the data tree has its own path and index, which is the item’s address.
I expected Data Path would strip off that “address” information and return, how simple and wonderful would that be, but no :joy:
I remove bug report from the title. guess that is not bug.