algorithmic modeling for Rhino
Hey guys, I wanna share you my research about the type of data from PANEL component. For some Chinese who have read my tutorial file 《Grasshopper完全学习手册》may be familiar with this image:
From this I gave an inequation which I didn’t give a proof that time. My guess was that the type of the data was not “integer” but was “string”. Luckily, the inputs of many components in Grasshopper could automatically convert the type “string” into “integer” or “float”. However the Item Index cannot. I tried to proved this with Python and got a proof.
As you can see now, the type from Panel is always “str” which stands for string. So mark my words, it’s not a good habit to use panel to input data. You will never know which component could automatically convert your type of data into right type and which component doesn’t.
As for the reason why the negative 1 is outputted, I have no clue. From the research of @筑梦Naruto, the principle of Item Index is that it looks for the data’s position in memory. However I cannot tell you why this is “-1” but not “-2,-3”. If you have any idea please share it with me or Facebook me on www.facebook.com/daniel.jin.5817.
Thank you Daniel! I have learnt a lot from your teaching material.
© 2023 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!