unreal.GeometryScript_MeshSpatial

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

Bases: BlueprintFunctionLibrary

Geometry Script Library Mesh Spatial

C++ Source:

  • Plugin: GeometryScripting

  • Module: GeometryScriptingCore

  • File: MeshSpatialFunctions.h

classmethod build_bvh_for_mesh(target_mesh, debug=None) -> (DynamicMesh, output_bvh=GeometryScriptDynamicMeshBVH)

Builds a Bounding Volume Hierarchy (BVH) object for a mesh that can be used with multiple spatial queries.

Parameters:
Returns:

output_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

classmethod find_nearest_point_on_mesh(target_mesh, query_bvh, query_point, options, debug=None) -> (DynamicMesh, nearest_result=GeometryScriptTrianglePoint, outcome=GeometryScriptSearchOutcomePins)

Finds the nearest point (Nearest Result) on the Target Mesh to a given 3D point (Query Point) by using the Query BVH.

Parameters:
Returns:

nearest_result (GeometryScriptTrianglePoint): on return, holds the nearest point on the mesh to the QueryPoint

outcome (GeometryScriptSearchOutcomePins): will be either Found or Not Found depending on the success of the query. Note NearestResult.bValid will be false if the query failed.

Return type:

tuple

classmethod find_nearest_ray_intersection_with_mesh(target_mesh, query_bvh, ray_origin, ray_direction, options, debug=None) -> (DynamicMesh, hit_result=GeometryScriptRayHitResult, outcome=GeometryScriptSearchOutcomePins)

Finds the nearest intersection of a 3D ray with the mesh by using the Query BVH. Note, depending on the Ray Origin and Ray Direction, there is the possibility that the ray might not intersect with the Target Mesh. Should the ray miss, the HitResult.bHit will be false and the Outcome will be Not Found.

Parameters:
Returns:

hit_result (GeometryScriptRayHitResult):

outcome (GeometryScriptSearchOutcomePins):

Return type:

tuple

classmethod is_bvh_valid_for_mesh(target_mesh, test_bvh, debug=None) -> (DynamicMesh, is_valid=bool)

Checks if the provided Bounding Volume Hierarchy (BVH) can still be used with the Mesh — it generally returns false if the mesh has been changed.

Parameters:
Returns:

is_valid (bool):

Return type:

bool

classmethod is_point_inside_mesh(target_mesh, query_bvh, query_point, options, debug=None) -> (DynamicMesh, is_inside=bool, outcome=GeometryScriptContainmentOutcomePins)

Tests if a point is inside the mesh using the Fast Winding Number query and data stored in the BVH.

Parameters:
Returns:

is_inside (bool):

outcome (GeometryScriptContainmentOutcomePins):

Return type:

tuple

classmethod rebuild_bvh_for_mesh(target_mesh, update_bvh, only_if_invalid=True, debug=None) -> (DynamicMesh, update_bvh=GeometryScriptDynamicMeshBVH)

Rebuilds the Bounding Volume Hierarchy (BVH) for the mesh in-place, which can reduce memory allocations, compared to building a new BVH.

Parameters:
Returns:

update_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

classmethod reset_bvh(reset_bvh) GeometryScriptDynamicMeshBVH

Reset the Bounding Volume Hierarchy (BVH) by clearing all the internal data.

Parameters:

reset_bvh (GeometryScriptDynamicMeshBVH) –

Returns:

reset_bvh (GeometryScriptDynamicMeshBVH):

Return type:

GeometryScriptDynamicMeshBVH

classmethod select_mesh_elements_in_box_with_bvh(target_mesh, query_bvh, query_box, options, selection_type=GeometryScriptMeshSelectionType.VERTICES, min_num_triangle_points=3, debug=None) -> (DynamicMesh, selection=GeometryScriptMeshSelection)

Create Mesh Selection of mesh elements in TargetMesh contained by QueryBox, using QueryBVH to accellerate the computation. Triangles are selected if MinNumTrianglePoints or more vertices are inside the box. PolyGroups are selected if any of their triangles are inside the box

Parameters:
Returns:

selection (GeometryScriptMeshSelection):

Return type:

GeometryScriptMeshSelection