Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem
- Date: Fri, 9 Feb 2018 08:22:37 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:obnQ0h1HDkLbKJTIsmDT+DRfVm0co7zxezQtwd8ZseIeIvad9pjvdHbS+e9qxAeQG9mDsrQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPfglEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb5Sqw5VDqg4qplURPklCgKPCM9/GzXlsB8iaRWqw+jqRNi2Y7ZeJybOuRwfq3dft0US2ROUclTWCNdDY2xdJcPAugbMOpEs4XwqVkDoB2jDgesHuPvzTpIi2f40aMnzesuChvJ3Bc8H9IPrnvUqsj+OqEVUeCvzanIyinDZO5S1Tn89ofIdRUhru+QXbJqccvfyVMgGB/ZjlWXs4zkPzaZ2uoQuGWc9OpgUeWvi3QmqwF2vjij3MIsio3Si4Iaz1DL7yR5wIIvKdKkT057ZMepHZ1NvC+UMIt2R9ktQ2BuuCsizL0Jo4W0czMOyJs53RLQd/uHc42Q7h3/W+aeOzN4iGhieLKliBa/91WrxO7kVsSs0ltHoTBJnsTSun0NzRDe6daLRuFy80qjwTqC1QPe5vtaLU07lKfXMYMtz7o+m5YJs0nOHin7k1jsgqCMbEUr4O2o5vznYrr4op+cMJd5igTkPaQvnsyzGOo5Mg0SU2SC9+Sx27/u8Vf2QLVNif02na3Zv47AKcsHoa65BhdZ0ocl6xmhEzeryNYVkHYdIF5YZh6Kj5LlNlLQLPziAvqygUygkDJxyPDHOr3hDI/NLn/GkLr5ZrZ970lcyBAyzdBY+5JYELQBIPboV0/+sdzXFB45Mwiuz+n7D9V905sSWXiTDa+BLKPSrViI6/ozLOmDfoAVvC/xJOUk5/71kXA5hEQdfbKy0JsMaHG4G+xmLF+DbXrthNcBC2YKsRAkQOzkkl3RGQJUMn29VqZ56jAgA5+9Fq/CQJqsifqPxnSVBJpTMyp9B1qFCmvpeoPMf/AWaSWOao9OnzsBWKS7WqEo3g2prh67gfIzNe7T4CwfqdTm0PB64uTSkVc58jkiXJfV6H2EU2whxjBAfDQxxq0q/BQkmwWzlJNgivkdLuR9ovZAUwM0L5nZlrUoBNX7WwaHddCMGg//HoeWRAopR9d0+OcgJl5nEoz73B/G1iuuRbQSku7TXcFmwufnx3H0Yv1F5TPG2a0m1QR0R8JOMSi5g/Y6+VSMQYHOlEqdmuChcqFOhCM=
On 02/09/2018 03:41 AM, williamlai3a wrote:
Hi All,
I am a newbie to CGAL, I am trying code from CGAL github master build
(v4.12) to do 3D point set processing.
I am using the following:
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef CGAL::Point_set_3<Point> Point_set;
However, in my original .xyz point cloud, I am having high precision like:
841293.765978 818818.600281 90.933151
841293.765000 818818.599880 90.906294
841293.764292 818818.599046 90.960005
841284.839693 818813.763807 90.725665
841284.822854 818813.767425 90.684145
841284.822320 818813.766970 90.696840
841284.821787 818813.766515 90.709534
841284.825319 818813.768227 90.721745
After processing normal, and I write back the points to a .xyz, the point
precision becomes:
841294 818819 90.9332 0 0 0
841294 818819 90.9063 0 0 0
841294 818819 90.96 0 0 0
841285 818814 90.7257 0 0 0
841285 818814 90.6841 0 0 0
841285 818814 90.6968 0 0 0
841285 818814 90.7095 0 0 0
841285 818814 90.7217 0 0 0
Problem 1:
Seems to me that the output is being trimmed to 6 significant figure.
Are there any ways to output much higher significant figure, say 12?
6 is the default precision of the stream. You can increase the precision
(the max being 17 if you want to guarantee that a value will be identical to the one wrote when you read it).
Try something like:
std::ofstream output("out.xyz");
output << std::setprecision(17);
Problem 2:
In my normal reconstruction processing, I am trying to use the following:
// Computes average spacing.
const unsigned int nb_neighbors = 6; // 1 ring
FT average_spacing = CGAL::compute_average_spacing<Concurrency_tag>(
point_sets, // CGAL::Point_set_3<Point>
nb_neighbors,
CGAL::parameters::point_map(point_sets.point_map())
);
point_sets.add_normal_map();
CGAL::vcm_estimate_normals(
point_sets,
CGAL::to_double(average_spacing)*20,
CGAL::to_double(average_spacing),
CGAL::parameters::point_map(point_sets.point_map()).
normal_map(point_sets.normal_map())
);
Point_set::iterator unoriented_points_begin =
CGAL::mst_orient_normals(point_sets,
nb_neighbors,
CGAL::parameters::point_map(point_sets.point_map()).
normal_map(point_sets.normal_map())
);
// Optional: delete points with an unoriented normal
// if you plan to call a reconstruction algorithm that expects
oriented normals.
point_sets.remove(unoriented_points_begin, point_sets.end());
point_sets.collect_garbage();
As you can see from the above output, all normals are <0 0 0>
However, my point cloud contains a lot of planar surfaces with different
orientation.
Are there any things wrong with my code? Parameter problem? or I am doing in
a wrong concept way.
It has probably something to do with the parameters.
Did you try `jet_estimate_normals` that is easier to use?
https://doc.cgal.org/latest/Point_set_processing_3/group__PkgPointSetProcessingAlgorithms.html#ga2ab9546e4d0ef01bd8a26e748046b26a
Sebastien.
Thank you very much in advance for any suggestions and recommendation.
Best regards,
William
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, williamlai3a, 02/09/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, Sebastien Loriot (GeometryFactory), 02/09/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, Andreas Fabri, 02/09/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, williamlai3a, 02/12/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, williamlai3a, 02/12/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, Simon Giraudot, 02/12/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, williamlai3a, 02/20/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, Simon Giraudot, 02/12/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, williamlai3a, 02/12/2018
- Re: [cgal-discuss] CGAL::write_xyz_point_set precision and normal problem, Sebastien Loriot (GeometryFactory), 02/09/2018
Archive powered by MHonArc 2.6.18.