pointtorch.core
Core data structures for point cloud processing.
- class pointtorch.core.BoundingBox(min_coord: ndarray, max_coord: ndarray)[source]
Bases:
object
Axis-aligned bounding box.
- Parameters:
min_coord – Minimum coordinates of the bounding box.
max_coord – Maximum coordinates of the bounding box.
- Raises:
ValueError – If
min_coord
andmax_coord
have different shapes or if an entry ofmin_coord
is larger then the corresponding entry inmax_coord
.
- center() ndarray [source]
Returns: Coordinates of the bounding box center.
- extent() ndarray [source]
Returns: Extent of the bounding box along each axis.
- class pointtorch.core.PointCloud(
- data: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | Iterable | Dict | DataFrame,
- index: Index | ndarray[Any, dtype[int64]] | None = None,
- columns: Index | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | List[str] | None = None,
- dtype: dtype | None = None,
- copy: bool | None = True,
- crs: str | None = None,
- identifier: str | None = None,
- x_max_resolution: float | None = None,
- y_max_resolution: float | None = None,
- z_max_resolution: float | None = None,
Bases:
DataFrame
Point cloud object. Subclass of pd.DataFrame
- Parameters:
identifier – Point cloud identifier. Defaults to
None
.crs – ESPG code of the point cloud’s coordinate reference system. Defaults to
None
x_max_resolution – Maximum resolution of the point cloud’s x-coordinates in meter. Defaults to
None
.y_max_resolution – Maximum resolution of the point cloud’s y-coordinates in meter. Defaults to
None
.z_max_resolution – Maximum resolution of the point cloud’s z-coordinates in meter. Defaults to
None
.
For a documentation of other parameters, see the documentation of pd.DataFrame.
- Variables:
crs – ESPG code of the point cloud’s coordinate reference system.
identifier – Point cloud identifier.
x_max_resolution – Maximum resolution of the point cloud’s x-coordinates in meter.
y_max_resolution – Maximum resolution of the point cloud’s y-coordinates in meter.
z_max_resolution – Maximum resolution of the point cloud’s z-coordinates in meter.
- to(
- file_path: str | Path,
- columns: List[str] | None = None,
Writes the point cloud to a file.
- Parameters:
file_path – Path of the output file.
columns – Point cloud columns to be written. The x, y, and z columns are always written.
- Raises:
ValueError – If the point cloud format is not supported by the writer or if
columns
contains a column name that is not existing in the point cloud.
- xyz() ndarray[Any, dtype[float64]] [source]
- Returns:
x, y, and z coordinates of the points in the point cloud.
- Raises:
RuntimeError – if “x”, “y”, or “z” are not in
self.columns
.
- class pointtorch.core.PointCloudSeries(
- data: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | Iterable | Dict | None = None,
- index: Index | ndarray[Any, dtype[int64]] | None = None,
- dtype: str | dtype | ExtensionDtype | None = None,
- name: Hashable | None = None,
- copy: bool | None = True,
- identifier: str | None = None,
- x_max_resolution: float | None = None,
- y_max_resolution: float | None = None,
- z_max_resolution: float | None = None,
Bases:
Series
A data series that represents a point cloud column. Subclass of pd.Series.
- Parameters:
identifier – Point cloud identifier. Defaults to
None
.x_max_resolution – Maximum resolution of the point cloud’s x-coordinates in meter. Defaults to
None
.y_max_resolution – Maximum resolution of the point cloud’s y-coordinates in meter. Defaults to
None
.z_max_resolution – Maximum resolution of the point cloud’s z-coordinates in meter. Defaults to
None
.
For a documentation of other parameters, see the documentation of pd.Series.
- Variables:
identifier – Point cloud identifier.
x_max_resolution – Maximum resolution of the point cloud’s x-coordinates in meter.
y_max_resolution – Maximum resolution of the point cloud’s y-coordinates in meter.
z_max_resolution – Maximum resolution of the point cloud’s z-coordinates in meter.
- pointtorch.core.read(
- file_path: str | Path,
- columns: List[str] | None = None,
- num_rows: int | None = None,
Method for reading point cloud files.
- Parameters:
file_path – Path of the point cloud file to be read.
columns – Name of the point cloud columns to be read. The x, y, and z columns are always read.
num_rows – Number of rows to read. If set to
None
, all rows are read. Defaults toNone
.
- Returns:
Point cloud object.
- Raises:
ValueError – If the point cloud format is not supported by the reader.