easyidp.pointcloud.compat

Legacy compatibility wrappers for pointcloud standalone functions and deprecated PointCloud instance methods.

The top-level functions emit FutureWarning and delegate to the corresponding io backend. PointCloudCompatMixin carries the old PointCloud instance methods that are kept for backward compatibility.

Legacy Standalone Functions

These helpers are kept for compatibility with pre-v2.1 point-cloud IO workflows. They emit FutureWarning and delegate to the current IO backends. Prefer easyidp.pointcloud.read_point_cloud() and easyidp.pointcloud.write_point_cloud() in new code.

easyidp.pointcloud.compat.read_las(las_path)

Read a LAS file with the legacy standalone API.

Deprecated since version 2.1.0: Use easyidp.pointcloud.read_point_cloud() instead.

Parameters:

las_path (str or pathlib.Path) – Path to a LAS point-cloud file.

Returns:

Raw (points, colors, normals) arrays.

Return type:

tuple[numpy.ndarray, numpy.ndarray or None, numpy.ndarray or None]

Warns:

FutureWarning – Always emitted to guide migration to read_point_cloud().

Examples

>>> points, colors, normals = idp.pointcloud.read_las("cloud.las")
>>> pcd = idp.pointcloud.read_point_cloud("cloud.las")
easyidp.pointcloud.compat.read_laz(laz_path)

Read a LAZ file with the legacy standalone API.

Deprecated since version 2.1.0: Use easyidp.pointcloud.read_point_cloud() instead.

Parameters:

laz_path (str or pathlib.Path) – Path to a LAZ point-cloud file.

Returns:

Raw (points, colors, normals) arrays.

Return type:

tuple[numpy.ndarray, numpy.ndarray or None, numpy.ndarray or None]

Warns:

FutureWarning – Always emitted to guide migration to read_point_cloud().

Examples

>>> points, colors, normals = idp.pointcloud.read_laz("cloud.laz")
>>> pcd = idp.pointcloud.read_point_cloud("cloud.laz")
easyidp.pointcloud.compat.read_ply(ply_path)

Read a PLY file with the legacy standalone API.

Deprecated since version 2.1.0: Use easyidp.pointcloud.read_point_cloud() instead.

Parameters:

ply_path (str or pathlib.Path) – Path to a PLY point-cloud file.

Returns:

Raw (points, colors, normals) arrays.

Return type:

tuple[numpy.ndarray, numpy.ndarray or None, numpy.ndarray or None]

Warns:

FutureWarning – Always emitted to guide migration to read_point_cloud().

Examples

>>> points, colors, normals = idp.pointcloud.read_ply("cloud.ply")
>>> pcd = idp.pointcloud.read_point_cloud("cloud.ply")
easyidp.pointcloud.compat.write_las(las_path, points, colors, normals=None, offset=array([0., 0., 0.]), decimal=5)

Write a LAS file with the legacy standalone API.

Deprecated since version 2.1.0: Use easyidp.pointcloud.write_point_cloud() instead.

Parameters:
  • las_path (str or pathlib.Path) – Output LAS path.

  • points (numpy.ndarray of shape (N, 3)) – Absolute XYZ coordinates.

  • colors (numpy.ndarray of shape (N, 3) or None) – RGB values as uint8. None writes zero-valued LAS colors.

  • normals (numpy.ndarray of shape (N, 3) or None, optional) – Normal vectors.

  • offset (numpy.ndarray of shape (3,), optional) – LAS header offset.

  • decimal (int, optional) – Number of decimal digits used to build LAS scale values.

Return type:

None

Warns:

FutureWarning – Always emitted to guide migration to write_point_cloud().

Examples

>>> idp.pointcloud.write_las("cloud.las", points, colors)
>>> pcd = idp.PointCloud()
>>> pcd.points = points
>>> pcd.colors = colors
>>> idp.pointcloud.write_point_cloud("cloud.las", pcd)
easyidp.pointcloud.compat.write_laz(laz_path, points, colors, normals=None, offset=array([0., 0., 0.]), decimal=5)

Write a LAZ file with the legacy standalone API.

Deprecated since version 2.1.0: Use easyidp.pointcloud.write_point_cloud() instead.

Parameters:
  • laz_path (str or pathlib.Path) – Output LAZ path.

  • points (numpy.ndarray of shape (N, 3)) – Absolute XYZ coordinates.

  • colors (numpy.ndarray of shape (N, 3) or None) – RGB values as uint8. None writes zero-valued LAS colors.

  • normals (numpy.ndarray of shape (N, 3) or None, optional) – Normal vectors.

  • offset (numpy.ndarray of shape (3,), optional) – LAS header offset.

  • decimal (int, optional) – Number of decimal digits used to build LAS scale values.

Return type:

None

Warns:

FutureWarning – Always emitted to guide migration to write_point_cloud().

Examples

>>> idp.pointcloud.write_laz("cloud.laz", points, colors)
>>> pcd = idp.PointCloud()
>>> pcd.points = points
>>> pcd.colors = colors
>>> idp.pointcloud.write_point_cloud("cloud.laz", pcd)
easyidp.pointcloud.compat.write_ply(ply_path, points, colors, normals=None, binary=True)

