# Linear Vertex - Help

## Recommended Posts

Hello,

Can someone please explain to me what a linear vertex is properly? I thought I understood it when I was initially trying with lines but once I applied the function on the grid, everything seems wrong.

I understood it as, primvertex points to the point number, so vertex 2 of primitive 1 should return 2 but instead it is returning 6. Not sure why?

The same function with lines give me the correct answer.

##### Share on other sites

Hi Ultraman,

Thanks for the reply. I saw this but it's still a little confusing.

Why is @vtxnum returning a single value, instead of 4 values for each vertex?

##### Share on other sites
11 hours ago, dolexd said:

Hi Ultraman,

Thanks for the reply. I saw this but it's still a little confusing.

Why is @vtxnum returning a single value, instead of 4 values for each vertex?

I'm not sure why,  Houdini vertex always is a little confusing for me - but if u want to get all vertex u can use primvertices[] .

• 1

##### Share on other sites
Posted (edited)

Hi,

the linear vertex number is useful, if you want to loop over all vertices at once (without looping over the prims). The linear vertex is independent from the primitive, where the vertex belongs to. Each prim has multiple vertices but each vertex has only one prim. Or lets say, if you put all vertices of all primitives into one list with unique identification (increasing numbers) you will get the linear vertices.

Just put this source code into a vertex wrangle, to see the differences (you can also see, that each point can have several vertices aswell but each (linear) vertex is exactly one point reference)

```i@vn = @vtxnum;
i@pv = vertexprimindex(0, @vtxnum);
i@prim = @primnum;```

or just a file

Edited by Aizatulin
• 1

##### Share on other sites

Thanks Ultraman and Aizatulin.

## Create an account

Register a new account