CGAL 5.5.2 - IO Streams

I/O Functions for the 3D Manufacturing Format (3MF).

Functions

template<typename PointRanges , typename TriangleRanges , typename ColorRanges >
bool CGAL::IO::read_3MF (const std::string &fname, PointRanges &all_points, TriangleRanges &all_triangles, ColorRanges &all_colors, std::vector< std::string > &names)
 reads ranges of points and triangles from an input file, using the 3D Manufacturing Format (3MF). More...
 
template<typename PointRanges , typename TriangleRanges >
bool CGAL::IO::write_3MF (const std::string &fname, const PointRanges &all_points, const TriangleRanges &all_triangles, const std::vector< std::string > &names)
 writes the triangle soups contained in all_points and all_triangles into the file fname, using the 3D Manufacturing Format (3MF). More...
 

Function Documentation

◆ read_3MF()

template<typename PointRanges , typename TriangleRanges , typename ColorRanges >
bool CGAL::IO::read_3MF ( const std::string &  fname,
PointRanges &  all_points,
TriangleRanges &  all_triangles,
ColorRanges &  all_colors,
std::vector< std::string > &  names 
)

#include <CGAL/IO/3MF.h>

reads ranges of points and triangles from an input file, using the 3D Manufacturing Format (3MF).

Attention
The ranges not cleared, and the data from the file are appended.
Template Parameters
PointRangesa model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is a model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is the point type
TriangleRangesa model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is a model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is a model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is an unsigned integer type convertible to std::size_t
ColorRangesa model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is a model of the concepts RandomAccessContainer and BackInsertionSequence whose value_type is CGAL::IO::Color
Parameters
fnamethe name of the 3mf file to read
all_pointsa PointRanges that will contain the points of the meshes in fname. Each of these meshes will add a range of its points.
all_trianglesa TriangleRanges that will contain the triangles of the meshes in fname. Each of these meshes will add a range of its triangles. A triangle of all_triangles[i] contains the indices of its points in all_points[i].
all_colorswill contain the color of each triangle for each soup.
nameswill contain the name of each mesh in fname if any. If the i-th mesh has no name, it will be called "Unknown Mesh" in names.
Returns
true if reading was successful, false otherwise.

◆ write_3MF()

template<typename PointRanges , typename TriangleRanges >
bool CGAL::IO::write_3MF ( const std::string &  fname,
const PointRanges &  all_points,
const TriangleRanges &  all_triangles,
const std::vector< std::string > &  names 
)

#include <CGAL/IO/3MF.h>

writes the triangle soups contained in all_points and all_triangles into the file fname, using the 3D Manufacturing Format (3MF).

Template Parameters
PointRangesa model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is the point type
TriangleRangesa model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is a model of the concept RandomAccessContainer whose value_type is an unsigned integer type convertible to std::size_t
Parameters
fnamethe name of the 3mf file to write
all_pointsa PointRanges that contains the points of the soups to write
all_trianglesa TriangleRanges that contains the triangles of the soups in fname
namesa range of std::string` associating a name to each soup, which will appear in the output
Returns
true if the writing is successful, false otherwise.