Skip to main content

Lightweight point cloud I/O and processing library. Pure numpy — no open3d dependency.

Project description

pointcloudkit

Lightweight point cloud I/O and processing library. Pure numpy — no open3d dependency.

Requirements

numpy
laspy   # LAS format only

Python ≥ 3.9.

Supported Formats

Extension Read Write
.pcd
.ply
.las
.bin

PCD and PLY support both ASCII and binary modes. Binary writes are chunked and memory-efficient regardless of cloud size.


Operations

Reading and writing

from pointcloudkit import PointCloud

pc = PointCloud.read("scan.pcd")
pc.write("scan.ply")                  # binary by default
pc.write("scan_ascii.pcd", binary=False)

Format conversion

from pointcloudkit import convert

convert("scan.las", "scan.pcd")
convert("scan.bin", "scan.ply")
convert("scan.pcd", "scan_ascii.ply", binary=False)

Center

Subtracts the centroid from all positions in-place.

pc = PointCloud.read("scan.pcd")
pc.center()
pc.write("centered.pcd")

Make upright

Rotates the cloud so its dominant plane is parallel to XY (Z axis points up). Uses PCA: the eigenvector with the smallest eigenvalue is the plane normal, which is then aligned to [0, 0, 1] via the Rodrigues formula.

pc = PointCloud.read("scan.pcd")
pc.make_upright()
pc.write("upright.pcd")

Operations return self and can be chained:

PointCloud.read("scan.las").center().make_upright().write("processed.pcd")

PointCloud data model

pc.position   # (N, 3) float64  — always present
pc.intensity  # (N,)   float32  — empty array if absent
pc.rgb        # (N, 3) uint8    — empty array if absent
pc.extra      # dict: name → (N,) ndarray for any additional fields

Constructing manually:

import numpy as np
from pointcloudkit import PointCloud

pc = PointCloud(
    position=np.random.rand(1000, 3),
    intensity=np.random.rand(1000).astype(np.float32),
    rgb=np.random.randint(0, 255, (1000, 3), dtype=np.uint8),
)
print(len(pc))  # 1000

Reading BIN files

Velodyne BIN files default to KITTI layout (x, y, z, intensity). Pass num_attrs to override the number of float32 values per point.

from pointcloudkit.io.bin import BINFile

pc = BINFile.read("velodyne.bin")              # 4 attrs (default)
pc = BINFile.read("custom.bin", num_attrs=6)   # 6 attrs; first 3 → position

Accessing format-specific classes directly

from pointcloudkit.io.pcd import PCDFile
from pointcloudkit.io.ply import PLYFile
from pointcloudkit.io.las import LASFile

pc = PCDFile.read("scan.pcd")
PLYFile.write(pc, "scan.ply", binary=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pointcloudkit-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pointcloudkit-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pointcloudkit-0.1.0.tar.gz.

File metadata

  • Download URL: pointcloudkit-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointcloudkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c25e49d76e6181e60171e48d731b25075ff647be21ded4eb52b01060bbf2d179
MD5 8aa7ddcbb84edf2478da494fed0636c3
BLAKE2b-256 4b61aaaa00a4fb8d83716a8fa23adf7160c762d89defe7ee3e0bf35653917091

See more details on using hashes here.

File details

Details for the file pointcloudkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pointcloudkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointcloudkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 317064ecce06e0814f1f077c7c5907c3b1d0a9559a343b4d38cdc1a8614912a2
MD5 7475abb0463e2b443e0598619ccaf6c6
BLAKE2b-256 b3df597a0385f7db4ba69ee9e9083cdb9c89400a4cb9e835655c2f6d4dd45701

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page