MOD: ReverseEngineering clean (#20555)
* MOD: ReverseEngineering clean code . removed old code pcl lib is alwais >then 1.7 (ubuntu 20.04 use pcl 1.10) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -37,13 +37,11 @@
|
||||
#include "BSplineFitting.h"
|
||||
|
||||
#include <pcl/pcl_config.h>
|
||||
#if PCL_VERSION_COMPARE(>=, 1, 7, 0)
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/point_cloud.h>
|
||||
#include <pcl/point_types.h>
|
||||
#include <pcl/surface/on_nurbs/fitting_curve_2d_asdm.h>
|
||||
#include <pcl/surface/on_nurbs/fitting_surface_tdm.h>
|
||||
#endif
|
||||
|
||||
using namespace Reen;
|
||||
|
||||
@@ -96,7 +94,6 @@ void BSplineFitting::setBoundaryWeight(double value)
|
||||
|
||||
Handle(Geom_BSplineSurface) BSplineFitting::perform()
|
||||
{
|
||||
#if PCL_VERSION_COMPARE(>=, 1, 7, 0)
|
||||
pcl::on_nurbs::NurbsDataSurface data;
|
||||
for (std::vector<Base::Vector3f>::const_iterator it = myPoints.begin(); it != myPoints.end();
|
||||
++it) {
|
||||
@@ -118,7 +115,6 @@ Handle(Geom_BSplineSurface) BSplineFitting::perform()
|
||||
// initialize
|
||||
ON_NurbsSurface nurbs = pcl::on_nurbs::FittingSurface::initNurbsPCABoundingBox(myOrder, &data);
|
||||
pcl::on_nurbs::FittingSurface fit(&data, nurbs);
|
||||
// fit.setQuiet (false); // enable/disable debug output
|
||||
|
||||
// surface refinement
|
||||
for (unsigned i = 0; i < myRefinement; i++) {
|
||||
@@ -134,35 +130,6 @@ Handle(Geom_BSplineSurface) BSplineFitting::perform()
|
||||
fit.solve();
|
||||
}
|
||||
|
||||
// fit B-spline curve
|
||||
#if 0
|
||||
// parameters
|
||||
pcl::on_nurbs::FittingCurve2dAPDM::FitParameter curve_params;
|
||||
curve_params.addCPsAccuracy = 5e-2;
|
||||
curve_params.addCPsIteration = 3;
|
||||
curve_params.maxCPs = 200;
|
||||
curve_params.accuracy = 1e-3;
|
||||
curve_params.iterations = 100;
|
||||
|
||||
curve_params.param.closest_point_resolution = 0;
|
||||
curve_params.param.closest_point_weight = 1.0;
|
||||
curve_params.param.closest_point_sigma2 = 0.1;
|
||||
curve_params.param.interior_sigma2 = 0.00001;
|
||||
curve_params.param.smooth_concavity = 1.0;
|
||||
curve_params.param.smoothness = 1.0;
|
||||
|
||||
// initialisation (circular)
|
||||
pcl::on_nurbs::NurbsDataCurve2d curve_data;
|
||||
curve_data.interior = data.interior_param;
|
||||
curve_data.interior_weight_function.push_back(true);
|
||||
ON_NurbsCurve curve_nurbs = pcl::on_nurbs::FittingCurve2dAPDM::initNurbsCurve2D(order, curve_data.interior);
|
||||
|
||||
// curve fitting
|
||||
pcl::on_nurbs::FittingCurve2dASDM curve_fit (&curve_data, curve_nurbs);
|
||||
// curve_fit.setQuiet (false); // enable/disable debug output
|
||||
curve_fit.fitting (curve_params);
|
||||
#endif
|
||||
|
||||
// u parameters
|
||||
int numUKnots = fit.m_nurbs.KnotCount(0);
|
||||
int numUPoles = fit.m_nurbs.CVCount(0);
|
||||
@@ -246,8 +213,5 @@ Handle(Geom_BSplineSurface) BSplineFitting::perform()
|
||||
uPeriodic,
|
||||
vPeriodic);
|
||||
return spline;
|
||||
#else
|
||||
return Handle(Geom_BSplineSurface)();
|
||||
#endif
|
||||
}
|
||||
#endif // HAVE_PCL_OPENNURBS
|
||||
|
||||
@@ -182,10 +182,6 @@ void SurfaceTriangulation::perform(const std::vector<Base::Vector3f>& normals)
|
||||
gp3.reconstruct(mesh);
|
||||
|
||||
MeshConversion::convert(mesh, myMesh);
|
||||
|
||||
// Additional vertex information
|
||||
// std::vector<int> parts = gp3.getPartIDs();
|
||||
// std::vector<int> states = gp3.getPointStates();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -645,7 +641,6 @@ void Reen::MarchingCubesHoppe::perform(int ksearch)
|
||||
NormalEstimation<PointXYZ, Normal> n;
|
||||
PointCloud<Normal>::Ptr normals(new PointCloud<Normal>());
|
||||
n.setInputCloud(cloud);
|
||||
// n.setIndices (indices[B);
|
||||
n.setSearchMethod(tree);
|
||||
n.setKSearch(ksearch);
|
||||
n.compute(*normals);
|
||||
@@ -747,16 +742,9 @@ void MeshConversion::convert(const pcl::PolygonMesh& pclMesh, Mesh::MeshObject&
|
||||
for (size_t d = 0; d < pclMesh.cloud.fields.size(); ++d) {
|
||||
int c = 0;
|
||||
// adding vertex
|
||||
if ((pclMesh.cloud.fields[d].datatype ==
|
||||
#if PCL_VERSION_COMPARE(>, 1, 6, 0)
|
||||
pcl::PCLPointField::FLOAT32)
|
||||
&&
|
||||
#else
|
||||
sensor_msgs::PointField::FLOAT32)
|
||||
&&
|
||||
#endif
|
||||
(pclMesh.cloud.fields[d].name == "x" || pclMesh.cloud.fields[d].name == "y"
|
||||
|| pclMesh.cloud.fields[d].name == "z")) {
|
||||
if ((pclMesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32)
|
||||
&& (pclMesh.cloud.fields[d].name == "x" || pclMesh.cloud.fields[d].name == "y"
|
||||
|| pclMesh.cloud.fields[d].name == "z")) {
|
||||
float value;
|
||||
memcpy(&value,
|
||||
&pclMesh.cloud.data[i * point_size + pclMesh.cloud.fields[d].offset
|
||||
|
||||
Reference in New Issue
Block a user