i have a txt file of point cloud 3d data...i have to do voxel slicing..how can i do this?

edited August 2017 in How To...

and how can i extract values from that txt file and manipulate these values to new integer array? some lines of my file are as follows:- 0.0,0,0.0 0.0,1,0.0 0.0,2,0.0 0.0,3,0.0 0.0,4,0.0 0.0,5,0.0 0.0,6,0.0 0.0,7,0.0 0.0,8,0.0 0.0,9,0.0 0.0,10,0.0 0.0,11,0.0 0.0,12,0.0 0.0,13,0.0 0.0,14,0.0 0.0,15,0.0 0.0,16,0.0 0.0,17,0.0 0.0,18,0.0 0.0,19,0.0 0.76604444,0,0.6427876 0.76604444,1,0.6427876 0.76604444,2,0.6427876 0.76604444,3,0.6427876 0.76604444,4,0.6427876 0.76604444,5,0.6427876 0.76604444,6,0.6427876 0.76604444,7,0.6427876

Answers

  • edited August 2017

    Leave empty lines before and after the data above

    Select entire data with mouse

    Hit ctrl-o or the small C in the command bar


    Anyway to load stuff like this you can use loadTable

    see reference Table etc.

    Then you can access each column

    You can name the columns when you insert one line above in the textfile like

    xvalue,yvalue,zvalue..... etc. matching the data below

    You could then use those names in your code


    For loop over the table and copy in array

    Maybe use PVector as type for array (see reference)

    Chrisir

  • new integer array

    but those are floats

This discussion has been closed.