| 134 | } |
| 135 | |
| 136 | std::unique_ptr<draco::Mesh> to_draco_mesh(Mesh::Ptr mesh, |
| 137 | bool with_attributes=true) { |
| 138 | std::unique_ptr<draco::Mesh> draco_mesh(new draco::Mesh()); |
| 139 | |
| 140 | const size_t vertex_per_face = mesh->get_vertex_per_face(); |
| 141 | if (vertex_per_face != 3) { |
| 142 | throw NotImplementedError( |
| 143 | "Draco encoding only supports triangle mesh."); |
| 144 | } |
| 145 | |
| 146 | copy_vertices(mesh, draco_mesh); |
| 147 | copy_faces(mesh, draco_mesh); |
| 148 | |
| 149 | if (with_attributes) { |
| 150 | copy_vertex_attributes(mesh, draco_mesh); |
| 151 | //copy_face_attributes(mesh, draco_mesh); |
| 152 | } |
| 153 | |
| 154 | return draco_mesh; |
| 155 | } |
| 156 | |
| 157 | std::unique_ptr<draco::PointCloud> to_draco_point_cloud(Mesh::Ptr mesh, |
| 158 | bool with_attributes=true) { |
no test coverage detected