CGAL 6.1.1 - IO Streams

Loading...
Searching...
No Matches
Functions
3MF I/O Functions
Reference Manual » I/O Functions

##

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).
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).

## 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

  PointRanges | a 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
  TriangleRanges | a 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`
  ColorRanges | a 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

  fname | the name of the 3mf file to read
  all_points | a `PointRanges` that will contain the points of the meshes in `fname`. Each of these meshes will add a range of its points.
  all_triangles | a `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_colors | will contain the color of each triangle for each soup.
  names | will 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

  PointRanges | a model of the concept `RandomAccessContainer` whose `value_type` is a model of the concept `RandomAccessContainer` whose `value_type` is the point type
  TriangleRanges | a 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

  fname | the name of the 3mf file to write
  all_points | a `PointRanges` that contains the points of the soups to write
  all_triangles | a `TriangleRanges` that contains the triangles of the soups in `fname`
  names | a 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.