博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于TRIANGLE二维三角网格生成器在windows下的配置说明
阅读量:4071 次
发布时间:2019-05-25

本文共 2708 字,大约阅读时间需要 9 分钟。

      最近需要用到三角网格生成的一些东西,所以就把TRIANGLE这个库编译了一下,发现编译过程还是稍微有些纠结,于是就想到写下来,希望以后有些童鞋看到少走一些弯路。

     首先非常感谢eryar的帮助,非常感谢!

     在编译之前还是先看一下eryar的博文:

    

     我是在visual studio 2010 windows环境下面编译的。

     刚开始磕磕绊绊的也编译完了,但是在c++下面是不能使用的,所以求助eryar才最后成功:

     直接上代码吧,triangle头文件更改如下:

    

#ifndef _TRIANGLE_HEADER_#define _TRIANGLE_HEADER_
#ifdef _cplusplusextern "C"{#endif///更改这里,博客加粗改颜色之后成代码了,不知为什么#define REAL double#define ANSI_DECLARATORS#define VOID int#include "triangle.h"struct triangulateio {  REAL *pointlist;                                               /* In / out */  REAL *pointattributelist;                                      /* In / out */  int *pointmarkerlist;                                          /* In / out */  int numberofpoints;                                            /* In / out */  int numberofpointattributes;                                   /* In / out */  int *trianglelist;                                             /* In / out */  REAL *triangleattributelist;                                   /* In / out */  REAL *trianglearealist;                                         /* In only */  int *neighborlist;                                             /* Out only */  int numberoftriangles;                                         /* In / out */  int numberofcorners;                                           /* In / out */  int numberoftriangleattributes;                                /* In / out */  int *segmentlist;                                              /* In / out */  int *segmentmarkerlist;                                        /* In / out */  int numberofsegments;                                          /* In / out */  REAL *holelist;                        /* In / pointer to array copied out */  int numberofholes;                                      /* In / copied out */  REAL *regionlist;                      /* In / pointer to array copied out */  int numberofregions;                                    /* In / copied out */  int *edgelist;                                                 /* Out only */  int *edgemarkerlist;            /* Not used with Voronoi diagram; out only */  REAL *normlist;                /* Used only with Voronoi diagram; out only */  int numberofedges;                                             /* Out only */};#ifdef ANSI_DECLARATORSvoid triangulate(char *, struct triangulateio *, struct triangulateio *,struct triangulateio *);void trifree(VOID *memptr);#else /* not ANSI_DECLARATORS */void triangulate();void trifree();#endif /* not ANSI_DECLARATORS */#ifdef _cplusplus}#endif///更改这里,博客加粗改颜色之后成代码了,不知为什么
#endif

同时在triangle.c里面修改:

将:

/* #define NO_TIMER */

/* #define TRILIBRARY*/

改为:

#define NO_TIMER

#define TRILIBRARY

也就是将这两个宏定义打开就OK了。

成功生成lib库




转载地址:http://foeji.baihongyu.com/

你可能感兴趣的文章
前端知识总结一
查看>>
Python 字符串的操作
查看>>
python安装依赖modules pysnmp pyasn1.type pexpect configparser
查看>>
Python操作Mongodb插入数据的两种方法:insert_one()与insert_many()
查看>>
Python函数式编程——匿名函数lambda
查看>>
Python的getattr(),setattr(),delattr(),hasattr()
查看>>
js中的constructor与prototype
查看>>
Ajax中的get和post请求比较
查看>>
'VBoxManage' is not recognized as an internal or external command, operable program or batch file.
查看>>
Linux VNC server的安装及简单配置使用
查看>>
解决RHEL6 vncserver 启动 could not open default font 'fixed'错误.
查看>>
Linux 下路由的设置
查看>>
CentOS/Linux 网卡设置 IP地址配置
查看>>
Python实现ping指定IP
查看>>
linux下ping命令使用详解
查看>>
html引入jquery库
查看>>
js与jq比较
查看>>
js学习一数组类型foreach方法
查看>>
js学习二函数
查看>>
js学习三-日期Date
查看>>