Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new CloudComPy release based on CloudCompare 2.13.1 #175

Merged
merged 8 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions TODO_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ TODO List
* DONE: ScalarFields: gaussian & bilateral filters
* DONE: (issue #156) improve documentation on LabelConnectedComponents. Fix the scalarfield for display (compute min & max, set current)
* DONE: plugin Cork (idem mesh boolean, faster)
* DONE: (issue #162) SAVE ccMesh <CC_FILE_ERROR.CC_FERR_BROKEN_DEPENDENCY_ERROR: 13>
* DONE: (issue #163) Add default arguments to ICP function
* DONE: (issue #167) Distance map: try to use the same scalar field names as CloudCompare
* DONE: (issue #170) Color scale: select in a list, edit
* DONE: (issue #172) add quaternion input for transformations
- TODO: try to have ctest working at build step on Windows and Linux (incomplete)
- TODO: A kind of automatic test coverage, to find examples for a particular function.
- TODO: Fix the Link problem in Windows to avoid the option /force:multiple at link step
Expand Down Expand Up @@ -209,3 +214,4 @@ TODO List
- TODO: plugin 3DFin ?
- TODO: (issue #154) plugin MeshIO ?
- TODO: study convergence with Python plugin

2 changes: 1 addition & 1 deletion doc/BuildLinuxConda.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ conda_buildenv()
fi
conda config --add channels conda-forge && \
conda config --set channel_priority strict && \
conda install -y "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2" || error_exit "conda environment ${CONDA_ENV} cannot be completed"
conda install -y "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 quaternion "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2" || error_exit "conda environment ${CONDA_ENV} cannot be completed"
}

# --- CloudComPy build
Expand Down
2 changes: 1 addition & 1 deletion doc/BuildWindowsConda.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ conda create -y --name CloudComPy310 python=3.10
conda activate CloudComPy310
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install -y "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2"
conda install -y "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 quaternion "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2"
```
For information, the list of packages actually installed for building and testing can be found in `building/conda-list`.

Expand Down
9 changes: 9 additions & 0 deletions doc/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

These release notes start with the October 18, 2021 CloudComPy release.

## June 13, 2024 CloudCompy release:

- (issue #162) SAVE ccMesh <CC_FILE_ERROR.CC_FERR_BROKEN_DEPENDENCY_ERROR: 13>
- (issue #163) Add default arguments to ICP function
- (issue #167) Distance map: try to use the same scalar field names as CloudCompare
- (issue #170) Color scale: select in a list, edit
- (issue #172) add quaternion input for transformations (requires numpy quaternion package to be useful)
- some small fixes.

## April 20, 2024 CloudCompy release:

- update to **CloudCompare 2.13.1** (March 20, 2024): official release.
Expand Down
2 changes: 1 addition & 1 deletion doc/UseLinuxCondaBinary.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Add or update the packages:
conda activate CloudComPy310
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2"
conda install "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 quaternion "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2"
```

**Remark:** if conda is unknown, or in a bash script, add the following instruction before conda commands:
Expand Down
2 changes: 1 addition & 1 deletion doc/UseMacOSCondaBinary.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Add or update the packages:
conda activate CloudComPy310
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install "boost" "cgal" cmake draco ffmpeg "gdal" jupyterlab laszip "matplotlib" "mysql=8.0" "numpy" "opencv" "openssl=3.0.8" "pcl" "pdal" "psutil" pybind11 "qhull=2020.2" "qt=5.15.8" "scipy" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2" xorg-libx11 || error_exit "conda environment ${CONDA_ENV} cannot be completed"
conda install "boost" "cgal" cmake draco ffmpeg "gdal" jupyterlab laszip "matplotlib" "mysql=8.0" "numpy" "opencv" "openssl=3.0.8" "pcl" "pdal" "psutil" pybind11 quaternion "qhull=2020.2" "qt=5.15.8" "scipy" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2" xorg-libx11 || error_exit "conda environment ${CONDA_ENV} cannot be completed"
```

Unzip the binary tarfile in the directory of your choice.
Expand Down
2 changes: 1 addition & 1 deletion doc/UseWindowsCondaBinary.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Add or update the packages:
conda activate CloudComPy310
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2"
conda install "boost=1.74" "cgal=5.4" cmake draco ffmpeg "gdal=3.5" jupyterlab laszip "matplotlib=3.5" "mysql=8.0" "numpy=1.22" "opencv=4.5" "openmp=8.0" "pcl=1.12" "pdal=2.4" "psutil=5.9" pybind11 quaternion "qhull=2020.2" "qt=5.15.4" "scipy=1.8" sphinx_rtd_theme spyder tbb tbb-devel "xerces-c=3.2"
```

Install the binary in the directory of your choice.
Expand Down
34 changes: 17 additions & 17 deletions pybind11/SRA/SRAPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,23 +223,23 @@ PYBIND11_MODULE(_SRA, m8)
.value("FILL_INTERPOLATE", DistanceMapGenerationTool::EmptyCellFillOption::FILL_INTERPOLATE)
.export_values();

py::enum_<ccColorScalesManager::DEFAULT_SCALES>(m8, "DEFAULT_SCALES")
.value("BGYR", ccColorScalesManager::DEFAULT_SCALES::BGYR)
.value("GREY", ccColorScalesManager::DEFAULT_SCALES::GREY)
.value("BWR", ccColorScalesManager::DEFAULT_SCALES::BWR)
.value("RY", ccColorScalesManager::DEFAULT_SCALES::RY)
.value("RW", ccColorScalesManager::DEFAULT_SCALES::RW)
.value("ABS_NORM_GREY", ccColorScalesManager::DEFAULT_SCALES::ABS_NORM_GREY)
.value("HSV_360_DEG", ccColorScalesManager::DEFAULT_SCALES::HSV_360_DEG)
.value("VERTEX_QUALITY", ccColorScalesManager::DEFAULT_SCALES::VERTEX_QUALITY)
.value("DIP_BRYW", ccColorScalesManager::DEFAULT_SCALES::DIP_BRYW)
.value("DIP_DIR_REPEAT", ccColorScalesManager::DEFAULT_SCALES::DIP_DIR_REPEAT)
.value("VIRIDIS", ccColorScalesManager::DEFAULT_SCALES::VIRIDIS)
.value("BROWN_YELLOW", ccColorScalesManager::DEFAULT_SCALES::BROWN_YELLOW)
.value("YELLOW_BROWN", ccColorScalesManager::DEFAULT_SCALES::YELLOW_BROWN)
.value("TOPO_LANDSERF", ccColorScalesManager::DEFAULT_SCALES::TOPO_LANDSERF)
.value("HIGH_CONTRAST", ccColorScalesManager::DEFAULT_SCALES::HIGH_CONTRAST)
.export_values();
// py::enum_<ccColorScalesManager::DEFAULT_SCALES>(m8, "DEFAULT_SCALES")
// .value("BGYR", ccColorScalesManager::DEFAULT_SCALES::BGYR)
// .value("GREY", ccColorScalesManager::DEFAULT_SCALES::GREY)
// .value("BWR", ccColorScalesManager::DEFAULT_SCALES::BWR)
// .value("RY", ccColorScalesManager::DEFAULT_SCALES::RY)
// .value("RW", ccColorScalesManager::DEFAULT_SCALES::RW)
// .value("ABS_NORM_GREY", ccColorScalesManager::DEFAULT_SCALES::ABS_NORM_GREY)
// .value("HSV_360_DEG", ccColorScalesManager::DEFAULT_SCALES::HSV_360_DEG)
// .value("VERTEX_QUALITY", ccColorScalesManager::DEFAULT_SCALES::VERTEX_QUALITY)
// .value("DIP_BRYW", ccColorScalesManager::DEFAULT_SCALES::DIP_BRYW)
// .value("DIP_DIR_REPEAT", ccColorScalesManager::DEFAULT_SCALES::DIP_DIR_REPEAT)
// .value("VIRIDIS", ccColorScalesManager::DEFAULT_SCALES::VIRIDIS)
// .value("BROWN_YELLOW", ccColorScalesManager::DEFAULT_SCALES::BROWN_YELLOW)
// .value("YELLOW_BROWN", ccColorScalesManager::DEFAULT_SCALES::YELLOW_BROWN)
// .value("TOPO_LANDSERF", ccColorScalesManager::DEFAULT_SCALES::TOPO_LANDSERF)
// .value("HIGH_CONTRAST", ccColorScalesManager::DEFAULT_SCALES::HIGH_CONTRAST)
// .export_values();

py::class_<qSRA>(m8, "qSRA", SRA_qSRA_doc)
.def(py::init<>(), SRA_qSRA_ctor_doc)
Expand Down
1 change: 1 addition & 0 deletions pybind11/SRA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
import cloudComPy.SRA
cc.SRA.loadProfile(...)
"""
from cloudComPy import DEFAULT_SCALES
from _SRA import *
initTrace_SRA()
7 changes: 7 additions & 0 deletions pybind11/ScalarFieldPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ const ScalarType& (CCCoreLib::ScalarField::* getValue2)(std::size_t) const = &CC
//typedef const ScalarType& (CCCoreLib::ScalarField::*gvftype)(std::size_t) const; // the same using a typedef
//gvftype getValue2 = &CCCoreLib::ScalarField::getValue;

void setColorScalePy(ccScalarField& self, ccColorScale* scale)
{
QSharedPointer<ccColorScale> shared = QSharedPointer<ccColorScale>(scale);
self.setColorScale(shared);
}

void export_ScalarField(py::module &m0)
{
py::class_<CCCoreLib::ScalarField, std::unique_ptr<CCCoreLib::ScalarField, py::nodelete>>(m0, "ScalarField",
Expand Down Expand Up @@ -105,6 +111,7 @@ void export_ScalarField(py::module &m0)
.def(py::init<const char*>(), py::arg("name")=nullptr, ccScalarFieldPy_ccScalarField_ctor_doc)
.def("isSerializable", &ccScalarField::isSerializable)
.def("getGlobalShift", &ccScalarField::getGlobalShift, ccScalarFieldPy_getGlobalShift_doc)
.def("setColorScale", &setColorScalePy, ccScalarFieldPy_setColorScale_doc)
;

//TODO add serialization functions
Expand Down
6 changes: 6 additions & 0 deletions pybind11/ScalarFieldPy_DocStrings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@ Used for instance for LAS GPS time shift

)";

const char* ccScalarFieldPy_setColorScale_doc= R"(
Sets associated color scale

:param ccColorScale scale: the color scale
)";

#endif /* SCALARFIELDPY_DOCSTRINGS_HPP_ */
16 changes: 15 additions & 1 deletion pybind11/ccMeshPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@ bool flagVerticesByType_py(ccGenericMesh* mesh)

}

ccMesh* meshTriangulate_py(ccGenericPointCloud* cloud,
CCCoreLib::TRIANGULATION_TYPES type,
bool updateNormals/*=false*/,
PointCoordinateType maxEdgeLength/*=0*/,
unsigned char dim/*=2*/)
{
ccMesh* mesh = ccMesh::Triangulate(cloud, type, updateNormals, maxEdgeLength, dim);
if (mesh)
{
mesh->addChild(cloud);
}
return mesh;
}

void export_ccMesh(py::module &m0)
{
py::class_<CCCoreLib::MeshSamplingTools::EdgeConnectivityStats>(m0, "EdgeConnectivityStats", ccMeshPy_EdgeConnectivityStats_doc)
Expand Down Expand Up @@ -220,7 +234,7 @@ void export_ccMesh(py::module &m0)
ccMeshPy_laplacianSmooth_doc)
.def("subdivide", &ccMesh::subdivide, py::return_value_policy::reference, ccMeshPy_subdivide_doc)
.def_static("triangulate",
&ccMesh::Triangulate,
&meshTriangulate_py,
py::arg("cloud"), py::arg("type"), py::arg("updateNormals")=false, py::arg("maxEdgeLength")=0, py::arg("dim")=2,
ccMeshPy_triangulate_doc, py::return_value_policy::reference)
.def_static("triangulateTwoPolylines",
Expand Down
89 changes: 89 additions & 0 deletions pybind11/ccPrimitivesPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <ccSphere.h>
#include <ccTorus.h>
#include <ccDish.h>
#include <SquareMatrix.h>
#include "ccPrimitivesPy_DocStrings.hpp"
#include "pyccTrace.h"

Expand Down Expand Up @@ -125,6 +126,86 @@ ccGLMatrixd FromViewDirAndUpDir_double(const Vector3Tpl<double>& forward, const
return ccGLMatrixd(ccGLMatrixTpl<double>::FromViewDirAndUpDir(forward, up));
}

ccGLMatrix FromQuaternionAndTranslation_float(const std::vector<float>& quaternion, const Vector3Tpl<float>& depl=Vector3Tpl<float>())
{
if (quaternion.size() != 4)
{
CCTRACE("incorrect quaternion size, must have 4 floats!");
return ccGLMatrix();
}
double norm = 0;
for (int i=0; i<4; i++)
{
norm += quaternion[i]*quaternion[i];
}
norm = sqrt(norm);
if (norm == 0)
{
CCTRACE("quaternion norm is null!");
return ccGLMatrix();
}
float normed[4];
if (abs(norm - 1) < 1.e-7)
norm = 1;
for (int i=0; i<4; i++)
{
normed[i] = quaternion[i]/norm;
}
CCCoreLib::SquareMatrixTpl<float> rot = CCCoreLib::SquareMatrixTpl<float>();
rot.initFromQuaternion(normed);
ccGLMatrixTpl<float> trans = FromCCLibMatrix<float,float>(rot, depl);
return trans;
}

ccGLMatrixd FromQuaternionAndTranslation_double(const std::vector<double>& quaternion, const Vector3Tpl<double>& depl=Vector3Tpl<double>())
{
if (quaternion.size() != 4)
{
CCTRACE("incorrect quaternion size, must have 4 double!");
return ccGLMatrixd();
}
double norm = 0;
for (int i=0; i<4; i++)
{
norm += quaternion[i]*quaternion[i];
}
norm = sqrt(norm);
if (norm == 0)
{
CCTRACE("quaternion norm is null!");
return ccGLMatrixd();
}
if (abs(norm - 1) < 1.e-7)
norm = 1;
double normed[4];
for (int i=0; i<4; i++)
{
normed[i] = quaternion[i]/norm;
}
CCCoreLib::SquareMatrixTpl<double> rot = CCCoreLib::SquareMatrixTpl<double>();
rot.initFromQuaternion(normed);
ccGLMatrixTpl<double> trans = FromCCLibMatrix<double,double>(rot, depl);
return trans;
}

std::vector<double> toQuaternion_double(ccGLMatrixTpl<double>& self)
{
CCCoreLib::SquareMatrixTpl<double> rot = CCCoreLib::SquareMatrixTpl<double>(self.data(), true);
std::vector<double> quat;
quat.resize(4);
rot.toQuaternion(&quat[0]);
return quat;
}

std::vector<double> toQuaternion_float(ccGLMatrixTpl<float>& self)
{
CCCoreLib::SquareMatrixTpl<float> rot = CCCoreLib::SquareMatrixTpl<float>(self.data(), true);
std::vector<double> quat;
quat.resize(4);
rot.toQuaternion(&quat[0]);
return quat;
}

ccGLMatrix xRotation_float(ccGLMatrixTpl<float>& self)
{
return ccGLMatrix(self.xRotation());
Expand Down Expand Up @@ -443,11 +524,15 @@ void export_ccPrimitives(py::module &m0)
.def("FromToRotation", &FromToRotation_float, ccPrimitivesPy_FromToRotation_doc)
.def("Interpolate", &Interpolate_float, ccPrimitivesPy_Interpolate_doc)
.def("FromViewDirAndUpDir", &FromViewDirAndUpDir_float, ccPrimitivesPy_FromViewDirAndUpDir_doc)
.def_static("FromQuaternionAndTranslation", &FromQuaternionAndTranslation_float,
py::arg("quaternion"), py::arg("depl")=Vector3Tpl<float>(),
ccPrimitivesPy_FromQuaternionAndTranslation_doc)
.def("xRotation", &xRotation_float, ccPrimitivesPy_xRotation_doc)
.def("yRotation", &yRotation_float, ccPrimitivesPy_yRotation_doc)
.def("zRotation", &zRotation_float, ccPrimitivesPy_zRotation_doc)
.def("inverse", &inverse_float, ccPrimitivesPy_inverse_doc)
.def("transposed", &transposed_float, ccPrimitivesPy_transposed_doc)
.def("toQuaternion", &toQuaternion_float, ccPrimitivesPy_toQuaternion_doc)
;

py::class_<ccGLMatrixd, ccGLMatrixTpl<double> >(m0, "ccGLMatrixd", ccPrimitivesPy_ccGLMatrixd_doc)
Expand All @@ -459,11 +544,15 @@ void export_ccPrimitives(py::module &m0)
.def("FromToRotation", &FromToRotation_double, ccPrimitivesPy_FromToRotation_doc)
.def("Interpolate", &Interpolate_double, ccPrimitivesPy_Interpolate_doc)
.def("FromViewDirAndUpDir", &FromViewDirAndUpDir_double, ccPrimitivesPy_FromViewDirAndUpDir_doc)
.def_static("FromQuaternionAndTranslation", &FromQuaternionAndTranslation_double,
py::arg("quaternion"), py::arg("depl")=Vector3Tpl<double>(),
ccPrimitivesPy_FromQuaternionAndTranslation_doc)
.def("xRotation", &xRotation_double, ccPrimitivesPy_xRotation_doc)
.def("yRotation", &yRotation_double, ccPrimitivesPy_yRotation_doc)
.def("zRotation", &zRotation_double, ccPrimitivesPy_zRotation_doc)
.def("inverse", &inverse_double, ccPrimitivesPy_inverse_doc)
.def("transposed", &transposed_double, ccPrimitivesPy_transposed_doc)
.def("toQuaternion", &toQuaternion_double, ccPrimitivesPy_toQuaternion_doc)
;

py::class_<ccGenericPrimitive, PyccGenericPrimitive>(m0, "ccGenericPrimitive") //boost::noncopyable, no_init
Expand Down
30 changes: 30 additions & 0 deletions pybind11/ccPrimitivesPy_DocStrings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,36 @@ Generates a 'viewing' matrix from a looking vector and a 'up' direction.
:return: rotation matrix
:rtype: ccGLMatrix)";

const char* ccPrimitivesPy_FromQuaternionAndTranslation_doc= R"(
Generates a transformation from a quaternion and an optional translation.

A normalized quaternion such as \|q\| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1,
can also be expressed as:
q = {cos(θ/2), ux*sin(θ/2), uy*sin(θ/2), uz*sin(θ/2)}
where (ux, uy, uz) represent the components of a unit vector u, and θ is an angle.
The quaternion defines a rotation around the vector u, of angle θ.
Here, if q is not normalized, q is divided by its euclidian norm \|q\|.

:param list[float] quaternion: a quaternion formed from 4 floats.
:param CCVector3,optional depl: an optional translation.

:return: transformation matrix
:rtype: ccGLMatrix
)";

const char* ccPrimitivesPy_toQuaternion_doc= R"(
Generates the quaternion corresponding to the rotation part of the transformation.

A normalized quaternion such as \|q\| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1,
can also be expressed as:
q = {cos(θ/2), ux*sin(θ/2), uy*sin(θ/2), uz*sin(θ/2)}
where (ux, uy, uz) represent the components of a unit vector u, and θ is an angle.
The quaternion defines a rotation around the vector u, of angle θ.

:return: the normalized rotation quaternion
:rtype: list of 4 double
)";

const char* ccPrimitivesPy_xRotation_doc= R"(
Returns the rotation component around X only.

Expand Down
25 changes: 16 additions & 9 deletions pybind11/cloudComPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ struct ICPres

ICPres ICP_py( ccHObject* data,
ccHObject* model,
double minRMSDecrease,
unsigned maxIterationCount,
unsigned randomSamplingLimit,
bool removeFarthestPoints,
CCCoreLib::ICPRegistrationTools::CONVERGENCE_TYPE method,
bool adjustScale,
double minRMSDecrease=1.e-5,
unsigned maxIterationCount=20,
unsigned randomSamplingLimit=50000,
bool removeFarthestPoints=false,
CCCoreLib::ICPRegistrationTools::CONVERGENCE_TYPE method=CCCoreLib::ICPRegistrationTools::CONVERGENCE_TYPE::MAX_ITER_CONVERGENCE,
bool adjustScale=false,
double finalOverlapRatio = 1.0,
bool useDataSFAsWeights = false,
bool useModelSFAsWeights = false,
Expand Down Expand Up @@ -2807,9 +2807,16 @@ PYBIND11_MODULE(_cloudComPy, m0)
;

m0.def("ICP", &ICP_py,
py::arg("data"), py::arg("model"), py::arg("minRMSDecrease"), py::arg("maxIterationCount"), py::arg("randomSamplingLimit"),
py::arg("removeFarthestPoints"), py::arg("method"), py::arg("adjustScale"), py::arg("finalOverlapRatio")=1.0,
py::arg("useDataSFAsWeights")=false, py::arg("useModelSFAsWeights")=false,
py::arg("data"), py::arg("model"),
py::arg("minRMSDecrease")=1.E-5,
py::arg("maxIterationCount")=20,
py::arg("randomSamplingLimit")=50000,
py::arg("removeFarthestPoints")=false,
py::arg("method")=CCCoreLib::ICPRegistrationTools::CONVERGENCE_TYPE::MAX_ITER_CONVERGENCE,
py::arg("adjustScale")=false,
py::arg("finalOverlapRatio")=1.0,
py::arg("useDataSFAsWeights")=false,
py::arg("useModelSFAsWeights")=false,
py::arg("transformationFilters")=CCCoreLib::RegistrationTools::SKIP_NONE,
py::arg("maxThreadCount")=0,
cloudComPy_ICP_doc);
Expand Down
Loading