c4d.CPolygon

Represents a polygon.

Members

CPolygon.a

Index of first point in the polygon.

Type: int

CPolygon.b

Index of second point in the polygon.

Type: int

CPolygon.c

Index of third point in the polygon.

Type: int

CPolygon.d

Index of optional fourth point in the polygon.

Type: int

CPolygon.__init__(t_a, t_b, t_c[, t_d])
Parameters:
  • t_a (int) – Index of first point in the polygon.
  • t_b (int) – Index of second point in the polygon.
  • t_c (int) – Index of third point in the polygon.
  • t_d (int) – Index of optional fourth point in the polygon.
CPolygon.__str__()

Returns a string representation of the polygon. Called if str() is wrapped around an instance of CPolygon. (see __str__).

Return type:str
Returns:The string representation of the polygon.
CPolygon.IsTriangle()

New in version R16.021.

Checks if the polygon is a triangle.

Return type:bool
Returns:True if the polygon is a triangle, otherwise False.
CPolygon.Find(index)

New in version R16.021.

Checks if one of the polygon vertex indices is equal to index and returns the found polygon vertex number (0-3, equals a - d).

Parameters:index (int) – The vertex index to check.
Return type:int
Returns:The matching polygon vertex number (0-3, equals a - d). NOTOK is returned if there is no match.
CPolygon.FindEdge(index1, index2)

New in version R16.021.

Checks if the vertex indices index1 and index2 form an edge in this polygon. If so the polygon edge number is returned (0-3).

Parameters:
  • index1 (int) – The vertex index of the first edge point.
  • index2 (int) – The vertex index of the second edge point.
Return type:

int

Returns:

The found polygon edge number (0-3). NOTOK is returned if there is no match.

CPolygon.EdgePoints(edge)

New in version R16.021.

Retrieves the point indices for edge.

Parameters:edge (int) – The edge index (0-3).
Return type:tuple(int, int)
Returns:The index of the first and second edge point.

Table Of Contents