\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.5 - Point Set Processing
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Point Set Processing Reference

point_set_processing_detail.png
Pierre Alliez, Laurent Saboret, Nader Salman
This CGAL component implements methods to analyze and process unorganized point sets. The input is an unorganized point set, possibly with normal attributes (unoriented or oriented). The point set can be analyzed to measure its average spacing, and processed through functions devoted to the simplification, outlier removal, smoothing, normal estimation and normal orientation.


Introduced in: CGAL 3.5
Depends on: Eigen
BibTeX: cgal:ass-psp-14b
License: GPL
Windows Demo: See Polyhedral Surface
Common Demo Dlls: dlls

Classified Reference Pages

Functions

Classes

struct  CGAL::value_type_traits< T >
 Class providing the value type of an iterator, and in the case of an output iterator, a type of objects that can be put in it. More...
 

Functions

template<typename InputIterator , typename PointPMap , typename Kernel >
Kernel::FT CGAL::compute_average_spacing (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, const Kernel &)
 Computes average spacing from k nearest neighbors. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
ForwardIterator CGAL::grid_simplify_point_set (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, double epsilon, const Kernel &)
 Merges points which belong to the same cell of a grid of cell size = epsilon. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::read_off_points_and_normals (std::istream &stream, OutputIterator output, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Reads points (positions + normals, if available) from a .off ASCII stream. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename Kernel >
bool CGAL::read_off_points (std::istream &stream, OutputIterator output, PointPMap point_pmap, const Kernel &kernel)
 Reads points (position only) from a .off ASCII stream. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::read_xyz_points_and_normals (std::istream &stream, OutputIterator output, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Reads points (positions + normals, if available) from a .xyz ASCII stream. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename Kernel >
bool CGAL::read_xyz_points (std::istream &stream, OutputIterator output, PointPMap point_pmap, const Kernel &kernel)
 Reads points (positions only) from a .xyz ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::write_off_points_and_normals (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions + normals) to a .off ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
bool CGAL::write_off_points (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions only) to a .off ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::write_xyz_points_and_normals (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions + normals) to a .xyz ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
bool CGAL::write_xyz_points (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions only) to a .xyz ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel , typename SvdTraits >
void CGAL::jet_estimate_normals (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, unsigned int k, const Kernel &, unsigned int degree_fitting=2)
 Estimates normal directions of the [first, beyond) range of points using jet fitting on the k nearest neighbors. More...
 
template<typename InputIterator , typename PointPMap , typename Kernel , typename SvdTraits >
void CGAL::jet_smooth_point_set (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, const Kernel &, unsigned int degree_fitting=2, unsigned int degree_monge=2)
 Smoothes the [first, beyond) range of points using jet fitting on the k nearest neighbors and reprojection onto the jet. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
ForwardIterator CGAL::mst_orient_normals (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, unsigned int k, const Kernel &kernel)
 Orients the normals of the [first, beyond) range of points using the propagation of a seed orientation through a minimum spanning tree of the Riemannian graph [Hoppe92]. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
void CGAL::pca_estimate_normals (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, unsigned int k, const Kernel &)
 Estimates normal directions of the [first, beyond) range of points by linear least squares fitting of a plane over the k nearest neighbors. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
ForwardIterator CGAL::random_simplify_point_set (ForwardIterator first, ForwardIterator beyond, PointPMap, double removed_percentage, const Kernel &)
 Randomly deletes a user-specified fraction of the input points. More...
 
template<typename InputIterator , typename PointPMap , typename Kernel >
InputIterator CGAL::remove_outliers (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, double threshold_percent, const Kernel &)
 Removes outliers: More...
 

Function Documentation

template<typename InputIterator , typename PointPMap , typename Kernel >
Kernel::FT CGAL::compute_average_spacing ( InputIterator  first,
InputIterator  beyond,
PointPMap  point_pmap,
unsigned int  k,
const Kernel  
)

Computes average spacing from k nearest neighbors.

Precondition
k >= 2.
Template Parameters
InputIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if InputIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
average spacing (scalar).
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of InputIterator -> Point_3
knumber of neighbors.

#include <CGAL/compute_average_spacing.h>

Examples:
Point_set_processing_3/average_spacing_example.cpp.
template<typename ForwardIterator , typename PointPMap , typename Kernel >
ForwardIterator CGAL::grid_simplify_point_set ( ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
double  epsilon,
const Kernel  
)

Merges points which belong to the same cell of a grid of cell size = epsilon.

This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.

Precondition
epsilon > 0
Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
iterator over the first point to remove.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3
epsilontolerance value when merging 3D points.

#include <CGAL/grid_simplify_point_set.h>

Examples:
Point_set_processing_3/grid_simplification_example.cpp.
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel , typename SvdTraits >
void CGAL::jet_estimate_normals ( ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
unsigned int  k,
const Kernel ,
unsigned int  degree_fitting = 2 
)

Estimates normal directions of the [first, beyond) range of points using jet fitting on the k nearest neighbors.

The output normals are randomly oriented.

Precondition
k >= 2
Template Parameters
ForwardIteratoriterator model of the concept of the same name over input points and able to store output normals.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of WritablePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
SvdTraitstemplate parameter for the class Monge_via_jet_fitting that can be ommited in conditions described in the documentation of Monge_via_jet_fitting.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.
normal_pmapproperty map: value_type of ForwardIterator -> Vector_3.
knumber of neighbors.
degree_fittingfitting degree

#include <CGAL/jet_estimate_normals.h>

template<typename InputIterator , typename PointPMap , typename Kernel , typename SvdTraits >
void CGAL::jet_smooth_point_set ( InputIterator  first,
InputIterator  beyond,
PointPMap  point_pmap,
unsigned int  k,
const Kernel ,
unsigned int  degree_fitting = 2,
unsigned int  degree_monge = 2 
)

Smoothes the [first, beyond) range of points using jet fitting on the k nearest neighbors and reprojection onto the jet.

As this method relocates the points, it should not be called on containers sorted w.r.t. point locations.

Precondition
k >= 2
Template Parameters
InputIteratoriterator over input points.
PointPMapis a model of ReadWritePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if InputIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
SvdTraitstemplate parameter for the class Monge_via_jet_fitting that can be ommited in conditions described in the documentation of Monge_via_jet_fitting.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of InputIterator -> Point_3.
knumber of neighbors.
degree_fittingfitting degree
degree_mongeMonge degree

#include <CGAL/jet_smooth_point_set.h>

Examples:
Point_set_processing_3/jet_smoothing_example.cpp.
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
ForwardIterator CGAL::mst_orient_normals ( ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
unsigned int  k,
const Kernel kernel 
)

Orients the normals of the [first, beyond) range of points using the propagation of a seed orientation through a minimum spanning tree of the Riemannian graph [Hoppe92].

This method modifies the order of input points so as to pack all sucessfully oriented points first, and returns an iterator over the first point with an unoriented normal (see erase-remove idiom). For this reason it should not be called on sorted containers.

Warning
This function may fail when Boost version 1.54 is used, because of the following bug: https://svn.boost.org/trac/boost/ticket/9012
Precondition
Normals must be unit vectors
k >= 2
Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of ReadWritePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
iterator over the first point with an unoriented normal.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.
normal_pmapproperty map: value_type of ForwardIterator -> Vector_3.
knumber of neighbors
kernelgeometric traits.

#include <CGAL/mst_orient_normals.h>

Examples:
Point_set_processing_3/normals_example.cpp.
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
void CGAL::pca_estimate_normals ( ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
unsigned int  k,
const Kernel  
)

Estimates normal directions of the [first, beyond) range of points by linear least squares fitting of a plane over the k nearest neighbors.

The output normals are randomly oriented.

Precondition
k >= 2
Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of WritablePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.
normal_pmapproperty map: value_type of ForwardIterator -> Vector_3.
knumber of neighbors.

#include <CGAL/pca_estimate_normals.h>

Examples:
Point_set_processing_3/normals_example.cpp.
template<typename ForwardIterator , typename PointPMap , typename Kernel >
ForwardIterator CGAL::random_simplify_point_set ( ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  ,
double  removed_percentage,
const Kernel  
)

Randomly deletes a user-specified fraction of the input points.

This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.

Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
iterator over the first point to remove.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
removed_percentagepercentage of points to remove.

#include <CGAL/random_simplify_point_set.h>

template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename Kernel >
bool CGAL::read_off_points ( std::istream &  stream,
OutputIterator  output,
PointPMap  point_pmap,
const Kernel kernel 
)

Reads points (position only) from a .off ASCII stream.

The function expects for each point a line with the x y z position. If the position is followed by the nx ny nz normal, then the normal will be ignored. Faces are ignored.

Template Parameters
OutputIteratorValueTypetype of objects that can be put in OutputIterator. It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine.
OutputIteratoriterator over output points.
PointPMapis a model of WritablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if OutputIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streaminput stream.
outputoutput iterator over points.
point_pmapproperty map: value_type of OutputIterator -> Point_3.
kernelgeometric traits.

#include <CGAL/IO/read_off_points.h>

template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::read_off_points_and_normals ( std::istream &  stream,
OutputIterator  output,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
const Kernel  
)

Reads points (positions + normals, if available) from a .off ASCII stream.

The function expects for each point a line with the x y z position, optionally followed by the nx ny nz normal. Faces are ignored.

Template Parameters
OutputIteratorValueTypetype of objects that can be put in OutputIterator. It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine.
OutputIteratoriterator over output points.
PointPMapis a model of WritablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if OutputIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of WritablePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streaminput stream.
outputoutput iterator over points.
point_pmapproperty map: value_type of OutputIterator -> Point_3.
normal_pmapproperty map: value_type of OutputIterator -> Vector_3.

#include <CGAL/IO/read_off_points.h>

template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename Kernel >
bool CGAL::read_xyz_points ( std::istream &  stream,
OutputIterator  output,
PointPMap  point_pmap,
const Kernel kernel 
)

Reads points (positions only) from a .xyz ASCII stream.

The function expects for each point a line with the x y z position. If the position is followed by the nx ny nz normal, then the normal will be ignored. The first line may contain the number of points in the file. Empty lines and comments starting by # character are allowed.

Template Parameters
OutputIteratorValueTypetype of objects that can be put in OutputIterator. It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine.
OutputIteratoriterator over output points.
PointPMapis a model of WritablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if OutputIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streaminput stream.
outputoutput iterator over points.
point_pmapproperty map: value_type of OutputIterator -> Point_3.
kernelgeometric traits.

#include <CGAL/IO/read_xyz_points.h>

Examples:
Point_set_processing_3/average_spacing_example.cpp, Point_set_processing_3/grid_simplification_example.cpp, Point_set_processing_3/normals_example.cpp, and Point_set_processing_3/remove_outliers_example.cpp.
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::read_xyz_points_and_normals ( std::istream &  stream,
OutputIterator  output,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
const Kernel  
)

Reads points (positions + normals, if available) from a .xyz ASCII stream.

The function expects for each point a line with the x y z position, optionally followed by the nx ny nz normal. The first line may contain the number of points in the file. Empty lines and comments starting by # character are allowed.

Template Parameters
OutputIteratorValueTypetype of objects that can be put in OutputIterator. It is default to value_type_traits<OutputIterator>::type and can be omitted when the default is fine.
OutputIteratoriterator over output points.
PointPMapis a model of WritablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if OutputIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of WritablePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streaminput stream.
outputoutput iterator over points.
point_pmapproperty map: value_type of OutputIterator -> Point_3.
normal_pmapproperty map: value_type of OutputIterator -> Vector_3.

#include <CGAL/IO/read_xyz_points.h>

Examples:
Point_set_processing_3/read_write_xyz_point_set_example.cpp.
template<typename InputIterator , typename PointPMap , typename Kernel >
InputIterator CGAL::remove_outliers ( InputIterator  first,
InputIterator  beyond,
PointPMap  point_pmap,
unsigned int  k,
double  threshold_percent,
const Kernel  
)

Removes outliers:

  • computes average squared distance to the K nearest neighbors,
  • and sorts the points in increasing order of average distance.

This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.

Precondition
k >= 2
Template Parameters
InputIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if InputIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
iterator over the first point to remove.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of InputIterator -> Point_3
knumber of neighbors.
threshold_percentpercentage of points to remove.

#include <CGAL/remove_outliers.h>

Examples:
Point_set_processing_3/remove_outliers_example.cpp.
template<typename ForwardIterator , typename PointPMap , typename Kernel >
bool CGAL::write_off_points ( std::ostream &  stream,
ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
const Kernel  
)

Saves the [first, beyond) range of points (positions only) to a .off ASCII stream.

The function writes for each point a line with the x y z position.

Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streamoutput stream.
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.

#include <CGAL/IO/write_off_points.h>

template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::write_off_points_and_normals ( std::ostream &  stream,
ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
const Kernel  
)

Saves the [first, beyond) range of points (positions + normals) to a .off ASCII stream.

The function writes for each point a line with the x y z position followed by the nx ny nz normal.

Precondition
normals must be unit vectors
Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of ReadablePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streamoutput stream.
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.
normal_pmapproperty map: value_type of ForwardIterator -> Vector_3.

#include <CGAL/IO/write_off_points.h>

template<typename ForwardIterator , typename PointPMap , typename Kernel >
bool CGAL::write_xyz_points ( std::ostream &  stream,
ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
const Kernel  
)

Saves the [first, beyond) range of points (positions only) to a .xyz ASCII stream.

The function writes for each point a line with the x y z position.

Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streamoutput stream.
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.

#include <CGAL/IO/write_xyz_points.h>

template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool CGAL::write_xyz_points_and_normals ( std::ostream &  stream,
ForwardIterator  first,
ForwardIterator  beyond,
PointPMap  point_pmap,
NormalPMap  normal_pmap,
const Kernel  
)

Saves the [first, beyond) range of points (positions + normals) to a .xyz ASCII stream.

The function writes for each point a line with the x y z position followed by the nx ny nz normal.

Precondition
normals must be unit vectors
Template Parameters
ForwardIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if ForwardIterator value_type is convertible to Point_3<Kernel>.
NormalPMapis a model of ReadablePropertyMap with a value_type = Vector_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
true on success.
Parameters
streamoutput stream.
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of ForwardIterator -> Point_3.
normal_pmapproperty map: value_type of ForwardIterator -> Vector_3.

#include <CGAL/IO/write_xyz_points.h>

Examples:
Point_set_processing_3/read_write_xyz_point_set_example.cpp.