# group points based on formula

## Recommended Posts

Actually I need to use transform with selected points, whether I need to group them before or not, I don;t know.

But the formula is taking from a "copy parameter" being the total number of points (divisions in a circle), I need to group (total/2)+1 and (total/2)-1

and do the same for just total/2

Example:

circle divisions = 24, I need to transform number 11 and 13 being (24/2) +1 and (24/2)-1

Another transform for point number 12: 24/2

So if I change my mind and want 36 points, Houdini should take care of it, I don't need to hardcode the point numbers

- 17 and 19

- 18

Do

Edited by anicg

##### Share on other sites

If your points count will be even all time, just simple pointwrangle

```int mid = int(npoints(0)/2);
if(@ptnum == mid-1 || @ptnum == mid+1) @group_go = 1;```

##### Share on other sites

Many thanks, works like a charm.

It took me a while to figure out what each part it means. The only bit I'm still trying to understand is why do we have a 0 in the first line npoints(0)?

Edited by anicg

##### Share on other sites

The npoints function needs the input for which it'll look of the point count. The (<geometry>geometry) in the help page means that it wants, well, geometry, and specifying 0 means that it will look for the info in the first input of the wrangle.

Here's an example of that :

Thank you.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account