unreal.LidarPointCloud

class unreal.LidarPointCloud(outer=None, name='None')

Bases: unreal.Object

Represents the Point Cloud asset

C++ Source:

  • Plugin: LidarPointCloud

  • Module: LidarPointCloudRuntime

  • File: LidarPointCloud.h

Editor Properties: (see get_editor_property/set_editor_property)

  • collision_accuracy (float): [Read-Write] Collision Accuracy deprecated: Use MaxCollisionError instead.

  • max_collision_error (float): [Read-Write] Max Collision Error: Determines the maximum error (in cm) of the collision for this point cloud. NOTE: Lower values will require more time to build. Rebuild collision for the changes to take effect.

  • normals_noise_tolerance (float): [Read-Write] Normals Noise Tolerance: Higher values are less susceptible to noise, but will most likely lose finer details, especially around hard edges. Lower values retain more detail, at the expense of time. NOTE: setting this too low will cause visual artifacts and geometry holes in noisier datasets.

  • normals_quality (int32): [Read-Write] Normals Quality: Higher values will generally result in more accurate calculations, at the expense of time

  • optimized_for_dynamic_data (bool): [Read-Write] Optimized for Dynamic Data: Disables the LOD pipeline, allowing for much faster data operations (insert/remove/set) at a potential expense of runtime performance. The whole asset will be treated as a single, large asset with no granular density control, nor occlusion culling.

    Recommended for assets, which have their data updated per-frame (such as live streaming).

  • original_coordinates (Vector): [Read-Write] Original Coordinates: Stores the original offset as a double.

  • source_path (FilePath): [Read-Write] Source Path: Stores the path to the original source file. Empty if dynamically created.

apply_color_to_all_points(new_color, visible_only) None

Applies the given color to all points

Parameters
  • new_color (Color) –

  • visible_only (bool) –

apply_color_to_first_point_by_ray(new_color, origin, direction, radius, visible_only) None

Applies the given color to the first point hit by the given ray

Parameters
apply_color_to_points_by_ray(new_color, origin, direction, radius, visible_only) None

Applies the given color to all points hit by the given ray

Parameters
apply_color_to_points_in_box(new_color, center, extent, visible_only) None

Applies the given color to all points within the box

Parameters
apply_color_to_points_in_sphere(new_color, center, radius, visible_only) None

Applies the given color to all points within the sphere

Parameters
build_collision() None

Builds collision mesh for the cloud, using current collision settings

calculate_normals(latent_info) None

Calculates Normals for this point cloud

Parameters

latent_info (LatentActionInfo) –

center_points() None

Centers this cloud

property collision_accuracy

[Read-Write] Collision Accuracy deprecated: Use MaxCollisionError instead.

Type

(float)

export(filename) bool

Exports this Point Cloud to the given filename. Consult supported export formats. Returns true if successful

Parameters

filename (str) –

Return type

bool

get_bounds(use_original_coordinates=False) Box

Get Bounds

Parameters

use_original_coordinates (bool) –

Return type

Box

get_data_size() int32

Returns the amount of memory in MB used to store the point cloud.

Return type

int32

get_estimated_point_spacing() float

Get Estimated Point Spacing

Return type

float

get_num_lo_ds() int32

End UObject Interface.

Return type

int32

get_num_nodes() int32

Get Num Nodes

Return type

int32

get_num_points() int64

Get Num Points

Return type

int64

get_num_visible_points() int64

Get Num Visible Points

Return type

int64

get_points_as_copies(return_world_space, start_index=0, count=- 1)

Returns an array with copies of points from the tree If ReturnWorldSpace is selected, the points’ locations will be converted into absolute value, otherwise they will be relative to the center of the cloud.

Parameters
  • return_world_space (bool) –

  • start_index (int32) –

  • count (int32) –

Return type

Array(LidarPointCloudPoint)

get_points_in_box_as_copies(center, extent, visible_only, return_world_space)

Returns an array with copies of points within the given box If ReturnWorldSpace is selected, the points’ locations will be converted into absolute value, otherwise they will be relative to the center of the cloud.

Parameters
Return type

Array(LidarPointCloudPoint)

get_points_in_sphere_as_copies(center, radius, visible_only, return_world_space)

Returns an array with copies of points within the given sphere If ReturnWorldSpace is selected, the points’ locations will be converted into absolute value, otherwise they will be relative to the center of the cloud.

Parameters
Return type

Array(LidarPointCloudPoint)

get_source_path() str

Get Source Path

Return type

str

has_collision_data() bool

Returns true, if the Octree has collision built

Return type

bool

has_points_by_ray(origin, direction, radius, visible_only) bool

Returns true if there are any points hit by the given ray.

Parameters
Return type

bool

has_points_in_box(center, extent, visible_only) bool

Returns true if there are any points within the given box.

Parameters
Return type

bool

has_points_in_sphere(center, radius, visible_only) bool

Returns true if there are any points within the given sphere.

Parameters
Return type

bool

hide_all() None

Marks all points hidden

initialize(new_bounds) None

Re-initializes the asset with new bounds. Warning: Will erase all currently held data!

