Writing ply files.
More...
#include <tesseract/common/ply_io.h>
#include <tesseract/common/utils.h>
#include <console_bridge/console.h>
#include <boost/algorithm/string.hpp>
#include <fstream>
#include <iostream>
#include <iomanip>
|
| bool | tesseract::common::writeSimplePlyFile (const std::string &path, const tesseract::common::VectorVector3d &vertices, const std::vector< Eigen::Vector3i > &vectices_color, const Eigen::VectorXi &faces, int num_faces) |
| | Write a simple ply file given vertices and faces.
|
| |
| bool | tesseract::common::writeSimplePlyFile (const std::string &path, const tesseract::common::VectorVector3d &vertices, const Eigen::VectorXi &faces, int num_faces) |
| | Write a simple ply file given vertices and faces.
|
| |
| int | tesseract::common::loadSimplePlyFile (const std::string &path, tesseract::common::VectorVector3d &vertices, Eigen::VectorXi &faces, bool triangles_only=false) |
| | Loads a simple ply file given a path.
|
| |
Writing ply files.
- Author
- Levi Armstrong
- Date
- Dec 18, 2017
- Copyright
- Copyright (c) 2017, Southwest Research Institute
- License
- Software License Agreement (Apache License)
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
◆ writeSimplePlyFile() [1/2]
| bool tesseract::common::writeSimplePlyFile |
( |
const std::string & |
path, |
|
|
const tesseract::common::VectorVector3d & |
vertices, |
|
|
const std::vector< Eigen::Vector3i > & |
vectices_color, |
|
|
const Eigen::VectorXi & |
faces, |
|
|
int |
num_faces |
|
) |
| |
Write a simple ply file given vertices and faces.
- Parameters
-
| path | The file path |
| vertices | A vector of vertices |
| vertices_color | The vertices color (0-255,0-255,0-255), if empty uses a default color |
| faces | The first values indicates the number of vertices that define the face followed by the vertice index |
| num_faces | The number of faces |
- Returns
- False if failed to write file, otherwise true
◆ writeSimplePlyFile() [2/2]
| bool tesseract::common::writeSimplePlyFile |
( |
const std::string & |
path, |
|
|
const tesseract::common::VectorVector3d & |
vertices, |
|
|
const Eigen::VectorXi & |
faces, |
|
|
int |
num_faces |
|
) |
| |
Write a simple ply file given vertices and faces.
- Parameters
-
| path | The file path |
| vertices | A vector of vertices |
| faces | The first values indicates the number of vertices that define the face followed by the vertice index |
| num_faces | The number of faces |
- Returns
- False if failed to write file, otherwise true
◆ loadSimplePlyFile()
| int tesseract::common::loadSimplePlyFile |
( |
const std::string & |
path, |
|
|
tesseract::common::VectorVector3d & |
vertices, |
|
|
Eigen::VectorXi & |
faces, |
|
|
bool |
triangles_only = false |
|
) |
| |
Loads a simple ply file given a path.
- Parameters
-
| path | The file path |
| vertices | A vector of vertices |
| faces | The first values indicates the number of vertices that define the face followed by the vertice index |
| triangles_only | Convert to only include triangles |
- Returns
- Number of faces, If returned 0 it failed to load.