Skip to main content
pyRANSAC-3D logo pyRANSAC-3D logo

Tests DOI PyPI Latest Release License

What is pyRANSAC-3D?

pyRANSAC-3D is an open source Python implementation of the Random Sample Consensus (RANSAC) method. It fits primitive shapes such as planes, cuboids, and cylinders to point clouds for applications including 3D SLAM, 3D reconstruction, object tracking, and more.


Features

Installation

Requirement: NumPy

Install from PyPI:

pip install pyransac3d

For a complete introduction see the Getting Started guide.

Quick start

Example 1 - Planar RANSAC

import pyransac3d as pyrsc

points = load_points(.) # Load your point cloud as a NumPy array with shape (N, 3)

plane1 = pyrsc.Plane()
best_eq, best_inliers = plane1.fit(points, 0.01)

The result is the plane equation Ax + By + Cz + D = 0: [0.720, -0.253, 0.646, 1.100]

Example 2 - Spherical RANSAC

To fit a noisy sphere with r = 5 centered at the origin, use:

import pyransac3d as pyrsc

points = load_points(.) # Load your point cloud as a NumPy array with shape (N, 3)

sph = pyrsc.Sphere()
center, radius, inliers = sph.fit(points, thresh=0.4)

Results:

center: [0.010462385575072288, -0.2855090643954039, 0.02867848979091283]
radius: 5.085218633039647

3D Sphere

More examples

Runnable examples of every shape are in the examples folder.

When should I use pyRANSAC-3D?

Use pyRANSAC-3D when you need to:

  • Fit a plane to a 3D point cloud in Python, such as a floor, wall, roof, or tabletop.
  • Detect cylinders in LiDAR or depth-sensor data, such as pipes, poles, trunks, or columns.
  • Segment geometric shapes from noisy point clouds with RANSAC.
  • Fit spheres, cuboids, circles, lines, or point clusters from NumPy-compatible (N, 3) arrays.
  • Combine lightweight NumPy-based shape fitting with optional Open3D visualization.

Documentation and other links

License

Apache 2.0

Citation

Was this repository useful for your work? Please cite it:

@software{Mariga_pyRANSAC-3D,
  author = {Mariga, Leonardo},
  doi = {10.5281/zenodo.7212567},
  month = {8},
  title = {{pyRANSAC-3D}},
  url = {https://github.com/leomariga/pyRANSAC-3D},
  version = {v0.7.0},
  year = {2026}
}

Contributing is awesome!

See CONTRIBUTING

Contact

Developed with :heart: by the internet

Maintainer: Leonardo Mariga

Did you like it? Remember to click the :star2: button.

Download files

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

Source Distribution

pyransac3d-0.7.0.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

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

pyransac3d-0.7.0-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file pyransac3d-0.7.0.tar.gz.

File metadata

  • Download URL: pyransac3d-0.7.0.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for pyransac3d-0.7.0.tar.gz
Algorithm Hash digest
SHA256 8a481475e8490589c8194e4c2512d6777fe66e74195809fad23fbf6c136206e4
MD5 da7f6553ec0161facc51e63294e6dce9
BLAKE2b-256 24513df11e0a2acd10fb7584c306150d23cd9f7058c2af9708fe4cf4deef7ba6

See more details on using hashes here.

File details

Details for the file pyransac3d-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: pyransac3d-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for pyransac3d-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c529c69967a280aca2558d6f45cab2b14552328f596ee468e7fbdc8854906d65
MD5 20ad0922d25ac52b9ed3cb1aaef3b7a9
BLAKE2b-256 d3a2e86abd8902e255e56ce7c888202658cda2ca05332f62a74bce33a65dff58

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page