About triangle configuration instructions for the two-dimensional triangular grid generator under windows

Source: Internet
Author: User

Recently need to use the triangular grid generated some things, so the triangle this library compiled a bit, found that the compilation process is a little tangled, so think of writing down, hope that some children's shoes to see less go some detours.

First of all thank Eryar for your help, thank you very much!

Before compiling, let's look at Eryar's blog post:

http://www.cnblogs.com/opencascade/p/3632705.html

I compiled it under the Windows environment of Visual Studio.

The beginning of the stumbling also compiled, but in C + + is not available, so help Eryar to finally succeed:

Directly on the code bar, the triangle header file changes as follows:

#ifndef _triangle_header_#define _triangle_header_
#ifdef _cplusplusextern "C" {#endif//change here, the blog bold changed color after the code, I do not know why the # 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; /* 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 *me MPTR); #else/* Not ansi_declarators */void triangulate (); void Trifree (); #endif */Not ansi_declarators */#ifdef _CPLUSPLU s} #endif///change here, the blog bold changed color after the code, I do not know why
#endif


At the same time in the triangle.c inside modify:

Will:

/* #define NO_TIMER */

/* #define Trilibrary*/

Switch

#define No_timer

#define Trilibrary

It is OK to open the two macro definitions.


Successfully generated Lib Library



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.