-
Notifications
You must be signed in to change notification settings - Fork 0
Face
Represents a face defined by a plane and a texture.
Attribute | Type | Description | Note |
---|---|---|---|
id |
int |
The unique identifier for the face | |
plane |
Plane |
The Plane that composes the face | |
texture |
Texture |
The texture definition | |
_vertices |
list[Point] |
List of vertices ordered in clockwise | To get value use vertices property instead |
_edges |
list[Edge] |
List of edges | To get value use edges property instead |
Constructor method for the
Face
class.
f = Face()
Returns the normal vector of the face's plane.
normal_vec = f.normal
Returns the normal vector of the face's texture.
t_normal = f.texture_normal
Get a list of vertices of the face.
# Before you must call Brush vertices property `b.vertices`
list_face_verts = f.vertices
Get a list of Edge object of the face.
# Before you must call Face vertices property `f.vertices`
list_face_edges = f.edges
Calculates the centroid of the face.
# Before you must use Brush vertices `b.vertices`
face_centroid = f.centroid()
Creates a deep copy of the face.
f_copy = f.copy()
Checks if the face has a specific texture.
if f.has_texture('aaatrigger', exact=True):
# ...
Checks if the face is valid based on its geometry or the texture axis alignment.
if f.is_valid():
# ...
Moves the face by specified offsets.
f.move_by(10,20,30)
Rotates the face around the X-axis.
f.rotate_x(45)
Rotates the face around the Y-axis.
f.rotate_y(45)
Rotates the face around the Z-axis.
f.rotate_z(45)
Rotates the face around the XYZ axes.
f.rotate_xyz(45,45,45)
Rotates the face around a given axis.
f.rotate_around_axis(45, Vector3(1,1,1))
Sets the texture name of the face.
f.set_texture('null')
Adds a vertex to the face.
Computes the edges of the face based on its vertices.
Returns a string representation of the face.
Return an iterator over the face plane points.
for point in f:
# ...
Checks if a texture or a point is present in the face plane.
if Point(32,32,32) in f:
# ...
if 'aaatrigger' in f:
# ...