Polygon

class itasca.geometry.polygon.Polygon

Objects of this type should not be created (instantiated) directly in Python. Use the module functions that return instances of this type.

area() → double.

Get the polygon area.

closest(vec: pos) → vec.

Return the point on the polygon closes to the point pos.

edges() → tuple of edge objects.

Get a tuple of edge objects associated with the polygon.

extra(slot: int) → any.

Get the geometry polygon extra data in the given slot.

group([slot: str or int]) → str.

Get the geometry polygon group name in a given slot.

group_remove(group_name: str or int[, slot: str or int]) → bool.

Remove from the given group from all group slots of the geometry polygon. One argument of type string, giving the group name, is required. The return value is a bool which is True if the group was removed from any slot, otherwise False.

groups() → {slot: group_name}.

Get a dictionary describing which groups this geometry polygon is part of. The keys of the dictionary are the slot names and the values are the group names.

id() → int.

Get the geometry polygon id.

in_group(group_name: str or int[, slot: str or int]) → bool.

Test if the geometry polygon is part of a given group. If the optional argument slot is given, only that slot is searched. Otherwise, all group slots are searched.

is_convex(float: tolerance) → bool.

Check the polygon is convex within a tolerance.

is_planar(float: tolerance) → bool.

Check the polygon is planar within a tolerance.

is_valid() → bool.

Check the validity status.

next_index(int: i) → int.

Get the local index of an edge within the the next polygon attached to this edge.

next_poly(int: i) → Geometry polygon object.

Get the next polygon connected to the edge with local index i.

nodes() → tuple of node objects.

Get a tuple of node objects associated with the polygon.

normal() → vec.

Get the geometry polygon normal (vector).

normal_x() → float.

Get the x-component of the geometry polygon normal.

normal_y() → float.

Get the y-component of the geometry polygon normal.

normal_z() → float.

Get the z-component of the geometry polygon normal.

pos() → vec.

Get the geometry polygon location (vector).

pos_x() → float.

Get the x-component of the geometry polygon location.

pos_y() → float.

Get the y-component of the geometry polygon location.

pos_z() → float.

Get the z-component of the geometry polygon location.

set_extra(slot: int, value: any) → None.

Set the geometry polygon extra data in the given slot.

set_group(group_name: str or int[, slot: str or int]) → None.

Set the geometry polygon group name in a given slot.

size() → int.

Check the number of edges.

valid() → bool.

Returns True if this geometry polygon is live.