Approved by the release manager (SL interim)
This commit is contained in:
Andreas Fabri 2015-02-05 09:40:06 +01:00
parent 84663476e5
commit ef6488a7c6
2 changed files with 10 additions and 9 deletions

View File

@ -10,11 +10,11 @@
typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;
int main(void) int main(int argc, char* argv[])
{ {
const std::string input_filename_without_ext = "data/sphere_20k"; const std::string input_filename_without_ext = "data/sphere_20k";
const std::string input_filename = input_filename_without_ext + ".xyz"; const std::string input_filename = std::string(argv[1]); // input_filename_without_ext + ".xyz";
const std::string OUTPUT_FILENAME = input_filename_without_ext + "_WLOPED.xyz"; const std::string OUTPUT_FILENAME = std::string(argv[2]); //input_filename_without_ext + "_WLOPED.xyz";
// Reads a .xyz point set file in points[] // Reads a .xyz point set file in points[]
std::vector<Point> points; std::vector<Point> points;
@ -31,7 +31,7 @@ int main(void)
std::vector<Point> output; std::vector<Point> output;
//parameters //parameters
const double retain_percentage = 2; // percentage of points to retain. const double retain_percentage = 20; // percentage of points to retain.
const double neighbor_radius = 0.5; // neighbors size. const double neighbor_radius = 0.5; // neighbors size.
CGAL::wlop_simplify_and_regularize_point_set CGAL::wlop_simplify_and_regularize_point_set
@ -39,8 +39,9 @@ int main(void)
(points.begin(), (points.begin(),
points.end(), points.end(),
std::back_inserter(output), std::back_inserter(output),
retain_percentage, retain_percentage//,
neighbor_radius); //neighbor_radius
);
std::ofstream out(OUTPUT_FILENAME.c_str()); std::ofstream out(OUTPUT_FILENAME.c_str());
if (!out || !CGAL::write_xyz_points( if (!out || !CGAL::write_xyz_points(

View File

@ -436,14 +436,14 @@ wlop_simplify_and_regularize_point_set(
///< This is a key parameter that needs to be finely tuned. ///< This is a key parameter that needs to be finely tuned.
///< The result will be irregular if too small, but a larger ///< The result will be irregular if too small, but a larger
///< value will impact the runtime. ///< value will impact the runtime.
///< In practice, choosing a radius such that each point has at least4 neighbors ///< In practice, choosing a radius such that each point has at least 4 neighbors
///< gives satisfactory result. ///< gives satisfactory result.
///< The default value is set to `0.05 * diameter of bounding box`. ///< The default value is set to 0.05 * the diameter of the bounding box.
unsigned int iter_number, ///< number of iterations to solve the optimsation problem. The default value is 35. unsigned int iter_number, ///< number of iterations to solve the optimsation problem. The default value is 35.
///< More iterations give a more regular result but increase the runtime. ///< More iterations give a more regular result but increase the runtime.
bool require_uniform_sampling,///< an optional preprocessing, which will give better result bool require_uniform_sampling,///< an optional preprocessing, which will give better result
///< if the distribution of the input points is highly non-uniform. ///< if the distribution of the input points is highly non-uniform.
///< The default value is false. ///< The default value is `false`.
const Kernel& ///< geometric traits. const Kernel& ///< geometric traits.
) )
{ {