[SOLVED] Parsing XYZ coordinates from a text file into Isadora
bonemap last edited by Woland
I am looking for some advice about reading XYZ coordinates into isadora as a stream of numbers. I have looked at using the newer Data Array actor to read the file and this works except that it appears to be interpreting the numeric coordinates as text. But there does not appear to be an option to convert them back into a numeric float.
There must be a way to do this?
I have tried formatting the external text file using Microsoft Excel so that the data was then in a tab delimited structure which the Data Array actor could read properly, but this has some other inherent issues.
How much precision do you need exactly ?
Thanks Juriaan, it appears that the float is too long for Isadora although I have tested the numbers in a text file with 72 lines of xyz coordinates describing a torus. For this I manually entered tabs using ‘find and replace’ in TextEdit software. The Data Array handled those floats just fine automatically adjusting the numbers to be shorter (as you say rounding them), and I was able to make a point cloud of particles with both the 3D Particles and 3D Model Particles. Having to enter the ‘tab’ manually like that is a bit of a drag, particularly with more complex geometry. I thought there might be a way of parsing the data without the intermediary step of reformatting it as tab delimited.
The Data Array actor does interpret the numeric coordinates as text because you are connecting it to a text chopper. The outputs default to a numeric value, but are mutable; if you connect the outputs to a text input, it will change to send text instead of numbers.
numeric coordinates as text because you are connecting it to a text chopper
Thanks Michel, is there an actor that will split the numeric values into the six discrete outputs, similar to what the text chopper is doing only retaining the float format?
perhaps you find it usefull
the numbers are rounded visually but not internally (well JS supports 64bit floats, so they are converted to the nearest 32bit float... thats still very precise).
its only that the input fields only display so many decimal places.
The JS actor only loads the external file on enterscene. I cheat this by putting it in an User Actor, and switching the User Actor On/Off. This causes the User Actor internals to 'enter Scene'.
The lib I have used is: https://www.papaparse.com (use local file method...others use web only JS)
Unfortunately I can't find a demo file at the moment.
@bonemap how are you extracting the xyz coordinates from the geometries?
how are you extracting the xyz coordinates from the geometries
I think you and I are playing around with similar (but different) types of things these days.
I'm feeding xyz values (as Json) all over currently, and was about to look for a way to extract them from geometry, so pointing me at Meshlab is great, thanks.