Parameters

new_bounds (Box) –

insert_point(point, duplicate_handling, refresh_points_bounds, translation) None

Inserts the given point into the Octree structure. If bRefreshPointsBounds is set to false, make sure you call RefreshBounds() manually or cloud centering may not work correctly.

Parameters
insert_points(points, duplicate_handling, refresh_points_bounds, translation) None

Inserts group of points into the Octree structure, multi-threaded. If bRefreshPointsBounds is set to false, make sure you call RefreshBounds() manually or cloud centering may not work correctly.

Parameters
is_centered() bool

Returns true, if the cloud has been centered.

Return type

bool

is_fully_loaded() bool

Returns true, if the cloud is fully and persistently loaded.

Return type

bool

is_optimized_for_dynamic_data() bool

Is Optimized for Dynamic Data

Return type

bool

line_trace_multi(origin, direction, radius, visible_only, return_world_space) Array(LidarPointCloudPoint) or None

Performs a raycast test against the point cloud. Populates OutHits array with the results. If ReturnWorldSpace is selected, the points’ locations will be converted into absolute value, otherwise they will be relative to the center of the cloud. Returns true it anything has been hit.

Parameters
Returns

out_hits (Array(LidarPointCloudPoint)):

Return type

Array(LidarPointCloudPoint) or None

line_trace_single(origin, direction, radius, visible_only) LidarPointCloudPoint or None

Performs a raycast test against the point cloud. Returns the pointer if hit or nullptr otherwise.

Parameters
Returns

point_hit (LidarPointCloudPoint):

Return type

LidarPointCloudPoint or None

load_all_nodes() None

Persistently loads all nodes.

mark_point_visibility_dirty() None

This should to be called if any manual modification to individual points’ visibility has been made. If not marked dirty, the rendering may work sub-optimally.

property max_collision_error

[Read-Write] Max Collision Error: Determines the maximum error (in cm) of the collision for this point cloud. NOTE: Lower values will require more time to build. Rebuild collision for the changes to take effect.

Type

(float)

merge(point_clouds_to_merge) None

Merges this point cloud with the ones provided

Parameters

point_clouds_to_merge (Array(LidarPointCloud)) –

merge_single(point_cloud_to_merge) None

Merges this point cloud with the one provided

Parameters

point_cloud_to_merge (LidarPointCloud) –

property normals_noise_tolerance

[Read-Write] Normals Noise Tolerance: Higher values are less susceptible to noise, but will most likely lose finer details, especially around hard edges. Lower values retain more detail, at the expense of time. NOTE: setting this too low will cause visual artifacts and geometry holes in noisier datasets.

Type

(float)

property normals_quality

[Read-Write] Normals Quality: Higher values will generally result in more accurate calculations, at the expense of time

Type

(int32)

property original_coordinates

[Read-Only] Original Coordinates: Stores the original offset as a double.

Type

(Vector)

refresh_bounds() None

Recalculates and updates points bounds.

refresh_rendering() None

Refresh Rendering

reimport(world_context_object, use_async, latent_info) -> (async_mode=LidarPointCloudAsyncMode, progress=float)

Re-imports the cloud from it’s original source file, overwriting any current point information.

Parameters
Returns

async_mode (LidarPointCloudAsyncMode):

progress (float):

Return type

tuple

remove_collision() None

Removes collision mesh from the cloud.

remove_first_point_by_ray(origin, direction, radius, visible_only) None

Removes the first point hit by the given ray

Parameters
remove_hidden_points() None

Removes all hidden points

remove_point(point) None

Attempts to remove the given point.

Parameters

point (LidarPointCloudPoint) –

remove_points_by_ray(origin, direction, radius, visible_only) None

Removes all points hit by the given ray

Parameters
remove_points_in_box(center, extent, visible_only) None

Removes all points within the given box

Parameters
remove_points_in_sphere(center, radius, visible_only) None

Removes all points within the given sphere

Parameters
restore_original_coordinates() None

Restores original coordinates

set_data(points) bool

Reinitializes the cloud with the new set of data.

Parameters

points (Array(LidarPointCloudPoint)) –

Return type

bool

set_location_offset(offset) None

Applies given offset to this point cloud.

Parameters

offset (Vector) –

set_optimized_for_dynamic_data(new_optimized_for_dynamic_data) None

Set Optimized for Dynamic Data

Parameters

new_optimized_for_dynamic_data (bool) –

set_source_path(new_source_path) None

Set Source Path

Parameters

new_source_path (str) –

set_visibility_of_first_point_by_ray(new_visibility, origin, direction, radius) None

Sets visibility of the first point hit by the given ray.

Parameters
set_visibility_of_points_by_ray(new_visibility, origin, direction, radius) None

Sets visibility of points hit by the given ray.

Parameters
set_visibility_of_points_in_box(new_visibility, center, extent) None

Sets visibility of points within the given box.

Parameters
set_visibility_of_points_in_sphere(new_visibility, center, radius) None

Sets visibility of points within the given sphere.

Parameters
unhide_all() None

Marks all points visible