generative modeling for Rhino
I and a teammate tried to collect the xyz data of the kinect and then we tried to import through a tcp client written in rhino.python to grasshopper. The problem is that the data comes as a string, is there any string to number add-on or anyone can help us, we are new in grasshopper and python, we will be very happy for every answer.
richard and sebastian
Can you post an example of the data coming in?
I can't see much detail in that image.
if the data is a series of XYZ numbers, delimited by commas:
then you can convert one line into a point like so:
numbers = [float(n) for n in incomingXYZstring.split(',')]
point = Rhino.Geometry.Point3d(*numbers)
i will try that, thanks :)
but is there something in grasshopper, that translates the string?
I don't think that Grasshopper has an ascii to string converter, but this is generally very easy in python, or any other programming language. In python if 'x' represents the integer of an ascii character, then 'chr(x)' will return the corresponding letter/character.
The [Read File] component has a Parser... item in the menu that allows you to write a VB script that parses the entire file or every individual line.
Hi, We have released an add-on called "Quokka" to get Kinect data to grasshopper (quokkalab.com) , Give it a try!
thanks, its awesome, like one month on the trash ;)