Added some optimizations and runtime is down to ~35% of what it used to be. It actually seems to be 1.5 to 2 times faster than the old component.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Added by David Rutten at 8:34am on December 3, 2012
.5,-3.0; 2.1,-6.7;0.35: 2: 7.2,-8.1; 6.2,-7.0; 5.7,-2.3;0.5: 0: 1.5,3.5; 2.3,-0.4; 2.6,-1.2;0.5: 1: 5.6,-3.1; 5.2,-1.5; 6.3,-6.0;0.5: 2: -3.4,6.4; -3.0,5.5; -2.9,7.6;The first number of each line is the z value. Each z value is used multiple times with a list of x,y values. That second number is the index of the list of points for the z value, and the following ordered pairs are the x,y values.
I attached my script, which outputs each line of data as a branch containing the points on that line (paired with the z value at the start of the line). The paths output are {0;0;#} where # ranges from 0 to 799. I'd like to collect all the lines with the same z values into one branch, however, resulting in something like {0;$;#} where $ ranges from 0 to 7 (the number of different z values) and # ranges from 0 to 99 (the number of lists of points associated with each z value), rather than having them all compressed into one list.
I'm reading the input line by line, but if I read it all at once, I could create a loop that examines each line's z value and stores the line into a list specific to that z value, then output all those lists of lists as a list/DataTree? Is that what you are suggesting, David Stasiuk? …
Added by Mark Bank at 2:55pm on September 27, 2012