c4d.CPolygon

class c4d.CPolygon

Represents a polygon.

Attributes

c4d.CPolygon.a

Index of first point in the polygon.

Type: int

c4d.CPolygon.b

Index of second point in the polygon.

Type: int

c4d.CPolygon.c

Index of third point in the polygon.

Type: int

c4d.CPolygon.d

Index of optional fourth point in the polygon.

Overview

Magic Methods

CPolygon.__init__()

CPolygon.__str__()

Returns a string representation of the polygon object.

Shape And Topology

CPolygon.EdgePoints()

Retrieves the point indices for edge.

CPolygon.Find()

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

CPolygon.FindEdge()

Checks if the vertex indices index1 and index2 form an edge in this polygon.

CPolygon.IsTriangle()

Checks if the polygon is a triangle.

Members

Magic Methods

CPolygon.__init__(self, 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__(self)
Returns a string representation of the polygon object.

Called if str() is invoked on a CPolygon object. See object.__str__() for more information on Python’s data model.
Return type

str

Returns

The string representation of the polygon.

Shape And Topology

CPolygon.EdgePoints(self, edge)

Retrieves the point indices for edge.

New in version R16.021.

Parameters

edge (int) – The edge index (0-3).

Return type

Tuple[int, int]

Returns

The index of the first and second edge point.

CPolygon.Find(self, index)

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

New in version R16.021.

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(self, index1, index2)

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

New in version R16.021.

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.IsTriangle(self)

Checks if the polygon is a triangle.

New in version R16.021.

Return type

bool

Returns

True if the polygon is a triangle, otherwise False.