PolyFEM
Loading...
Searching...
No Matches
polyfem::io::OBJReader Class Reference

#include <OBJReader.hpp>

Public Member Functions

 OBJReader ()=delete
 

Static Public Member Functions

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.
 
static bool read (FILE *obj_file, 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 already opened ascii obj file.
 
static bool read (const std::string obj_file_name, std::vector< std::vector< double > > &V, std::vector< std::vector< int > > &F, std::vector< std::vector< int > > &L)
 Just read V, F, and L from obj file.
 
static bool read (const std::string str, Eigen::MatrixXd &V, Eigen::MatrixXi &E, Eigen::MatrixXi &F)
 Eigen Wrappers of read_obj.
 

Detailed Description

Definition at line 19 of file OBJReader.hpp.

Constructor & Destructor Documentation

◆ OBJReader()

polyfem::io::OBJReader::OBJReader ( )
delete

Member Function Documentation

◆ read() [1/4]

bool polyfem::io::OBJReader::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 
)
static

Read a mesh from an ascii obj file.

Fills in vertex positions, normals and texture coordinates. Mesh may have faces of any number of degree.

Parameters
[in]obj_file_namepath to .obj file
[out]Vdouble matrix of vertex positions
[out]TCdouble matrix of texture coordinates
[out]Ndouble matrix of corner normals #N by 3
[out]FF list of face indices into vertex positions
[out]FTCF list of face indices into vertex texture coordinates
[out]FNF list of face indices into vertex normals
[out]Llist of polyline indices into vertex positions
Returns
true on success, false on errors

Definition at line 32 of file OBJReader.cpp.

References polyfem::F, polyfem::logger(), read(), and V.

Referenced by polyfem::solver::AdjointOptUtils::create_form(), read(), read(), read(), and polyfem::mesh::read_surface_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read() [2/4]

bool polyfem::io::OBJReader::read ( const std::string  obj_file_name,
std::vector< std::vector< double > > &  V,
std::vector< std::vector< int > > &  F,
std::vector< std::vector< int > > &  L 
)
static

Just read V, F, and L from obj file.

Definition at line 282 of file OBJReader.cpp.

References polyfem::F, read(), and V.

Here is the call graph for this function:

◆ read() [3/4]

bool polyfem::io::OBJReader::read ( const std::string  str,
Eigen::MatrixXd &  V,
Eigen::MatrixXi &  E,
Eigen::MatrixXi &  F 
)
static

Eigen Wrappers of read_obj.

@retruns These will return true only if the data is perfectly "rectangular": All faces are the same degree, all have the same number of textures/normals etc.

Definition at line 293 of file OBJReader.cpp.

References polyfem::F, polyfem::logger(), read(), and V.

Here is the call graph for this function:

◆ read() [4/4]

bool polyfem::io::OBJReader::read ( FILE *  obj_file,
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 
)
static

Read a mesh from an already opened ascii obj file.

Parameters
[in]obj_filepointer to already opened .obj file

Definition at line 52 of file OBJReader.cpp.

References polyfem::F, polyfem::logger(), V, and x.

Here is the call graph for this function:

The documentation for this class was generated from the following files: