PolyFEM
Loading...
Searching...
No Matches
OBJReader.hpp
Go to the documentation of this file.
1// Modified version of read_obj from libigl to include reading polyline elements
2// as edges.
3//
4// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla Public License
7// v. 2.0. If a copy of the MPL was not distributed with this file, You can
8// obtain one at http://mozilla.org/MPL/2.0/.
9
10#pragma once
11
12#include <string>
13#include <vector>
14
15#include <Eigen/Core>
16
17namespace polyfem::io
18{
20 {
21 public:
22 OBJReader() = delete;
23
40 static bool read(
41 const std::string obj_file_name,
42 std::vector<std::vector<double>> &V,
43 std::vector<std::vector<double>> &TC,
44 std::vector<std::vector<double>> &N,
45 std::vector<std::vector<int>> &F,
46 std::vector<std::vector<int>> &FTC,
47 std::vector<std::vector<int>> &FN,
48 std::vector<std::vector<int>> &L);
49
52 static bool read(
53 FILE *obj_file,
54 std::vector<std::vector<double>> &V,
55 std::vector<std::vector<double>> &TC,
56 std::vector<std::vector<double>> &N,
57 std::vector<std::vector<int>> &F,
58 std::vector<std::vector<int>> &FTC,
59 std::vector<std::vector<int>> &FN,
60 std::vector<std::vector<int>> &L);
61
63 static bool read(
64 const std::string obj_file_name,
65 std::vector<std::vector<double>> &V,
66 std::vector<std::vector<int>> &F,
67 std::vector<std::vector<int>> &L);
68
73 static bool read(
74 const std::string str,
75 Eigen::MatrixXd &V,
76 Eigen::MatrixXi &E,
77 Eigen::MatrixXi &F);
78 };
79} // namespace polyfem::io
int V
static bool read(const std::string obj_file_name, std::vector< std::vector< double > > &V, std::vector< std::vector< double > > &TC, std::vector< std::vector< double > > &N, std::vector< std::vector< int > > &F, std::vector< std::vector< int > > &FTC, std::vector< std::vector< int > > &FN, std::vector< std::vector< int > > &L)
Read a mesh from an ascii obj file.
Definition OBJReader.cpp:32