Grasshopper

algorithmic modeling for Rhino

Hey David I have question. I've start seeing that, conversion from text to point is taking lot of time.
 I'm loading point data from Processing in format x,y,z ,and I'm converting them to point in "Point Cloud" component which is normal Point block. But this taking 11 minutes !!!! (almost 50k points) . Importing them in format {x,y,z} change nothing. same long time....

When I'm split them by coma, and create point from number (Point Making Group in Image) is taking few seconds.. And result is the same...Why so big difference ?!

And also "ListItem" I think is working slower then previous ones. When I'm open old scripts and use old ListItem it is faster too list points...  comparing to new one. 

Thanks in advance for answer !

Views: 6260

Replies to This Discussion

Hi Sebastian,

In David's absence I can have a stab at this.

Parsing the text has to be on a character by character basis. Grasshopper doesn't know what each one will be until it has read it and dealt with it in order to move on to the next.

For example (-12.0, -19.5, 1.0):

"(" what is this --> A parenthesis --> I'm expecting a Point so this is ok

"-" what is it --> A minus sign --> Ah the number must be negative

"1" what is it --> A one --> the first component of this point starts with a -1

"2" what is it --> A two --> The first component of this point starts with a -12

"." what is it --> A period --> The first component of this point is -12.xxx

"0" what is it --> A zero --> The first component has at least 1 decimal place -12.0

"," What is it --> A comma --> I have found the complete first component of this point and it is -12.0 .... Yeah lest move on to the next component.

" " What is it --> A Space --> This is not a number or a minus sign I can ignore this

"-" what is it --> A minus sign --> The second component ...............

See where we're going with this :)

Now the other approach where you specify how the text is to be split, puts everything that is required for the each component in one lump.

"-12.0" what is it --> -12.0 --> The first component is -12.0

"-19.5" what is it --> -19.5 --> The second component is -19.5

 "1.0" what is it --> 1.0 --> The Third component is 1.0

See how much quicker that was

[List Item] is a brand new Component that has the ability to output all of the items in a list. I can only guess, but this is probably the extra time.

Thank You for fast explanation about point. Its clear now:)
I have notice that new features, but still to list 1K points from 50K is taking longer time then in old one. It will be really nice if we have both them. Not always you need i+1 item, but you need performance...
Thank You !

Hi!

I'm completely new to Grasshopper and I've been trying to do exactly this, turn a text file exported from processing into a lit of points in GH. Could you give me some advice regarding how to format the text file from processing? I assume the points need to be each in a different line, but is there anything else I should take into account (separator characters, parenthesis, etc)?

Also, I cant seem to find the component "Split" that you use in your image, all the ones I found have different inputs, could you point out where its located in GH?

Thanks!

The component shown above was called String Split it is now called Text Split and has been modified slightly.

It will take some text T and then wherever it finds the character in C e.g. a comma will split the text onto separate lines.

It doesn't matter what character you choose as its effectively the same process regardless.

hope this helps.

Hi, thanks for the quick reply!

I found the object, but I still can-t get it to work.

My text file is as follows: 

21 15 14
695 2 87
1 45 7
69 85 4
2 111 846
645 231 78

And here is my GH setup: 

Am I missing some step that actually turns the separate text numbers into values that GH can understand? I am using a blank space as my separator for the split object. I've also tried it with comma without any success.

Thanks!

I cannot tell from the image what the outputs of the components are but from the looks of it it should have worked. Assuming that the mask input is xyz

Hi, thanks again for the quick reply.

The mask is input is xyz. I have no idea why it isn't working. 

can you attach a panel to the out put of split and point to numbers so i can see the content?

Here it is

I don't understand what he problem is. You have got the solution as it is supposed to be right there.

There is one thing I'm not sure off as I am used to looking at the Icon view. Shouldn't it be Numbers to Points rather than Points to Numbers.

Regardless of this fact as I see the output above you have a list of single points on multiple branches. I you wanted to create a curve from this then you can put it directly into a polyline or a Nurbs Curve with a FLattened input.

Have you tried the "input coordiantes" component on params -> input?

It might parse the coordinates faster, since it should have some expectations on the data.

/ola

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service