unreal.GeometryScriptSimplePolygon

class unreal.GeometryScriptSimplePolygon

Bases: StructBase

A simple 2D Polygon with no holes

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: GeometryScriptTypes.h

add_polygon_vertex(position) int32

Set the specified vertex of a Simple Polygon. Returns the index of the added vertex.

Parameters:

position (Vector2D) –

Return type:

int32

create_polygon_list_from_single_polygon(hole_polygons, fix_hole_orientations=True) GeometryScriptGeneralPolygonList

Create a Polygon List of a single Polygon, with optional holes

Parameters:
Return type:

GeometryScriptGeneralPolygonList

get_polygon_arc_length() double

Returns the arc length of a Simple Polygon

Return type:

double

get_polygon_area() double

Returns the area enclosed by a Simple Polygon

Return type:

double

get_polygon_bounds() Box2D

Returns the bounding box of a Simple Polygon

Return type:

Box2D

get_polygon_tangent(vertex_index) -> (Vector2D, polygon_is_empty=bool)

Returns a vertex’s tangent of a Simple Polygon. VertexIndex loops around, so e.g., -1 gives the tangent of the last vertex in the polygon. If Polygon has no vertices, returns the zero vector.

Parameters:

vertex_index (int32) –

Returns:

polygon_is_empty (bool):

Return type:

bool

get_polygon_vertex(vertex_index) -> (Vector2D, polygon_is_empty=bool)

Returns the specified vertex of a Simple Polygon. VertexIndex loops around, so e.g., -1 gives the last vertex in the polygon. If Polygon has no vertices, returns the zero vector.

Parameters:

vertex_index (int32) –

Returns:

polygon_is_empty (bool):

Return type:

bool

get_polygon_vertex_count() int32

Returns the number of vertices in a Simple Polygon

Return type:

int32

set_polygon_vertex(vertex_index, position) bool

Set the specified vertex of a Simple Polygon. VertexIndex loops around, so e.g., -1 gives the last vertex in the polygon. Does nothing if Polygon has no vertices.

Parameters:
  • vertex_index (int32) –

  • position (Vector2D) –

Returns:

polygon_is_empty (bool):

Return type:

bool