diff --git a/src/Mod/ReverseEngineering/App/AppReverseEngineeringPy.cpp b/src/Mod/ReverseEngineering/App/AppReverseEngineeringPy.cpp index cdad9153d..b50ee0f19 100644 --- a/src/Mod/ReverseEngineering/App/AppReverseEngineeringPy.cpp +++ b/src/Mod/ReverseEngineering/App/AppReverseEngineeringPy.cpp @@ -84,7 +84,9 @@ static PyObject * triangulate(PyObject *self, PyObject *args) { PyObject *pcObj; - if (!PyArg_ParseTuple(args, "O!", &(Points::PointsPy::Type), &pcObj)) + double searchRadius; + double mu=2.5; + if (!PyArg_ParseTuple(args, "O!d|d", &(Points::PointsPy::Type), &pcObj, &searchRadius, &mu)) return NULL; Points::PointsPy* pPoints = static_cast(pcObj); @@ -92,7 +94,7 @@ triangulate(PyObject *self, PyObject *args) Mesh::MeshObject* mesh = new Mesh::MeshObject(); SurfaceTriangulation tria(*points, *mesh); - tria.perform(); + tria.perform(searchRadius, mu); return new Mesh::MeshPy(mesh); } diff --git a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp index e31c01a56..b58a7a151 100644 --- a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp +++ b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.cpp @@ -59,7 +59,7 @@ SurfaceTriangulation::SurfaceTriangulation(const Points::PointKernel& pts, Mesh: { } -void SurfaceTriangulation::perform() +void SurfaceTriangulation::perform(double searchRadius, double mu) { PointCloud::Ptr cloud (new PointCloud); PointCloud::Ptr cloud_with_normals (new PointCloud); @@ -96,8 +96,8 @@ void SurfaceTriangulation::perform() // Set parameters gp3.setInputCloud (cloud_with_normals); gp3.setSearchMethod (tree2); - gp3.setSearchRadius (2.025); - gp3.setMu (2.5); + gp3.setSearchRadius (searchRadius); + gp3.setMu (mu); gp3.setMaximumNearestNeighbors (100); gp3.setMaximumSurfaceAngle(M_PI/4); // 45 degrees gp3.setMinimumAngle(M_PI/18); // 10 degrees diff --git a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h index 5310c2d35..33d354538 100644 --- a/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h +++ b/src/Mod/ReverseEngineering/App/SurfaceTriangulation.h @@ -33,7 +33,7 @@ class SurfaceTriangulation { public: SurfaceTriangulation(const Points::PointKernel&, Mesh::MeshObject&); - void perform(); + void perform(double searchRadius, double mu); private: const Points::PointKernel& myPoints;