mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-25 01:31:14 -06:00
Merged branch 'dev_native' into lm_sla_supports_auto
Added igl library files
This commit is contained in:
commit
7681d00ee5
2865 changed files with 142806 additions and 22325 deletions
40
src/igl/print_ijv.cpp
Normal file
40
src/igl/print_ijv.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// This file is part of libigl, a simple c++ geometry processing library.
|
||||
//
|
||||
// Copyright (C) 2013 Alec Jacobson <alecjacobson@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/.
|
||||
#include "print_ijv.h"
|
||||
|
||||
#include "find.h"
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
IGL_INLINE void igl::print_ijv(
|
||||
const Eigen::SparseMatrix<T>& X,
|
||||
const int offset)
|
||||
{
|
||||
Eigen::Matrix<int,Eigen::Dynamic,1> I;
|
||||
Eigen::Matrix<int,Eigen::Dynamic,1> J;
|
||||
Eigen::Matrix<T,Eigen::Dynamic,1> V;
|
||||
igl::find(X,I,J,V);
|
||||
// Concatenate I,J,V
|
||||
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> IJV(I.size(),3);
|
||||
IJV.col(0) = I.cast<T>();
|
||||
IJV.col(1) = J.cast<T>();
|
||||
IJV.col(2) = V;
|
||||
// Offset
|
||||
if(offset != 0)
|
||||
{
|
||||
IJV.col(0).array() += offset;
|
||||
IJV.col(1).array() += offset;
|
||||
}
|
||||
std::cout<<IJV;
|
||||
}
|
||||
|
||||
#ifdef IGL_STATIC_LIBRARY
|
||||
// Explicit template instantiation
|
||||
// generated by autoexplicit.sh
|
||||
template void igl::print_ijv<double>(Eigen::SparseMatrix<double, 0, int> const&, int);
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue