Jump to content

# how to count points on a just one curve?

## Recommended Posts

I can use npoints("../sop") but that count ALL the points, is there a way to just count the points on the first primitive?

#### Share this post

##### Share on other sites

in VEX you can use primvertexcount()

#### Share this post

##### Share on other sites

interesting I am running it on a series of curves/hairs  and I just get   1 as result,  my hairs have 10 points each,  vertex are been consider different as points in this case?

#### Share this post

##### Share on other sites
```int primpts[] = primpoints(0,@primnum);
i@pointcount = len(primpts);```

Will also work.

In a curve each point will have one vertex, so they the count will match.

#### Share this post

##### Share on other sites
14 minutes ago, pelos said:

interesting I am running it on a series of curves/hairs  and I just get   1 as result,  my hairs have 10 points each,  vertex are been consider different as points in this case?

running it how?

run over Primitives:

`i@n = primvertexcount(0, @primnum);`

should return correct number for you per primitive

it's true that it will return number of vertices and not points, and those can differ based on type of the curve and how they are constructed, but for most common polygonal curve primitives they usually match

• 1

#### Share this post

##### Share on other sites

since I needed in a parameter I did python

node = hou.pwd()
geo = node.geometry()
prim0 = geo.prim(0)
return len(prim0.points())

## 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

## Sign in

Already have an account? Sign in here.

Sign In Now

×
• Donations

• Leaderboard