Subject: CGAL users discussion list
List archive
- From: Comeylo <>
- To:
- Subject: [cgal-discuss] Points set simplification with indexes tracking
- Date: Wed, 1 Jul 2015 06:57:10 -0700 (PDT)
Hello to all the CGAL users and developpers that will come across this post,
I wished to compute given an initial set of points an open polyhedral
surface. This I have managed to achieve so far.
What I would like to do now, is to be able to reduce the number of points
used to build this polyhedral surface (Polyhedron_3 object). I would like to
stop reducing the number of points if a certain criteria drops below a given
value.
First I would like to avoid rebuilding the polyhedron each time as I reduce
the number of pooints (which I hope to achieve by deleting vertices and
correcting the mesh). Secondly, I also would like to have to avoid to
recompute the curvature where it is not necessary, and only where I took off
points. This is why I am interested in the
CGAL::wlop_simplify_and_regularize_point_set function, combined with the
boost::tuple to keep track of the indexes.
My problem is the following :
I need to keep track of the points indexes as they are processed by the
CGAL::wlop_simplify_and_regularize_point_set function.
The function example : CGAL::compute_average_spacing (
http://doc.cgal.org/latest/Point_set_processing_3/group__PkgPointSetProcessing.html#gaf9f4b713515bf1a3938648bb341bc65a
<http://doc.cgal.org/latest/Point_set_processing_3/group__PkgPointSetProcessing.html#gaf9f4b713515bf1a3938648bb341bc65a>
)
seems to deal fine with the use of boost::tuple.
And I can have the function CGAL::wlop_simplify_and_regularize_point_set
works with boost::tuple as input, yet I wish to transfer the indexes to the
newly pushed back points in the output vector.
If I declare my output vector as a boost::tuple vector it doesn't work,
because it seems not to be meant to work.
Is it the case ?
Here comes the code that doesn't compile, with the error in the end. It
compiles if the ouput vector is a vector of points., and even runs fine, but
without the ids attached to the ouput points, of course.
//Boost tuple include
#include <boost/tuple/tuple.hpp>
//Property mapped point definition
typedef boost::tuple<unsigned int, Point> IndexedPoint;
std::vector<IndexedPoint> points(x_point_set_values_.size());
for (std::size_t i = 0; i < x_point_set_values_.size(); ++i)
{
points[i].get<0>() = (unsigned int)i;
points[i].get<1>() = Point(x_point_set_values_[i],
y_point_set_values_[i],
z_point_set_values_[i]);
}
std::vector<IndexedPoint> output;
//parameters
const double retain_percentage = 4; // percentage of points to retain.
const double neighbor_radius = 0.5; // neighbors size.
CGAL::wlop_simplify_and_regularize_point_set
<CGAL::Parallel_tag> // parallel version
(points.begin(),
points.end(),
std::back_inserter(output),
CGAL::Nth_of_tuple_property_map<1, IndexedPoint>(),
retain_percentage,
neighbor_radius,
35U,
false
);
Error 1 error C2679: binary '=' : no operator found which takes a
right-hand
operand of type 'CGAL::Point_3<Kernel_>' (or there is no acceptable
conversion)
C:\dev\x64\CGAL\include\CGAL\wlop_simplify_and_regularize_point_set.h
Of course : *output++ = *sample_iter; where :typename
std::vector<Point>::iterator sample_iter; is clearly not a vector of
boost::tuple, whereas output is.
Do I need to adapt the CGAL code to this specific use, or am I
misunderstanding something ?
If there is a need to put something I forgot, just mention it. And I hope
the form of the email is respected.
Thanks in advance,
Côme
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Points-set-simplification-with-indexes-tracking-tp4660963.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Points set simplification with indexes tracking, Comeylo, 07/01/2015
Archive powered by MHonArc 2.6.18.