Cull Points which are at same height

Hi All,

I would like to cull points that are in same height but should not be repetitive in following list. Seems simple but not sure how to do it neatly.
input is on left and output is on right

cull_points_problem.gh (8.2 KB)

Hey, always easier with file !

Deconstruct point, create set (based on Z), member index, list item (the points with indices from member index)
That should create datatree based on heights

then a list item wil only take one of the point on each height (if you don’t care about X and Y location)

Is this what you’re looking for?

first part yes.

second part about culling specifically those seems tricky

I’m not sure I get what you meant…
A list item after creating the datatree will only pick one item in each list. (same as culling the others).

If you need more help please link that part of the file

attached the file kindly have a look. I need the output to cull 2 and 3 on first 4 points and 0 and 1 on another so it wont be repetitive

yes but I need same points aligned along Y axis on one list and other set of points in another list

So I’ve made two solutions… I don’t really know what can be the variants of your model.
You might prefer one over the other !

Is this what you were looking for?

cull_points_problem_ama.gh (13.0 KB)

yes for this case it works. Kindly see attached where it doesnt seem to work other cases. I even made a value list for you to check

cull_points_problem_ama-01.gh (11.6 KB)

But it doesn’t look at all like the previous case… I would really need a clear explanation of what you need. (english not tongue language so i might not get the thing).
I don’t understant which points you want on 3rd case…

It’s either the cases have a common selection rule or one rule per case (hoping that you only have 3 cases)

Hope its clear. Those red dots have to be removed

if its 3 seperate x axis alignment then its three cull and so on

The thing is that to be able to construct a datatree with a branch from each groupment with the tiny amount of data available, I need these to be the same. (That the only way I ve in mind for it to be absolutely automatic).

Is it suposed to be the same space between groupements or not?
If not, does the groupements on the X axis comme from differents Z heights? (I think yes, as the case 1 suggests it). We need those Z heights to branch the groups.

you mean same spacing between group of points? ok make it eqi distant and please let me know how to do it

z heights doesnt matter I will project it so it lies on xy plane. Also make it same space and give solution please

Could be written differently in my opinion :slight_smile:

Anyway here is my last version with equidistant groups.
Hope it helps

cull_points_problem_ama-01.gh (14.7 KB)

still didnt work for me.

I tried equal spacing. but only works for case 1

spheres represent output

Try this:

Points_TreesFilterByCoord_V1.gh (122.6 KB)

This is what it shows when I feed in my points.

But this is what I need

First Rule dont repeat points in the consecutive list.
Second Rule extract same points aligned along x axis and cull rest in first list,
then extract same points aligned along x axis from culled points that we get from first list

Read the code carefully:

The Filter Method works on a per branch basis and does the filtering in FIFO: this means that for each point in a given branch it tests if the same search coord (X or Y or Z) is found in another point in another branch and if yes marks the latter as sampled (and/or uses nulls to indicate that) .

BTW: same means: Math.Abs(coord1 - coord2) < tol.

For instance assume that you have 3 branches with points with the same Z. If your uniqueCoord option is Z then (obviously) the output is just one point:

If on the other hand your option is Y then this is what you get:

With that workmode in mind is faultless.

Appears that you want to do “the same” on a per List basis as well.

1 Like

I tried what you said by choosing unique coord option as x but it culls points sharing same X in same branch. But I need it like cull in next branch.

For example:
consider a list with 2 branches

2 branches has same alignment of points but only distance apart by x distance. Each branch has 4 points.

point in index 0 and 3 share same x alignment and so does 1 and 2 in both branches. But difference between point location in branch 0 and 1 is just by x distance.

so output should give 0 and 3 in first branch and 1 and 2 in second branch

@antoinemaesantoine got it right but it didnt work all cases

ok this one works perfectly when I split branches and feed it directly to input. You are Awesome Antoine!!

Try this then (play with the new filter options as well).

Points_TreesFilterByCoord_V1A.gh (131.4 KB)

Update:

This is using Local (per List) and Global (per Tree) Filtering:

Points_TreesFilterByCoord_V1C.gh (138.8 KB)

1 Like