unreal.GeometryScript_PolyPath

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

Bases: BlueprintFunctionLibrary

Geometry Script Library Poly Path Functions

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: PolyPathFunctions.h

classmethod conv_array_of_vector2d_to_geometry_script_poly_path(path_vertices) GeometryScriptPolyPath

Returns a PolyPath created from an array of 2D position vectors. The Z-coordinate of the corresponding PolyPath vertices will be zero.

Parameters:

path_vertices (Array[Vector2D]) –

Return type:

GeometryScriptPolyPath

classmethod conv_array_to_geometry_script_poly_path(path_vertices) GeometryScriptPolyPath

Returns a PolyPath created from an array of 3D position vectors.

Parameters:

path_vertices (Array[Vector]) –

Return type:

GeometryScriptPolyPath

classmethod conv_geometry_script_poly_path_to_array(poly_path) Array[Vector]

Returns an array of 3D vectors with the PolyPath vertex locations.

Parameters:

poly_path (GeometryScriptPolyPath) –

Return type:

Array[Vector]

classmethod conv_geometry_script_poly_path_to_array_of_vector2d(poly_path) Array[Vector2D]

Returns an array of 2D Vectors with the PolyPath vertex locations projected onto the XY plane.

Parameters:

poly_path (GeometryScriptPolyPath) –

Return type:

Array[Vector2D]

classmethod convert_array_of_vector2d_to_poly_path(vertex_array) GeometryScriptPolyPath

Creates a PolyPath from an array of 2D position vectors. The Z-coordinate of the corresponding PolyPath vertices will be zero.

Parameters:

vertex_array (Array[Vector2D]) –

Returns:

poly_path (GeometryScriptPolyPath):

Return type:

GeometryScriptPolyPath

classmethod convert_array_to_poly_path(vertex_array) GeometryScriptPolyPath

Creates a PolyPath from an array of 3D position vectors.

Parameters:

vertex_array (Array[Vector]) –

Returns:

poly_path (GeometryScriptPolyPath):

Return type:

GeometryScriptPolyPath

classmethod convert_poly_path_to_array(poly_path) Array[Vector]

Populates an array of 3D vectors with the PolyPath vertex locations.

Parameters:

poly_path (GeometryScriptPolyPath) –

Returns:

vertex_array (Array[Vector]):

Return type:

Array[Vector]

classmethod convert_poly_path_to_array_of_vector2d(poly_path) Array[Vector2D]

Creates an array of 2D Vectors with the PolyPath vertex locations projected onto the XY plane.

Parameters:

poly_path (GeometryScriptPolyPath) –

Returns:

vertex_array (Array[Vector2D]):

Return type:

Array[Vector2D]

classmethod convert_spline_to_poly_path(spline, sampling_options) GeometryScriptPolyPath

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

Parameters:
Returns:

poly_path (GeometryScriptPolyPath):

Return type:

GeometryScriptPolyPath

classmethod create_arc_path2d(center=[0.000000, 0.000000], radius=10.000000, num_points=10, start_angle=0.000000, end_angle=90.000000) GeometryScriptPolyPath

Create an open arc on the XY plane around the given Center. As it is an open path, the end vertex exactly hits the target EndAngle (so will be positioned on the start vertex if the end aligns to the start)

Parameters:
Return type:

GeometryScriptPolyPath

classmethod create_arc_path3d(transform, radius=10.000000, num_points=10, start_angle=0.000000, end_angle=90.000000) GeometryScriptPolyPath

Create an open arc around the origin on the XY plane, then transformed by Transform. As it is an open path, the end vertex exactly hits the target EndAngle (so will be positioned on the start vertex if the end aligns to the start)

Parameters:
Return type:

GeometryScriptPolyPath

classmethod create_circle_path2d(center=[0.000000, 0.000000], radius=10.000000, num_points=10) GeometryScriptPolyPath

Create a closed circle on the XY plane around the given Center. By our convention for closed paths, the end vertex is not a duplicate of the start vertex.

Parameters:
  • center (Vector2D) –

  • radius (float) –

  • num_points (int32) –

Return type:

GeometryScriptPolyPath

classmethod create_circle_path3d(transform, radius=10.000000, num_points=10) GeometryScriptPolyPath

Create a closed circle around the origin on the XY plane, then transformed by Transform. By our convention for closed paths, the end vertex is not a duplicate of the start vertex.

Parameters:
Return type:

GeometryScriptPolyPath

classmethod flatten_to2d_on_axis(poly_path, drop_axis=GeometryScriptAxis.Z) GeometryScriptPolyPath

Create a 2D, flattened copy of the path by dropping the given axis, and using the other two coordinates as the new X, Y coordinates.

Parameters:
Return type:

GeometryScriptPolyPath

classmethod get_nearest_vertex_index(poly_path, point) int32

Find the index of the vertex closest to a given point. Returns -1 if the PolyPath has no vertices.

Parameters:
Return type:

int32

classmethod get_poly_path_arc_length(poly_path) double

Returns the length of the PolyPath.

Parameters:

poly_path (GeometryScriptPolyPath) –

Return type:

double

classmethod get_poly_path_last_index(poly_path) int32

Returns the index of the last vertex in the PolyPath.

Parameters:

poly_path (GeometryScriptPolyPath) –

Return type:

int32

classmethod get_poly_path_num_vertices(poly_path) int32

Returns the number of vertices in the the PolyPath.

Parameters:

poly_path (GeometryScriptPolyPath) –

Return type:

int32

classmethod get_poly_path_tangent(poly_path, index) -> (Vector, is_valid_index=bool)

Returns the local tangent vector of the PolyPath at the specified vertex index. If the Index does not correspond to a vertex in the PolyPath, a Zero Vector (0,0,0) will be returned.

Parameters:
Returns:

is_valid_index (bool): will be false on return if the Index is not included in the PolyPath

Return type:

bool

classmethod get_poly_path_vertex(poly_path, index) -> (Vector, is_valid_index=bool)

Returns the 3D position of the requested vertex in the PolyPath. If the Index does not correspond to a vertex in the PolyPath, a Zero Vector (0,0,0) will be returned.

Parameters:
Returns:

is_valid_index (bool): will be false on return if the Index is not included in the PolyPath.

Return type:

bool

classmethod sample_spline_to_transforms(spline, sampling_options, relative_transform, include_scale=True) (frames=Array[Transform], frame_times=Array[double]) or None

Sample a USplineComponent into a list of FTransforms, based on the given SamplingOptions.

Parameters:
  • spline (SplineComponent) –

  • sampling_options (GeometryScriptSplineSamplingOptions) –

  • relative_transform (Transform) – a constant Transform applied to each sample Transform in its local frame of reference. So, eg, an X Rotation will rotate each frame around the local spline Tangent vector

  • include_scale (bool) – if true, the Scale of each FTransform is taken from the Spline, otherwise the Transforms have unit scale

Returns:

whether the FrameTimes are w.r.t. a ‘constant speed’ traversal of the spline

frames (Array[Transform]): Transforms are returned here, with X axis oriented along spline Tangent and Z as the ‘Up’ vector.

frame_times (Array[double]): the spline Time value used for each Frame. Note the Times Use Constant Velocity output indicates whether these times are w.r.t. to a constant-speed parameterization of the spline.

Return type:

tuple or None