unreal.GeometryScriptGeneralPolygonList¶
- class unreal.GeometryScriptGeneralPolygonList¶
Bases:
StructBaseA list of general polygons, which may have holes.
C++ Source:
Plugin: GeometryScripting
Module: GeometryScriptingCore
File: GeometryScriptTypes.h
- add_polygon_to_list(outer_polygon, hole_polygons, fix_hole_orientations=True) int32¶
Add Polygon to a Polygon List, with optional holes. Returns index of the added polygon.
- Parameters:
outer_polygon (GeometryScriptSimplePolygon)
hole_polygons (Array[GeometryScriptSimplePolygon])
fix_hole_orientations (bool)
- Return type:
int32
- append_polygon_list(polygons_to_append) None¶
Append the polygons in ‘Polygons to Append’ to Polygon List
- Parameters:
polygons_to_append (GeometryScriptGeneralPolygonList)
- get_polygon_area(polygon_index) -> (double, valid_index=bool)¶
Returns the area enclosed by a specified Polygon in a Polygon List. Returns zero for an invalid PolygonIndex.
- Parameters:
polygon_index (int32)
- Returns:
valid_index (bool):
- Return type:
- get_polygon_bounds(polygon_index) -> (Box2D, valid_index=bool)¶
Returns the bounding box of a Polygon. Returns an empty, invalid box for an invalid PolygonIndex.
- Parameters:
polygon_index (int32)
- Returns:
valid_index (bool):
- Return type:
- get_polygon_count() int32¶
Returns the number of polygons in the Polygon List
- Return type:
int32
- get_polygon_hole_count(polygon_index) -> (int32, valid_index=bool)¶
Returns the number of holes in a Polygon. Returns zero for an invalid PolygonIndex.
- Parameters:
polygon_index (int32)
- Returns:
valid_index (bool):
- Return type:
- get_polygon_list_area() double¶
Returns the area enclosed by a Polygon List
- Return type:
double
- get_polygon_vertex(vertex_index, polygon_index, hole_index=-1) -> (Vector2D, is_valid_vertex=bool)¶
Returns the specified vertex of a Polygon – either of the outer polygon, if HoleIndex is -1, or specified inner hole. Vertex will be the zero vector for invalid Polygon or Hole indices, or if the polygon is empty. VertexIndex will loop.
- Parameters:
vertex_index (int32)
polygon_index (int32)
hole_index (int32)
- Returns:
is_valid_vertex (bool):
- Return type:
- get_polygon_vertex_count(polygon_index, hole_index=-1) -> (int32, valid_indices=bool)¶
Returns the number of vertices in a Polygon’s outer shape, if HoleIndex is -1, or in the specified inner hole. Returns 0 for invalid Polygon or Hole indices.
- Parameters:
polygon_index (int32)
hole_index (int32)
- Returns:
valid_indices (bool):
- Return type:
- get_polygon_vertices(polygon_index, hole_index=-1) -> (out_vertices=Array[Vector2D], valid_indices=bool)¶
Returns the vertices of a Polygon – either of the outer polygon, if HoleIndex is -1, or specified inner hole. OutVertices will be empty for invalid Polygon or Hole indices.
- Parameters:
polygon_index (int32)
hole_index (int32)
- Returns:
out_vertices (Array[Vector2D]):
valid_indices (bool):
- Return type:
tuple
- get_simple_polygon(polygon_index, hole_index=-1) -> (GeometryScriptSimplePolygon, valid_indices=bool)¶
Returns a specified Simple Polygon from a Polygon List – either the outer polygon, if HoleIndex is -1, or specified inner hole. Polygon will be empty for invalid Polygon or Hole indices.
- Parameters:
polygon_index (int32)
hole_index (int32)
- Returns:
valid_indices (bool):
- Return type:
- polygons_difference(polygons_to_subtract) GeometryScriptGeneralPolygonList¶
Compute difference of Polygon List and Polygons to Subtract
- Parameters:
polygons_to_subtract (GeometryScriptGeneralPolygonList)
- Return type:
- polygons_exclusive_or(polygons_to_exclusive_or) GeometryScriptGeneralPolygonList¶
Compute exclusive or of Polygon List and Polygons to Exclusive Or
- Parameters:
polygons_to_exclusive_or (GeometryScriptGeneralPolygonList)
- Return type:
- polygons_intersection(polygons_to_intersect) GeometryScriptGeneralPolygonList¶
Compute intersection of Polygon List and Polygons to Intersect
- Parameters:
polygons_to_intersect (GeometryScriptGeneralPolygonList)
- Return type:
- polygons_morphology_close(offset_options, offset, copy_input_on_failure=True) -> (GeometryScriptGeneralPolygonList, operation_success=bool)¶
Apply a morphological “close” operator to a list of closed polygons – first offsetting by +Offset, then by -Offset. If Offset is negative, this will instead function as an ‘Open’ operation
- Parameters:
offset_options (GeometryScriptPolygonOffsetOptions)
offset (double)
copy_input_on_failure (bool)
- Returns:
operation_success (bool):
- Return type:
- polygons_morphology_open(offset_options, offset, copy_input_on_failure=True) -> (GeometryScriptGeneralPolygonList, operation_success=bool)¶
Apply a morphological “open” operator to a list of closed polygons – first offsetting by -Offset, then by +Offset. If Offset is negative, this will instead function as a ‘Close’ operation
- Parameters:
offset_options (GeometryScriptPolygonOffsetOptions)
offset (double)
copy_input_on_failure (bool)
- Returns:
operation_success (bool):
- Return type:
- polygons_offset(offset_options, offset, copy_input_on_failure=True) -> (GeometryScriptGeneralPolygonList, operation_success=bool)¶
Apply a single offset to a list of closed polygons
- Parameters:
offset_options (GeometryScriptPolygonOffsetOptions)
offset (double)
copy_input_on_failure (bool)
- Returns:
operation_success (bool):
- Return type:
- polygons_offsets(offset_options, first_offset, second_offset, copy_input_on_failure=True) -> (GeometryScriptGeneralPolygonList, operation_success=bool)¶
Apply two offsets in sequence to a list of closed polygons
- Parameters:
offset_options (GeometryScriptPolygonOffsetOptions)
first_offset (double)
second_offset (double)
copy_input_on_failure (bool)
- Returns:
operation_success (bool):
- Return type:
- polygons_union(copy_input_on_failure=True) GeometryScriptGeneralPolygonList¶
Compute union of all polygons in Polygon List. Also resolves self-intersections within each polygon.
- Parameters:
copy_input_on_failure (bool)
- Return type: