* PlainObject -> MatrixBase * template igl::Hit * vector input intersect rays with multiple hits * initialize * initialize * only write if hit * fix templates * template me baby * templates * my god. so many PlainObject -> Matrix; Derived -> PlainMatrix<Derived> * Options doesn't exist for Maps/Refs * templates; windows size_t shinanigans * Derived->PlainMatrix * windows template * derived -> plainvector * options * fix templating * std types * fix windingnumbertree tempalting * further fix windingnumbertree tempalting * Xi->XI * templating * clean up and template some of the decimation code; eventually gave up on templating outer functions * rm needless cast * attempt to fix index templating in boolean code * remove debugging casts * more templatin hell * debug kruft * vector resize * assert * int -> template * int -> template * int -> template * templating away more Xi * templating away more 3i * formatting * vector * plainmatrix * plainmatrix * bug * templating MSH io * remove use of Map * zero default tags * bug fix * file debug flags * __1:: * better typing * knn tempalte * note * templating * reorder scaf inputs * fix build * doc * templates * messier than I thought * doc * Xi -> XI * use templated type * 1x1 is always symmetric * use index type * split intrinsic * templating * template internal
67 lines
2.7 KiB
C++
67 lines
2.7 KiB
C++
// high level interface for MshSaver
|
|
//
|
|
// Copyright (C) 2020 Vladimir Fonov <vladimir.fonov@gmail.com>
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#ifndef IGL_WRITE_MSH_H
|
|
#define IGL_WRITE_MSH_H
|
|
#include "igl_inline.h"
|
|
|
|
#include <Eigen/Core>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace igl
|
|
{
|
|
/// write triangle surface mesh and tetrahedral volume mesh to .msh file
|
|
///
|
|
/// @param[in] msh - file name
|
|
/// @param[in] X eigen double matrix of vertex positions #X by 3
|
|
/// @param[in] Tri #Tri eigen integer matrix of triangular faces indices into vertex positions
|
|
/// @param[in] Tet #Tet eigen integer matrix of tetrahedral indices into vertex positions
|
|
/// @param[in] TriTag #Tri eigen integer vector of tags associated with surface faces {0s}
|
|
/// @param[in] TetTag #Tet eigen integer vector of tags associated with volume elements {0s}
|
|
/// @param[in] XFields #XFields list of strings with field names associated with nodes
|
|
/// @param[in] XF #XFields list of eigen double matrices, fields associated with nodes
|
|
/// @param[in] EFields #EFields list of strings with field names associated with elements
|
|
/// @param[in] TriF #EFields list of eigen double matrices, fields associated with surface elements
|
|
/// @param[in] TetF #EFields list of eigen double matrices, fields associated with volume elements
|
|
///
|
|
/// \bug files are always stored in binary format
|
|
/// \bug file format is 2.2
|
|
/// \bug only triangle surface elements and tetrahedral volumetric elements are supported
|
|
/// \bug only 3D information is supported
|
|
/// \bug the tag id is duplicated for physical (0) and elementary (1)
|
|
/// \bug same element fields are expected to be associated with surface elements and volumetric elements
|
|
template <
|
|
typename DerivedX,
|
|
typename DerivedTri,
|
|
typename DerivedTet,
|
|
typename DerivedTriTag,
|
|
typename DerivedTetTag,
|
|
typename MatrixXF,
|
|
typename MatrixTriF,
|
|
typename MatrixTetF
|
|
>
|
|
IGL_INLINE bool writeMSH(
|
|
const std::string &msh,
|
|
const Eigen::MatrixBase<DerivedX> &X,
|
|
const Eigen::MatrixBase<DerivedTri> &Tri,
|
|
const Eigen::MatrixBase<DerivedTet> &Tet,
|
|
const Eigen::MatrixBase<DerivedTriTag> &TriTag,
|
|
const Eigen::MatrixBase<DerivedTetTag> &TetTag,
|
|
const std::vector<std::string> &XFields,
|
|
const std::vector<MatrixXF> &XF,
|
|
const std::vector<std::string> &EFields,
|
|
const std::vector<MatrixTriF> &TriF,
|
|
const std::vector<MatrixTetF> &TetF);
|
|
}
|
|
|
|
#ifndef IGL_STATIC_LIBRARY
|
|
# include "writeMSH.cpp"
|
|
#endif
|
|
|
|
#endif //IGL_WRITE_MSH_H
|