# Geometry functions

## Overview

In Houdini, geometry is made up of primitives, with the most common primitive being a polygonal faces. Each corner of a polygonal face is a vertex. To keep individual faces together as part of a surface, vertices of separate faces can be fused together as a point. When a point moves, Houdini automatically moves each of the point’s vertices as well.

## Geometry traversal

• You can use vertexpoint to get from a vertex to its point.

• You can use pointvertex to get from a point to its first vertex and vertexnext and vertexprev to iterate through the list of vertices sharing that point.

• To iterate through the vertices of a polygonal face, use primvertexcount to get the number of vertices, then you can use the primitive number and a counter from `0` to `primitive count - 1` to refer to the vertices.

• A vertex number is the 0-based index of a certain vertex of a primitive. A linear vertex number is the 0-based index of a certain primitive across all the geometry. It is just a slightly more convenient way to refer to a vertex with one number instead of two (primitive number and vertex number). You can use vertexindex to get a linear vertex number from a primitive number and a vertex number. Use both vertexprim and vertexprimindex to convert the other way, from a linear vertex number to a primitive number and a vertex number.

Returns

Function

Argument(s)

Point number

Linear vertex number

Linear vertex number

Point number

Linear vertex number

Linear vertex number

Linear vertex number

Linear vertex number

Linear vertex number

Primitive number, Vertex number

Number of vertices

Primitive number

Primitive number

Linear vertex number

Vertex number

Linear vertex number

# VEX

## Language

• Details of VEX syntax, data types, and so on.

• Overview of how to use the VEX language compiler vcc and its pre-processor and pragma statements.

## Next steps

• You can read the contents of primitive/point/vertex groups in VEX as if they were attributes.

• Examples and suggestions for programming in VEX.

• VEX has functions that let you treat edges as unshared per-face "half-edges".

• You can use the assert() macro to print information while you are debugging VEX code.

## Reference

• Guide to the different contexts in which you can write VEX programs.