[SESI logo]

Houdini Development Toolkit - Version 6.5

Side Effects Software Inc. 2004

Geometry

Classes & Methods

Container Classes

The geometry libraries are divided among the following major classes:

The Geometry Base Class (GB) contains a geometric description consisting primarily of the following elements:

The Geometry Domain Class (GD) is derived from the GB class and further defines primitives with trimmed surface and surface domain information.

The Geometry Class (GEO) is derived from GD and further contains:

The Geometry Utility Class (GU) is derived from GEO and contains a number of functions for creating and manipulating primitives and points.

The Quad Edge Class (GQ) is closely related to the GU Class and contains a number of methods containing quad edge algorithms.

Useful Data Structures

Points

A point is defined within the GEO_Point class and contains a position and attribute data. The position is a UT_Vector4 object and is accessed with the GEO_Point::getPos() method. Point objects are contained with a geometry detail point list.

Vertices

A vertex is defined within the GEO_Vertex class and contains a reference to a point object and attribute data. The point reference is accessed with the GEO_Vertex::getPt() method which returns a pointer to a GEO_Point object. The GEO_Vertex::getPos() method returns the UT_Vector4 object contained within the point it references directly. Note that a point may be referenced by more than one vertex, creating shared points, but vertices are never shared. A vertex is contained within a primitive's vertex list.

Primitives

A primitive is defined within the GEO_Primitive class and contains attribute data and a possible vertex list. Primitives are contained with a geometry detail primitive list. Each primitive type in Houdini is subclassed from this class and contains specific data. At this level there are a number of useful access methods:

Groups

A group is a set of either primitive or point references (GB_PrimitiveGroup, GB_PointGroup). Groups can be classified as either ordered or unordered and are contained with a geometry detail group list. A geometry detail contains methods dealing with primitive groups (similiar for point groups):

Summary Example

This example function will show how the previous concepts can be used to divide a detail's primitives into two groups: Primitives above the xy plane, and the primitives below. Note in this example the groups created are not mutually exclusive since some primitives may have vertices above and below the xy plane.

void sort_prims(GEO_Detail *gdp) { GB_PrimitiveGroup *above_group, *below_group; GEO_Primitive *prim; int i; int numv; GEO_Vertex *vtx; UT_Vector4 pos; // // create two groups for containing the primitive references // above_group = gdp->newPrimitiveGroup("above"); below_group = gdp->newPrimitiveGroup("below"); // // this macro will iterate through each primitive in a geometry detail // FOR_ALL_PRIMITIVES(gdp, prim) { numv = prim->getVertexCount(); for (i = 0; i < numv; i++) // examine each vertex { vtx = &prim->getVertex(i); pos = vtx->getPos(); // examine the vertex point reference if (pos.z() <= 0) // examine the z component below_group->add(prim); else above_group->add(prim); } } }

Enhancements

The function can be modified to sort only polygons with the line:

if (prim->getPrimitiveId() == GEOPRIMPOLY)...

The sort can look at only the center of each primitive (regardless or vertices) with:

prim->evaluatePoint(pos, 0.5, 0.5);

For information on how to create and manipulate specific primitives refer to the Primitives section.


Table of Contents
Operators | Surface Operations | Particle Operations | Composite Operators | Channel Operators
Material & Texture | Objects | Command and Expression | Render Output |
Mantra Shaders | Utility Classes | Geometry Library | Image Library | Clip Library
Customizing UI | Questions & Answers

Copyright © 2004 Side Effects Software Inc.
477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7