Geometry Types ============== .. contents:: Table of Contents :depth: 2 :local: .. _polymesh: ``polymesh`` ~~~~~~~~~~~~ Polygonal mesh geometry. A polygonal mesh is formed of points, a vertex list (defining vertices) and start index list (defining faces). Additional information, such as normals and arbitrary data, can also be defined. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`float[3n]` * :kat:attr:`geometry.point.N` * List of per-point normals. - * :kat:type:`float[3n]` * :kat:attr:`geometry.point.P` * List of points. The geometry points are unique floating point positions in object space coordinates (x, y, z). Each point is only stored once but it may be indexed many times by a particular vertex. - * :kat:type:`int[]` * :kat:attr:`geometry.poly.startIndex` * A list of indices defining the faces of a mesh. For example, consider a cube. A cube has a :kat:attr:`startIndex` list size equal to the number of faces in the mesh plus one. This is because we must store the index of the first point on the first face as well as the end point of all the faces (including the first). So, for example, the beginning of a cube's :kat:attr:`startIndex` list may look like: * 0 - 0 * 1 - 4 * 2 - 8 The indices for each polygon N are from ``startIndex(N)`` to ``startIndex(N+1)-1``. The value at index 0 of the list tells us the first face should start at index 0 in the ``vertexList``, the second value in the list tells us the first face ends at index 3 (``n-1``). - * :kat:type:`int[]` * :kat:attr:`geometry.poly.vertexList` * Describes the vertex data of a mesh. There is a vertex at each edge intersection. The value of the :kat:attr:`vertexList` is used as an index into the :kat:attr:`geometry.point.P` list, which stores the actual object coordinates of each unique point. Many indices in a :kat:attr:`vertexList` can index the same point in the :kat:attr:`geometry.point.P` list. This saves space as a vertex is described as a simple integer rather then the three floating point values required to describe a 3D geometry point (x, y, z). - * :kat:type:`float[3n]` * :kat:attr:`geometry.vertex.N` * List of per-face vertex normals. - * :kat:type:`float[2n]` * :kat:attr:`geometry.vertex.UV` * List of texture coordinates (per vertex, non face-varying) ``subdmesh`` ~~~~~~~~~~~~ Sub-division surfaces geometry. Sub-division surfaces (Subds) are similarly structured to polygonal meshes. .. note:: This section is under construction. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`int` * :kat:attr:`geometry.facevaryinginterpolateboundary` :kat:attr:`geometry.facevaryingpropagatecorners` :kat:attr:`geometry.interpolateBoundary` * - * :kat:type:`int[]` * :kat:attr:`geometry.creaseIndices` * - * :kat:type:`int[]` * :kat:attr:`geometry.creaseLengths` * - * :kat:type:`float[]` :kat:type:`int[]` * :kat:attr:`geometry.creaseSharpness` :kat:attr:`geometry.creaseSharpnessLengths` * - * :kat:type:`int[]` * :kat:attr:`geometry.cornerIndices` * - * :kat:type:`float[]` * :kat:attr:`geometry.cornerSharpness` * - * :kat:type:`int[]` * :kat:attr:`geometry.holePolyIndices` * - * :kat:type:`float[]` * :kat:attr:`geometry.point.Pref` * - * :kat:type:`group` * :kat:attr:`geometry.point` * See polymesh_. - * :kat:type:`group` * :kat:attr:`geometry.poly` * See polymesh_. - * :kat:type:`group` * :kat:attr:`geometry.vertex` * See polymesh_. ``pointcloud`` ~~~~~~~~~~~~~~ Point cloud geometry. A point cloud is the simplest form of geometry and only requires point data to be specified. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`group` * :kat:attr:`geometry.point` * See polymesh_. ``nurbspatch`` ~~~~~~~~~~~~~~ NURBS patch geometry. NURBS patches are a special type of geometry, quite different from conventional mesh types. A NURBS curve is defined by its order, a set of weighted control points and a knot vector. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`int` * :kat:attr:`geometry.uSize` :kat:attr:`geometry.vSize` * The size. - * :kat:type:`float[4n]` * :kat:attr:`geometry.point.Pw` * List of control points and their weights, in the order: x y z w. - * :kat:type:`int` * :kat:attr:`geometry.u.order` :kat:attr:`geometry.v.order` * The order. - * :kat:type:`float` * :kat:attr:`geometry.u.min` :kat:attr:`geometry.u.max` * Parameters defining the NURBS patch. - * :kat:type:`float[]` * :kat:attr:`geometry.u.knots` :kat:attr:`geometry.v.knots` * Knot vector, a sequence of parameter values. - * :kat:type:`group` * :kat:attr:`geometry.trimcurves` * Parameters defining the NURBS patch. ``curves`` ~~~~~~~~~~ For creating groups of curves parented to the same transform. Curves cannot be created by the UI but can be created through the Python API. The following XML is from a scene graph that creates 3 linear curves with 3 segments: .. code-block:: xml .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`int` * :kat:attr:`geometry.basis` * An integer indicating the curve basis. This is defined as follows: - ``0`` - No basis - ``1`` - Bezier - ``2`` - B-Spline - ``3`` - Catmull-Rom - ``4`` - Hermite - ``5`` - Power This follows the ``BasisType`` enumeration in the Alembic library. - * :kat:type:`float` * :kat:attr:`geometry.constantWidth` * A float that defines the width of a curve, which is applied uniformly to each control point. - * :kat:type:`int` * :kat:attr:`geometry.degree` * Specifies whether curves are linear (degree = 1) or cubic (degree = 3). - * :kat:type:`float[]` * :kat:attr:`geometry.knots` * Knot vector is a sequence of parameter values. .. note:: When splitting :kat:attr:`geometry.point.P` into multiple curves using knots, the values in :kat:attr:`numVertices` must correspond. For example, given 8 control points in :kat:attr:`geometry.point.P`, ``degree = 3``, and ``knots = [ 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 ]``, then ``numVertices = [ 4 4 ]``. - * :kat:type:`int` * :kat:attr:`geometry.vstep` * Sets the vertex stride for the curve. This is used by Katana to calculate the expected length of point-scoped arbitrary attribute arrays. - * :kat:type:`int[]` * :kat:attr:`geometry.numVertices` * The number of vertices in each curve. The :kat:attr:`numVertices` list defines the index ranges of the knots used by each curve. - * :kat:type:`float[3n]` * :kat:attr:`geometry.point.P` * List of points. The geometry points are unique floating point positions in object space coordinates (x, y, z). Each point is only stored once but it may be indexed many times by the same knot. - * :kat:type:`float[3n]` * :kat:attr:`geometry.point.orientation` * List of orientations for each control point in the curve, relative to the camera. - * :kat:type:`float[n]` * :kat:attr:`geometry.point.width` * List of widths (diameters) of the curve at each control point. .. note:: If both :kat:attr:`geometry.constantWidth` and :kat:attr:`geometry.point.width` are set, the values in :kat:attr:`geometry.point.width` are used. ``locator`` ~~~~~~~~~~~ Used only in the Viewer; ignored by the renderers. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`group` * :kat:attr:`geometry.point` * See polymesh_. - * :kat:type:`group` * :kat:attr:`geometry.poly` * See polymesh_. ``sphere`` ~~~~~~~~~~ Built-in primitive type for a sphere, supported by some renderers. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`double` * :kat:attr:`geometry.radius` * The radius of the sphere. ``spheres`` ~~~~~~~~~~~ A more efficient way of creating a group of spheres in PRMan at once. This is ignored by other renderers. .. list-table:: :header-rows: 1 :widths: 5 20 75 - * Type * Attribute * Description - * :kat:type:`float[3n]` * :kat:attr:`geometry.point.P` * List of points that represent the sphere centers. - * :kat:type:`float[n]` * :kat:attr:`geometry.point.radius` * The spheres' radii. - * :kat:type:`float` * :kat:attr:`geometry.constantRadius` * Can be used instead of :kat:attr:`geometry.point.radius` to specify a single radius for all spheres.