Giter Site home page Giter Site logo

cloudcompy's Introduction

CloudComPy: Introduction

Python wrapper for CloudCompare

Project site

This site in development already contains reference material, Linux and Windows 10 binaries for a Conda environment (see below).

What is CloudComPy?

This project proposes a Python module to interface to CloudCompare, of equivalent level to the command mode of CloudCompare.

CloudComPy does not yet cover all the features of CloudCompare. Features are added according to the needs reported by users, feel free to post issues in GitHub.

Here is an example of a Python script:

import cloudComPy as cc                                                # import the CloudComPy module
cc.initCC()                                                            # to do once before dealing with plugins

cloud = cc.loadPointCloud("myCloud.xyz")                               # read a point cloud from a file
print("cloud name: %s"%cloud.getName())

res=cc.computeCurvature(cc.CurvatureType.GAUSSIAN_CURV, 0.05, [cloud]) # compute curvature as a scalar field
nsf = cloud.getNumberOfScalarFields()
sfCurv=cloud.getScalarField(nsf-1)
cloud.setCurrentOutScalarField(nsf-1)
filteredCloud=cc.filterBySFValue(0.01, sfCurv.getMax(), cloud)         # keep only the points above a given curvature

ok = filteredCloud.exportCoordToSF(False, False, True)                 # Z coordinate as a scalar Field
nsf = cloud.getNumberOfScalarFields()
sf1=filteredCloud.getScalarField(nsf-1)
mean, var = sf1.computeMeanAndVariance()

# using Numpy...

coordinates = filteredCloud.toNpArrayCopy()                            # coordinates as a numpy array
x=coordinates[:,0]                                                     # x column
y=coordinates[:,1]
z=coordinates[:,2]

f=(2*x-y)*(x+3*y)                                                      # elementwise operation on arrays

asf1=sf1.toNpArray()                                                   # scalar field as a numpy array
sf1.fromNpArrayCopy(f)                                                 # replace scalar field values by a numpy array

res=cc.SavePointCloud(filteredCloud,"myModifiedCloud.bin")             #save the point cloud to a file

As you can see, it is possible to read and write point clouds, access scalar fields from Numpy (with or without copy of data), call some CloudCompare functions to transform point clouds.

The reference documentation gives the list of available methods.

From the Python interpreter, Docstrings provide some documentation on the methods and their arguments.

Release notes

Release notes starts with the October 18, 2021 CloudComPy release as reference. Have a look here.

CloudComPy: availables binaries

CloudComPy is built on Windows and Linux in a Conda environment, which facilitates building and binary portability.

The binary provision includes CloudCompare and its Python interface CloudComPy, the Conda environment provides the IDE Spyder and Jupyter.

The binary are available here. See the instructions below.

CloudComPy: building

Prerequisites for CloudComPy are Python3, BoostPython and Numpy plus, of course, everything needed to build CloudCompare and its plugins.

With CloudComPy you build CloudCompare and the associated Python module.

Compilation is done with CMake, minimum version 3.13 or newer.

prerequisites versions

The minimum required version of each prerequisite is not always precisely identified. Examples of constructions that work are given here.

Windows 10, with Anaconda3 or miniconda3

To build CloudComPy on Windows 10 with conda packages, consult the Windows build documentation in the doc directory.

Linux64, with Anaconda3 or miniconda3

To build CloudComPy on Linux64 with conda packages, consult the Linux Conda build documentation in the doc directory.

Ubuntu 20.04, native packages

To build CloudComPy on Ubuntu 20.04, consult the Ubuntu build documentation in the doc directory.

cloudcompy's People

Contributors

dgirardeau avatar prascle avatar

Watchers

 avatar

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.