Git Product home page Git Product logo

pyntcloud's Introduction

Making point clouds fun again

Github Actions C.I. Documentation Status Launch Binder

pyntcloud logo

pyntcloud is a Python 3 library for working with 3D point clouds leveraging the power of the Python scientific stack.

Installation

conda install pyntcloud -c conda-forge

Or:

pip install pyntcloud

Quick Overview

You can access most of pyntcloud's functionality from its core class: PyntCloud.

With PyntCloud you can perform complex 3D processing operations with minimum lines of code. For example you can:

  • Load a PLY point cloud from disk.
  • Add 3 new scalar fields by converting RGB to HSV.
  • Build a grid of voxels from the point cloud.
  • Build a new point cloud keeping only the nearest point to each occupied voxel center.
  • Save the new point cloud in numpy's NPZ format.

With the following concise code:

from pyntcloud import PyntCloud

cloud = PyntCloud.from_file("some_file.ply")

cloud.add_scalar_field("hsv")

voxelgrid_id = cloud.add_structure("voxelgrid", n_x=32, n_y=32, n_z=32)

new_cloud = cloud.get_sample("voxelgrid_nearest", voxelgrid_id=voxelgrid_id, as_PyntCloud=True)

new_cloud.to_file("out_file.npz")

Integration with other libraries

pyntcloud offers seamless integration with other 3D processing libraries.

You can create / convert PyntCloud instances from / to many 3D processing libraries using the from_instance / to_instance methods:

import open3d as o3d
from pyntcloud import PyntCloud

# FROM Open3D
original_triangle_mesh = o3d.io.read_triangle_mesh("diamond.ply")
cloud = PyntCloud.from_instance("open3d", original_triangle_mesh)

# TO Open3D
cloud = PyntCloud.from_file("diamond.ply")
converted_triangle_mesh = cloud.to_instance("open3d", mesh=True)  # mesh=True by default
import pyvista as pv
from pyntcloud import PyntCloud

# FROM PyVista
original_point_cloud = pv.read("diamond.ply")
cloud = PyntCloud.from_instance("pyvista", original_point_cloud)

# TO PyVista
cloud = PyntCloud.from_file("diamond.ply")
converted_triangle_mesh = cloud.to_instance("pyvista", mesh=True)

pyntcloud's People

Contributors

banesullivan avatar benitezdemiguel avatar brettkoonce avatar daavoo avatar dependabot-preview[bot] avatar fcakyon avatar gsganden avatar hansen7 avatar iindovina avatar jackhadfield avatar joskaaaa avatar justbuchanan avatar kmader avatar lgtm-com[bot] avatar marcelotrevisani avatar mauriceqch avatar mawall avatar movvam avatar n-mca avatar nicholas-autio-mitchell avatar nicholas-mitchell avatar nokonoko1203 avatar pachwenko avatar pandu-rao avatar ravijo avatar robin-wayve avatar safesintesi avatar saurabhjadhav1911 avatar sbcv avatar threerivers3d-jc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyntcloud's Issues

Error on call of function plot

Hi!

Im trying to run the first code in readme. Probably Im doing something wrong.. Could you help ?

Im using a MacBook pro. Ive installed everything with miniconda (some packages I needed to install globally because miniconda does not have support for some packages to OSx64).

Then a ran in jupyter a test.py with the commands in readme. Also, I`ve downloaded a .ply sample.
The command print(scene) works fine, but when I call the .plot(), an error happens:

Traceback (most recent call last):
File "test1.py", line 8, in
scene.plot()
File "/Users/lrodrigues/miniconda2/envs/pyntcloud/lib/python3.6/site-packages/pyntcloud/core_class.py", line 604, in plot
return plot_PyntCloud(new_PyntCloud, output_name=output_name)
File "/Users/lrodrigues/miniconda2/envs/pyntcloud/lib/python3.6/site-packages/pyntcloud/plot/points.py", line 17, in plot_PyntClou
d
with open(src, "r") as inp, open(dst, "w") as out:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/lrodrigues/miniconda2/envs/pyntcloud/lib/python3.6/site-packages/pyn
tcloud/plot/points.html'

Do you have any tip to solve this ?

Thanks!

Refactoring geometry

Create abstract class GeometryModel and make Plane and Sphere childs.

Think something to rearange the areas and other things in geometry.

Test coverage

  • Test for core Class functionallity
  • All scalar fields
  • Geometry

Fix Travis CI load files

Travis if failing to pass test that require loading a file from test/data although test are passing locally.

I suspect that has something to do with the backslash used in the strings.

Package Missing in osx-64 Channels

Hi,

I am using Anaconda on an OSX-64 machine. While I was trying to create the pyntcloud environment with the enviroment.yml, it prompted the following error:

NoPackagesFoundError: Package missing in current osx-64 channels: 
  - gst-plugins-base 1.8.0 0

Do you know how to solve this?

Thanks!

Re-organize docs/QuickStart/Readme

  • Move quickstart from readme to a standalone notebook.

  • Add script to launch quickstart notebook (Also serve as test for correct installation).

render as an image file [request]

I couldn't find a way to do this currently. I want to be able to render a pointcloud as a 2-d image. So like what I see when I call plot() but to save that as an image file. I couldn't figure out how to do that currently.

Saving png

Hello,

Is it possible to save a pointcloud .plot image as a png?

Thank you

Best,
Pierre

some syntax error on installing

byte-compiling build\bdist.win32\egg\pyntcloud\pyntcloud.py to pyntcloud.pyc
File "build\bdist.win32\egg\pyntcloud\pyntcloud.py", line 357
def get_KDTree(self, *args, element='vertex', and_set=True):
^
SyntaxError: invalid syntax

byte-compiling build\bdist.win32\egg\pyntcloud\ransac\ransac.py to ransac.pyc
byte-compiling build\bdist.win32\egg\pyntcloud\ransac\ransac_models.py to ransac_models.pyc
File "build\bdist.win32\egg\pyntcloud\ransac\ransac_models.py", line 87
return proj_points, norm_all(orthogonal_projection)
SyntaxError: 'return' outside function

Coordenate system converter

  • Spherical - Cartesian
  • Cartesian - Spherical
  • Cylindrical - Cartesian
  • Cartesian - Cylindrical
  • Spherical - Cylindrical

Bounding Box Filter

I've noticed that the bounding box filter does not work for the z axis. I've got it work on x and y but for some reason it will not apply to the z direction. Any thoughts on why this is happening or what im doing wrong?

Uploading to PyPI

Hi, do you have any plans to upload the code to PyPI to make it pip installable without git reference? It would be a great addition and simplify setup and installation. Thank you, cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.