Open3D (C++ API)  0.11.0
TriangleMeshIO.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <string>
30 
32 
33 namespace open3d {
34 namespace io {
35 
38 std::shared_ptr<geometry::TriangleMesh> CreateMeshFromFile(
39  const std::string &filename, bool print_progress = false);
40 
44 bool ReadTriangleMesh(const std::string &filename,
45  geometry::TriangleMesh &mesh,
46  bool print_progress = false);
47 
55 bool WriteTriangleMesh(const std::string &filename,
56  const geometry::TriangleMesh &mesh,
57  bool write_ascii = false,
58  bool compressed = false,
59  bool write_vertex_normals = true,
60  bool write_vertex_colors = true,
61  bool write_triangle_uvs = true,
62  bool print_progress = false);
63 
64 bool ReadTriangleMeshFromPLY(const std::string &filename,
65  geometry::TriangleMesh &mesh,
66  bool print_progress);
67 
68 bool WriteTriangleMeshToPLY(const std::string &filename,
69  const geometry::TriangleMesh &mesh,
70  bool write_ascii,
71  bool compressed,
72  bool write_vertex_normals,
73  bool write_vertex_colors,
74  bool write_triangle_uvs,
75  bool print_progress);
76 
77 bool ReadTriangleMeshFromSTL(const std::string &filename,
78  geometry::TriangleMesh &mesh,
79  bool print_progress);
80 
81 bool WriteTriangleMeshToSTL(const std::string &filename,
82  const geometry::TriangleMesh &mesh,
83  bool write_ascii,
84  bool compressed,
85  bool write_vertex_normals,
86  bool write_vertex_colors,
87  bool write_triangle_uvs,
88  bool print_progress);
89 
90 bool ReadTriangleMeshFromOBJ(const std::string &filename,
91  geometry::TriangleMesh &mesh,
92  bool print_progress);
93 
94 bool WriteTriangleMeshToOBJ(const std::string &filename,
95  const geometry::TriangleMesh &mesh,
96  bool write_ascii,
97  bool compressed,
98  bool write_vertex_normals,
99  bool write_vertex_colors,
100  bool write_triangle_uvs,
101  bool print_progress);
102 
103 bool ReadTriangleMeshUsingASSIMP(const std::string &filename,
104  geometry::TriangleMesh &mesh,
105  bool print_progress);
106 
107 bool ReadTriangleMeshFromOFF(const std::string &filename,
108  geometry::TriangleMesh &mesh,
109  bool print_progress);
110 
111 bool WriteTriangleMeshToOFF(const std::string &filename,
112  const geometry::TriangleMesh &mesh,
113  bool write_ascii,
114  bool compressed,
115  bool write_vertex_normals,
116  bool write_vertex_colors,
117  bool write_triangle_uvs,
118  bool print_progress);
119 
120 bool ReadTriangleMeshFromGLTF(const std::string &filename,
121  geometry::TriangleMesh &mesh,
122  bool print_progress);
123 
124 bool WriteTriangleMeshToGLTF(const std::string &filename,
125  const geometry::TriangleMesh &mesh,
126  bool write_ascii,
127  bool compressed,
128  bool write_vertex_normals,
129  bool write_vertex_colors,
130  bool write_triangle_uvs,
131  bool print_progress);
132 
140 bool AddTrianglesByEarClipping(geometry::TriangleMesh &mesh,
141  std::vector<unsigned int> &indices);
142 
143 } // namespace io
144 } // namespace open3d
bool ReadTriangleMeshFromOBJ(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: FileOBJ.cpp:46
bool ReadTriangleMesh(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: TriangleMeshIO.cpp:83
bool WriteTriangleMesh(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: TriangleMeshIO.cpp:114
bool ReadTriangleMeshFromPLY(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: FilePLY.cpp:539
bool ReadTriangleMeshFromGLTF(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: FileGLTF.cpp:94
bool ReadTriangleMeshFromOFF(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: FileOFF.cpp:41
bool WriteTriangleMeshToGLTF(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: FileGLTF.cpp:391
std::shared_ptr< geometry::TriangleMesh > CreateMeshFromFile(const std::string &filename, bool print_progress)
Definition: TriangleMeshIO.cpp:76
bool ReadTriangleMeshUsingASSIMP(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: FileASSIMP.cpp:139
bool ReadTriangleMeshFromSTL(const std::string &filename, geometry::TriangleMesh &mesh, bool print_progress)
Definition: FileSTL.cpp:42
bool WriteTriangleMeshToOFF(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: FileOFF.cpp:166
Definition: PinholeCameraIntrinsic.cpp:35
bool AddTrianglesByEarClipping(geometry::TriangleMesh &mesh, std::vector< unsigned int > &indices)
Definition: TriangleMeshIO.cpp:174
bool WriteTriangleMeshToSTL(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: FileSTL.cpp:109
bool WriteTriangleMeshToPLY(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: FilePLY.cpp:611
bool WriteTriangleMeshToOBJ(const std::string &filename, const geometry::TriangleMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
Definition: FileOBJ.cpp:225