Grasshopper

algorithmic modeling for Rhino

Extracting rows/colums of points from a Grid (which is not a tree,it is flatten)

Hello guys!

I hope you can help me. I am trying to make a surface from an image sampler. 

The process is: 

1_Taking lines height depending on the brightness of the image sampler in a grid of points

2_Remapping those heights to a 6 z values to simplify the surface

3_Getting the end point of each line to be able to interpolate a curve through each row in order to make a loft once I have all the curves by rows. 

My problem is that, I am selecting by a sublist component each row, but I have to do sooo many sublists with domains that go from 0 to 100, then the next sublist from 101 to 201, the next from 202 to 303, and so on, and that is a pain. 

I am sure there is a way to grab the rows in a much easier way, but I am stuck in the definition and cannot see it. 

Thanks, I attach the file and the image for the sampling image (ranges from 0 to 0.5 for both x and y).

I appreciate it! Thanks in advance!

Views: 779

Attachments:

Replies to This Discussion

hey, something like this?

file:

Attachments:

Hey, 

Thank you so much for your reply. 

Could you please, if you had time, explain to me the logic behind that solution? I kind of get lost at the moment that you try to divide the domain of the image sampler's bounds..

I appreciate your reply, thanks a lot. 

Lolo

basically dividing domains, then checking which point belongs to which domain, then remapping.

simplifying the data structure to not have to shift the lists at the end.

Also your second component is surface frames what has the datastructure inside you would need  to match trees or partition list like vw says at the end. But your definition was a little bit messy(a lot of unnessesarry components).In general when your a duplicating a part of a definition a lot of time probably there is a way to do it in less steps. thats more or less what gh good is for i guess.

also wasat work hadnt so much time to check, is it like you epected?

Hi Chapulin Colorado, 

First of all, thank you so much for your reply. It does save loads of work in the definition. I thought I was going to have a like smoother surface but it is exactly the work process I expected. 

Thanks again, I do appreciate your help. 

don't have time for a close look, but try [Partition List]?
basically partitions a list in to sublists of x length

The problem is that I am not managing lists or trees, I am managing a whole grid of flatten points that if you try to graft them, they don't end up working as I want...or at least I don't know how. 

Thanks for your message!

Having taken a look.. you need to brush up on tree basics at the very least.. especially for big data sets like this.

[Partition List] would essentially graft it in the correct way (100 lists of 101 lines)

But Chapulin's solution would be much better as it evades flattening the data set needlessly in the first place, dissuading the need to rePartition anyways.

Hey, 

Thank you so much for our help. I have gone through Chapulin's definition and it does save loads of time. I will try with partition lists to see how it works. 

Thanks again!

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