hou.Face
class
A Face is a kind of geometry primitive (Prim object) that contains a sequence of vertices (Vertex objects). How these vertices are used depends on the type of face; polygons, for example, use the vertices to define the edges of the polygon, while NURBS curves use them as control points.
Inheritence: hou.Prim >
Subclasses: hou.Curve , hou.Polygon
A hou.Surface, on the other hand, stores a two dimension grid of vertices, and might be a NURBS surface, Bezier surface, or quadrilateral mesh.
Methods
Methods inherited from hou.Prim: nearestToPosition, isSplineType, minDistanceToPrim, number, intListAttribValue, vertices, vertex, geometry, floatListAttribValue, intAttribValue, setAttribValue, closestPrim, attribValue, numVertices, primsSharingPoints, stringAttribValue, boundingBox, ourUVAtClosestLocationToPrim, type, floatAttribValue, attribType
addVertex(self, point)→ hou.Vertex-
Create a new vertex inside this face, adding it to the end of the vertex list. You would typically call this method from the code of a Python-defined SOP.
pointis a hou.Point object that the new vertex will refer to. See hou.Vertex for information on the relationship between points and vertices.Raises hou.GeometryPermissionError if this geometry is not modifiable.
# These arrays define point positions and a set of polygons composed # of those points. Note that the point positions could also be floating # point values. point_positions = ((0,0,0), (1,0,0), (1,1,0), (0,1,0)) poly_point_indices = ((0,1,2), (2,3,0)) geo = hou.pwd().geometry() # Create all the points. points = [] for position in point_positions: points.append(geo.createPoint()) points[-1].setPosition(position) # Now create the polygons, adding vertices that refer to the points. for point_indices in poly_point_indices: poly = geo.createPolygon() for point_index in point_indices: poly.addVertex(points[point_index])
See also:
isClosed(self) -> bool-
Return whether the first and last vertex are connected.
An open face forms a multi-segment line or curve, since the first and last vertices are not connected. A closed face forms a very thin surface.
setIsClosed(self, on)-
Set whether the face is open or closed. See hou.Face.isClosed for more information. You would typically call this method from the code of a Python-defined SOP.
Note that this method will raise hou.OperationFailed on a Bezier curve. See hou.Geometry.createBezierCurve for more information.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
setOpen(self, on)normal(self)→ hou.Vector3-
Return the vector that’s perpendicular to the face.
attribValueAt(self, u)→int,float,strortuplepositionAtU(self, u)→ hou.Vector3degree(self)arcLength(self, u_start, u_stop)