unreal.GeometryScript_SimplePolygon

class unreal.GeometryScript_SimplePolygon(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Geometry Script Library Simple Polygon Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: PolygonFunctions.h

classmethod add_polygon_vertex(polygon, position) -> (int32, polygon=GeometryScriptSimplePolygon)

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

Parameters:
Returns:

polygon (GeometryScriptSimplePolygon):

Return type:

GeometryScriptSimplePolygon

classmethod conv_array_of_vector2d_to_geometry_script_simple_polygon(path_vertices) GeometryScriptSimplePolygon

Returns a Polygon created from an array of 2D position vectors.

Parameters:

path_vertices (Array[Vector2D]) –

Return type:

GeometryScriptSimplePolygon

classmethod conv_array_to_geometry_script_simple_polygon(path_vertices) GeometryScriptSimplePolygon

Returns a Polygon created from an array of 3D position vectors, ignoring the Z coordinate.

Parameters:

path_vertices (Array[Vector]) –

Return type:

GeometryScriptSimplePolygon

classmethod conv_geometry_script_simple_polygon_to_array(polygon) Array[Vector]

Returns an array of 3D vectors with the Polygon vertex locations, with Z coordinate set to zero.

Parameters:

polygon (GeometryScriptSimplePolygon) –

Return type:

Array[Vector]

classmethod conv_geometry_script_simple_polygon_to_array_of_vector2d(polygon) Array[Vector2D]

Returns an array of 2D Vectors with the Polygon vertex locations.

Parameters:

polygon (GeometryScriptSimplePolygon) –

Return type:

Array[Vector2D]

classmethod convert_spline_to_polygon(spline, sampling_options, drop_axis=GeometryScriptAxis.Z) GeometryScriptSimplePolygon

Sample positions from a USplineComponent into a Simple Polyon, based on the given SamplingOptions

Parameters:
Returns:

polygon (GeometryScriptSimplePolygon):

Return type:

GeometryScriptSimplePolygon

classmethod get_polygon_arc_length(polygon) double

Returns the arc length of a Simple Polygon

Parameters:

polygon (GeometryScriptSimplePolygon) –

Return type:

double

classmethod get_polygon_area(polygon) double

Returns the area enclosed by a Simple Polygon

Parameters:

polygon (GeometryScriptSimplePolygon) –

Return type:

double

classmethod get_polygon_bounds(polygon) Box2D

Returns the bounding box of a Simple Polygon

Parameters:

polygon (GeometryScriptSimplePolygon) –

Return type:

Box2D

classmethod get_polygon_tangent(polygon, 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:
Returns:

polygon_is_empty (bool):

Return type:

bool

classmethod get_polygon_vertex(polygon, 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:
Returns:

polygon_is_empty (bool):

Return type:

bool

classmethod get_polygon_vertex_count(polygon) int32

Returns the number of vertices in a Simple Polygon

Parameters:

polygon (GeometryScriptSimplePolygon) –

Return type:

int32

classmethod set_polygon_vertex(polygon, vertex_index, position) -> (polygon=GeometryScriptSimplePolygon, polygon_is_empty=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:
Returns:

polygon (GeometryScriptSimplePolygon):

polygon_is_empty (bool):

Return type:

tuple