Write a PLY file with the legacy standalone API.

Deprecated since version 2.1.0: Use easyidp.pointcloud.write_point_cloud() instead.

Parameters:
  • ply_path (str or pathlib.Path) – Output PLY path.

  • points (numpy.ndarray of shape (N, 3)) – Absolute XYZ coordinates.

  • colors (numpy.ndarray of shape (N, 3) or None) – RGB values as uint8. None writes a no-color PLY.

  • normals (numpy.ndarray of shape (N, 3) or None, optional) – Normal vectors.

  • binary (bool, optional) – Write binary PLY when True, ASCII PLY when False.

Return type:

None

Warns:

FutureWarning – Always emitted to guide migration to write_point_cloud().

Examples

>>> idp.pointcloud.write_ply("cloud.ply", points, colors)
>>> pcd = idp.PointCloud()
>>> pcd.points = points
>>> pcd.colors = colors
>>> idp.pointcloud.write_point_cloud("cloud.ply", pcd)

Compatibility Mixin

PointCloudCompatMixin carries deprecated instance methods inherited by easyidp.pointcloud.PointCloud. They are documented here as the implementation layer; user-facing method docs live on the PointCloud class page.

class easyidp.pointcloud.compat.PointCloudCompatMixin

Mixin carrying deprecated instance methods for backward compatibility.

Methods defined here emit FutureWarning and delegate to the current PointCloud public API.

crop_point_cloud(polygon_xy)

Crop one polygon with the legacy ndarray API.

Deprecated since version 2.1.0: Use easyidp.PointCloud.crop() with a Shapely polygon instead.

Parameters:

polygon_xy (numpy.ndarray of shape (N, 2)) – Polygon boundary coordinates in the point-cloud XY plane.

Returns:

Cropped point cloud, or None when no points are selected.

Return type:

easyidp.PointCloud or None

Warns:

FutureWarning – Always emitted to guide migration to crop().

Examples

>>> cropped = pcd.crop_point_cloud(polygon_xy)
>>> from shapely.geometry import Polygon
>>> cropped = pcd.crop(Polygon(polygon_xy))
crop_polygon(polygon_xy)

Return XYZ points inside a 2D polygon.

Deprecated since version 2.1.0: Use easyidp.PointCloud.crop() with a Shapely polygon and access result.points instead.

Parameters:

polygon_xy (array-like of shape (N, 2) or (N, >=2)) – Polygon boundary coordinates in the point-cloud XY plane.

Returns:

Absolute XYZ coordinates inside the polygon. Empty crops return an empty (0, 3) array.

Return type:

numpy.ndarray of shape (M, 3)

Warns:

FutureWarning – Always emitted to guide migration to crop().

Examples

>>> xyz = pcd.crop_polygon(polygon_xy)
>>> from shapely.geometry import Polygon
>>> cropped = pcd.crop(Polygon(polygon_xy))
>>> xyz = cropped.points
crop_rois(roi, save_folder=None)

Crop several ROI polygons with the legacy instance API.

Deprecated since version 2.1.0: Use easyidp.PointCloud.crop() or easyidp.ROI.crop() instead.

Parameters:
  • roi (easyidp.ROI or dict[str, numpy.ndarray]) – ROI collection or mapping from label to polygon coordinates.

  • save_folder (str or pathlib.Path or None, optional) – Existing folder for writing each cropped point cloud. If None or missing, crops are returned without writing files.

Returns:

Mapping from ROI label to cropped point cloud.

Return type:

dict[str, easyidp.PointCloud]

Warns:

FutureWarning – Always emitted to guide migration to crop().

Examples

>>> crops = pcd.crop_rois(roi)
>>> crops = pcd.crop(roi)
>>> crops = roi.crop(pcd)
read_point_cloud(pcd_path)

Load a point-cloud file into the current object.

Deprecated since version 2.1.0: Prefer constructing a new easyidp.PointCloud or using easyidp.pointcloud.read_point_cloud().

Parameters:

pcd_path (str or pathlib.Path) – Path to a .ply, .las, or .laz point-cloud file.

Returns:

Mutates the current PointCloud in place.

Return type:

None

Examples

>>> pcd = idp.PointCloud()
>>> pcd.read_point_cloud("cloud.ply")
>>> pcd = idp.PointCloud("cloud.ply")
>>> pcd = idp.pointcloud.read_point_cloud("cloud.ply")
write_point_cloud(pcd_path)

Write the current point cloud with legacy suffix behavior.

Deprecated since version 2.1.0: Prefer easyidp.PointCloud.save() or easyidp.pointcloud.write_point_cloud().

Parameters:

pcd_path (str or pathlib.Path) – Output path. When no suffix is given, the current file_ext is appended for legacy compatibility.

Return type:

None

Examples

>>> pcd.write_point_cloud("cloud.ply")
>>> pcd.save("cloud.ply")
>>> idp.pointcloud.write_point_cloud("cloud.ply", pcd)