资源简介
3D三角形网格模型补洞算法源代码,原为linux平台下编译,现已改为Windows环境下;由于使用了C++11新特性,需通过VS2013或更高版本编译。
代码片段和文件信息
#pragma warning(disable:4996)
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using Eigen::VectorXi;
using Eigen::MatrixXd;
using Eigen::MatrixXi;
using Eigen::VectorXd;
typedef Eigen::SparseMatrix SpMat;
typedef Eigen::Triplet Tri;
void printHelpExit() {
printf(“Invalid command line arguments specified!\n\n“);
printf(“USAGE: hole_fixer [options]\n\n“);
printf(“OPTIONS: \n“);
printf(“ -in\t\t\ttarget mesh file in .off-format with a hole\n“);
printf(“ -out\t\t\toutput mesh file in .off-format\n“);
printf(“ -outfaces\t\tHow many faces to decimate the mesh to\n“);
printf(“ -upsample\t\tHow much upsampling to use when creating the patch\n“);
exit(1);
}
const char* findToken(const char* param int argc char* argv[]) {
const char* token = nullptr;
for (int i = 0; i < argc; ++i) {
if (strcmp(argv[i] param) == 0) {
if (i + 1 < argc) {
token = argv[i + 1];
break;
}
}
}
if (token == nullptr) {
printf(“Could not find command-line parameter %s\n“ param);
return nullptr;
}
return token;
}
const char* parseStringParam(const char* param int argc char* argv[]) {
const char* token = findToken(param argc argv);
return token;
}
bool parseIntParam(const char* param int argc char* argv[] unsigned int& out) {
const char* token = findToken(param argc argv);
if (token == nullptr)
return false;
int r = sscanf(token “%u“ &out);
if (r != 1 || r == EOF) {
return false;
}
else {
return true;
}
}
int main(/*int argc char *argv[]*/)
{
//
// command line parsing.
//
int argc = 2;
char* argv[] = { “hole_fixer“ “-in“ “bunnyhole.off“ “-out“ “out.off“ “-outfaces“ “8000“ “-upsample“ “2“ };
const char* inFile = “bunnyhole.off“;
/*const char* inFile = parseStringParam(“-in“ argc argv);*/
if (inFile == nullptr) printHelpExit();
const char* outFile = “example.off“;
//const char* outFile = parseStringParam(“-out“ argc argv);
if (outFile == nullptr) printHelpExit();
unsigned int outFacesN = 8000;
//if (!parseIntParam(“-outfaces“ argc argv outFacesN)) printHelpExit();
unsigned int upsampleN = 2;
//if (!parseIntParam(“-upsample“ argc argv upsampleN)) printHelpExit();
// original mesh vertices and indices. This is the original mesh which has a hole.
MatrixXd originalV;
MatrixXi originalF;
if (!igl::readOFF(inFile originalV originalF)) {
printHelpExit();
}
VectorXi originalLoop; // indices of the boundary of the hole.
igl::boundary_loop(originalF originalLoop);
if (originalLoop.size() == 0) {
printf(“Mesh has no hole!“);
printHelpExit();
}
// upsample the original mesh. this makes fusing the original mesh with the patch much easier.
igl::upsample(Eigen::MatrixXd(originalV) Eigen::MatrixXi(originalF) originalV
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 40448 2018-06-28 21:41 MeshFixer\.vs\MeshFixer\v14\.suo
文件 365818 2018-02-27 05:24 MeshFixer\bunnyhole.off
文件 2189824 2018-06-28 21:36 MeshFixer\Debug\MeshFixer.exe
文件 12838568 2018-06-28 21:36 MeshFixer\Debug\MeshFixer.ilk
文件 50393088 2018-06-28 21:36 MeshFixer\Debug\MeshFixer.pdb
文件 365818 2018-02-27 05:24 MeshFixer\hole_fixer-master\bunnyhole.off
文件 137 2018-02-27 05:24 MeshFixer\hole_fixer-master\CMakeLists.txt
文件 338153 2018-02-27 05:24 MeshFixer\hole_fixer-master\img\bunnymontage.png
文件 221121 2018-02-27 05:24 MeshFixer\hole_fixer-master\img\spheremontage.png
文件 304 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Array
文件 775 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Cholesky
文件 1670 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\CholmodSupport
文件 607 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\CMakeLists.txt
文件 12826 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Core
文件 122 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Dense
文件 37 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Eigen
文件 3295 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Eigen2Support
文件 1394 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Eigenvalues
文件 1605 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Geometry
文件 580 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Householder
文件 1594 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\IterativeLinearSolvers
文件 645 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\Jacobi
文件 712 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\LeastSquares
文件 983 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\LU
文件 697 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\MetisSupport
文件 2189 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\OrderingMethods
文件 864 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\PardisoSupport
文件 1467 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\PaStiXSupport
文件 926 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\QR
文件 637 2018-02-27 05:24 MeshFixer\hole_fixer-master\libigl\eigen\Eigen\QtAlignedMalloc
............此处省略1697个文件信息
- 上一篇:2018新华三(H3C)社招C语言笔试题
- 下一篇:C++与ja
vasc ript交互
相关资源
- The Art of Scientific Computing第二版、第三
- 浏览器截屏程序源代码C++
- 单片机C语言程序设计实训100例 案例
- C语言游戏编程从入门到精通PDF书及源
- TeeChart Pro Activex control v8 源代码
- 背单词软件源代码(使用C++和Qt库编写
- 基于opencv和MFC的多功能视频、图像处
- 编译原理LL1语法分析器C++版源代码
- C++餐厅管理系统源代码
- mqtt-client MFC工程调用开源代码
- PL/0语言编译器源代码及测试代码
- Cocos2d-x实战:C++卷2版源代码
- vc++ 编程宝典(十年典藏版) 书后光
- Visual C++网络编程郑阿奇源代码+PPT
- 编译原理词法分析器实验报告含源代
- C++程序设计经典300例源代码
- 车牌识别系统源代码
- 何斌Visual C++数字图像处理第二版原书
- 《C++游戏开发》笔记十一 平滑动画
- 《MFC游戏开发》笔记十 碰撞检测 配套
- 《MFC游戏开发》笔记三 透明贴图 配套
- 《MFC游戏开发》笔记八 粒子系统 配套
- C++编写中国象棋源代码
- 钱能C++程序设计教程 PDF、课件及源代
- c++程序设计第四版课件郑莉等著[含
- modbus 客户端主站C++源代码
- 编译原理词法分析器C++版源代码
- Visual C++ MFC 源代码大全
- 《C++游戏开发》笔记十二 战争迷雾的
- 《MFC游戏开发》笔记九 碰撞检测 怪物
评论
共有 条评论