|
@@ -22,9 +22,9 @@ template <typename DerivedTV,
|
|
|
typename DerivedJ,
|
|
typename DerivedJ,
|
|
|
typename BCType>
|
|
typename BCType>
|
|
|
void igl::marching_tets(
|
|
void igl::marching_tets(
|
|
|
- const Eigen::PlainObjectBase<DerivedTV>& TV,
|
|
|
|
|
- const Eigen::PlainObjectBase<DerivedTT>& TT,
|
|
|
|
|
- const Eigen::PlainObjectBase<DerivedS>& isovals,
|
|
|
|
|
|
|
+ const Eigen::MatrixBase<DerivedTV>& TV,
|
|
|
|
|
+ const Eigen::MatrixBase<DerivedTT>& TT,
|
|
|
|
|
+ const Eigen::MatrixBase<DerivedS>& isovals,
|
|
|
double isovalue,
|
|
double isovalue,
|
|
|
Eigen::PlainObjectBase<DerivedSV>& outV,
|
|
Eigen::PlainObjectBase<DerivedSV>& outV,
|
|
|
Eigen::PlainObjectBase<DerivedSF>& outF,
|
|
Eigen::PlainObjectBase<DerivedSF>& outF,
|
|
@@ -94,7 +94,7 @@ void igl::marching_tets(
|
|
|
for (int v = 0; v < 4; v++)
|
|
for (int v = 0; v < 4; v++)
|
|
|
{
|
|
{
|
|
|
const int vid = TT(i, v);
|
|
const int vid = TT(i, v);
|
|
|
- const uint8_t flag = isovals[vid] > isovalue;
|
|
|
|
|
|
|
+ const uint8_t flag = isovals(vid, 0) > isovalue;
|
|
|
key |= flag << v;
|
|
key |= flag << v;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -160,8 +160,8 @@ void igl::marching_tets(
|
|
|
typedef Eigen::Matrix<typename DerivedTV::Scalar, 1, 3, Eigen::RowMajor, 1, 3> RowVector;
|
|
typedef Eigen::Matrix<typename DerivedTV::Scalar, 1, 3, Eigen::RowMajor, 1, 3> RowVector;
|
|
|
const RowVector v1 = TV.row(edge.first);
|
|
const RowVector v1 = TV.row(edge.first);
|
|
|
const RowVector v2 = TV.row(edge.second);
|
|
const RowVector v2 = TV.row(edge.second);
|
|
|
- const double a = fabs(isovals[edge.first] - isovalue);
|
|
|
|
|
- const double b = fabs(isovals[edge.second] - isovalue);
|
|
|
|
|
|
|
+ const double a = fabs(isovals(edge.first, 0) - isovalue);
|
|
|
|
|
+ const double b = fabs(isovals(edge.second, 0) - isovalue);
|
|
|
const double w = a / (a+b);
|
|
const double w = a / (a+b);
|
|
|
|
|
|
|
|
// Create a casted copy in case BCType is a float and we need to downcast
|
|
// Create a casted copy in case BCType is a float and we need to downcast
|
|
@@ -190,5 +190,5 @@ void igl::marching_tets(
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef IGL_STATIC_LIBRARY
|
|
#ifdef IGL_STATIC_LIBRARY
|
|
|
-template void igl::marching_tets<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, double>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::SparseMatrix<double, 0, int>&);
|
|
|
|
|
|
|
+template void igl::marching_tets<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::SparseMatrix<double, 0, int>&);
|
|
|
#endif // IGL_STATIC_LIBRARY
|
|
#endif // IGL_STATIC_LIBRARY
|