亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? user_eg.c

?? 關于網格剖分的
?? C
字號:
/*<html><pre>  -<a                             href="qh-c.htm#user"
  >-------------------------------</a><a name="TOP">-</a>

  user_eg.c
  sample code for calling qhull() from an application
  
  call with:

     user_eg "cube/diamond options" "delaunay options" "halfspace options"

  for example:

     user_eg                             # return summaries

     user_eg "n" "o" "Fp"                # return normals, OFF, points

     user_eg "QR0 p" "QR0 v p" "QR0 Fp"  # rotate input and return points
                                         # 'v' returns Voronoi
					 # transform is rotated for halfspaces

   main() makes three runs of qhull.

     1) compute the convex hull of a cube

     2a) compute the Delaunay triangulation of random points

     2b) find the Delaunay triangle closest to a point.

     3) compute the halfspace intersection of a diamond

 notes:
 
   for another example, see main() in unix.c and user_eg2.c
   These examples, call qh_qhull() directly.  They allow
   tighter control on the code loaded with Qhull.
   
   summaries are sent to stderr if other output formats are used

   compiled by 'make user_eg'

   see qhull.h for data structures, macros, and user-callable functions.
*/

#include "qhull_a.h"

char qh_version[] = "user_eg 98/7/31";  /* used for error messages */

/*-------------------------------------------------
-internal function prototypes
*/
void print_summary (void);
void makecube (coordT *points, int numpoints, int dim);
void makeDelaunay (coordT *points, int numpoints, int dim, int seed);
void findDelaunay (int dim);
void makehalf (coordT *points, int numpoints, int dim);

/*-------------------------------------------------
-print_summary()
*/
void print_summary (void) {
  facetT *facet;
  int k;

  printf ("\n%d vertices and %d facets with normals:\n", 
                 qh num_vertices, qh num_facets);
  FORALLfacets {
    for (k=0; k < qh hull_dim; k++) 
      printf ("%6.2g ", facet->normal[k]);
    printf ("\n");
  }
}

/*--------------------------------------------------
-makecube- set points to vertices of cube
  points is numpoints X dim
*/
void makecube (coordT *points, int numpoints, int dim) {
  int j,k;
  coordT *point;

  for (j=0; j<numpoints; j++) {
    point= points + j*dim;
    for (k=dim; k--; ) {
      if (j & ( 1 << k))
	point[k]= 1.0;
      else
	point[k]= -1.0;
    }
  }
} /*.makecube.*/

/*--------------------------------------------------
-makeDelaunay- set points for dim Delaunay triangulation of random points
  points is numpoints X dim.
notes:
  makeDelaunay() in user_eg2.c uses qh_setdelaunay() to project points in place.
*/
void makeDelaunay (coordT *points, int numpoints, int dim, int seed) {
  int j,k;
  coordT *point, realr;


  printf ("seed: %d\n", seed);
  qh_RANDOMseed_( seed);
  for (j=0; j<numpoints; j++) {
    point= points + j*dim;
    for (k= 0; k < dim; k++) {
      realr= qh_RANDOMint;
      point[k]= 2.0 * realr/(qh_RANDOMmax+1) - 1.0;
    }
  }
} /*.makeDelaunay.*/

/*--------------------------------------------------
-findDelaunay- find Delaunay triangle for [0.5,0.5,...]
  assumes dim < 100
notes:
  calls qh_setdelaunay() to project the point to a parabaloid
*/
void findDelaunay (int dim) {
  int k;
  coordT point[ 100];
  boolT isoutside;
  realT bestdist;
  facetT *facet;
  vertexT *vertex, **vertexp;

  for (k= 0; k < dim; k++) 
    point[k]= 0.5;
  qh_setdelaunay (dim+1, 1, point);
  facet= qh_findbestfacet (point, qh_ALL, &bestdist, &isoutside);
  FOREACHvertex_(facet->vertices) {
    for (k=0; k < dim; k++)
      printf ("%5.2f ", vertex->point[k]);
    printf ("\n");
  }
} /*.findDelaunay.*/

/*--------------------------------------------------
-makehalf- set points to halfspaces for a (dim)-dimensional diamond
  points is numpoints X dim+1

  each halfspace consists of dim coefficients followed by an offset
*/
void makehalf (coordT *points, int numpoints, int dim) {
  int j,k;
  coordT *point;

  for (j=0; j<numpoints; j++) {
    point= points + j*(dim+1);
    point[dim]= -1.0; /* offset */
    for (k=dim; k--; ) {
      if (j & ( 1 << k))
	point[k]= 1.0;
      else
	point[k]= -1.0;
    }
  }
} /*.makehalf.*/

#define DIM 3     /* dimension of points, must be < 31 for SIZEcube */
#define SIZEcube (1<<DIM)
#define SIZEdiamond (2*DIM)
#define TOTpoints (SIZEcube + SIZEdiamond)

/*--------------------------------------------------
-main- derived from call_qhull in user.c

  see program header

  this contains three runs of Qhull for convex hull, Delaunay
  triangulation or Voronoi vertices, and halfspace intersection

*/
int main (int argc, char *argv[]) {
  int dim= DIM;	            /* dimension of points */
  int numpoints;            /* number of points */
  coordT points[(DIM+1)*TOTpoints]; /* array of coordinates for each point */
  coordT *rows[TOTpoints];
  boolT ismalloc= False;    /* True if qhull should free points in qh_freeqhull() or reallocation */
  char flags[250];          /* option flags for qhull, see qh_opt.htm */
  FILE *outfile= stdout;    /* output from qh_produce_output()
			       use NULL to skip qh_produce_output() */
  FILE *errfile= stderr;    /* error messages from qhull code */
  int exitcode;             /* 0 if no error from qhull */
  facetT *facet;	    /* set by FORALLfacets */
  int curlong, totlong;	    /* memory remaining after qh_memfreeshort */
  int i;

  printf ("This is the output from user_eg.c\n\n\
It shows how qhull() may be called from an application.  It is not part\n\
of qhull itself.  If it appears accidently, please remove user_eg.c from\n\
your project.\n\n");

  /*
    Run 1: convex hull
  */
  printf( "\ncompute convex hull of cube after rotating input\n");
  sprintf (flags, "qhull s Tcv %s", argc >= 2 ? argv[1] : "");
  numpoints= SIZEcube;
  makecube (points, numpoints, DIM);
  for (i=numpoints; i--; )
    rows[i]= points+dim*i;
  qh_printmatrix (outfile, "input", rows, numpoints, dim);
  exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
                      flags, outfile, errfile); 
  if (!exitcode) {                  /* if no error */
    /* 'qh facet_list' contains the convex hull */
    print_summary();
    FORALLfacets {
       /* ... your code ... */
    }
  }
  qh_freeqhull(!qh_ALL);                   /* free long memory  */
  qh_memfreeshort (&curlong, &totlong);    /* free short memory and memory allocator */
  if (curlong || totlong) 
    fprintf (errfile, "qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);

  /*
    Run 2: Delaunay triangulation
  */

  printf( "\ncompute 3-d Delaunay triangulation\n");
  sprintf (flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
  numpoints= SIZEcube;
  makeDelaunay (points, numpoints, dim, time(NULL));
  for (i=numpoints; i--; )
    rows[i]= points+dim*i;
  qh_printmatrix (outfile, "input", rows, numpoints, dim);
  exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
                      flags, outfile, errfile); 
  if (!exitcode) {                  /* if no error */
    /* 'qh facet_list' contains the convex hull */
    /* If you want a Voronoi diagram ('v') and do not request output (i.e., outfile=NULL), 
       call qh_setvoronoi_all() after qh_new_qhull(). */
    print_summary();
    FORALLfacets {
       /* ... your code ... */
    }
    printf( "\nfind 3-d Delaunay triangle closest to [0.5, 0.5, ...]\n");
    exitcode= setjmp (qh errexit);  
    if (!exitcode) {
      /* Trap Qhull errors in findDelaunay().  Without the setjmp(), Qhull
         will exit() after reporting an error */
      qh NOerrexit= False;
      findDelaunay (DIM);
    }
    qh NOerrexit= True;
  }
#if qh_QHpointer  /* see user.h */
  {
    qhT *oldqhA, *oldqhB;
    coordT pointsB[DIM*TOTpoints]; /* array of coordinates for each point */


    printf( "\nsave first triangulation and compute a new triangulation\n");
    oldqhA= qh_save_qhull();
    sprintf (flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
    numpoints= SIZEcube;
    makeDelaunay (pointsB, numpoints, dim, time(NULL)+1);
    for (i=numpoints; i--; )
      rows[i]= pointsB+dim*i;
    qh_printmatrix (outfile, "input", rows, numpoints, dim);
    exitcode= qh_new_qhull (dim, numpoints, pointsB, ismalloc,
                      flags, outfile, errfile); 
    if (!exitcode)
      print_summary();
    printf( "\nsave second triangulation and restore first one\n");
    oldqhB= qh_save_qhull();
    qh_restore_qhull (&oldqhA);
    print_summary();
    printf( "\nfree first triangulation and restore second one.\n");
    qh_freeqhull (qh_ALL);               /* free short and long memory used by first call */
			                 /* do not use qh_memfreeshort */
    qh_restore_qhull (&oldqhB);
    print_summary();
  }
#endif
  qh_freeqhull(!qh_ALL);                 /* free long memory */
  qh_memfreeshort (&curlong, &totlong);  /* free short memory and memory allocator */
  if (curlong || totlong) 
    fprintf (errfile, "qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);

  /*
    Run 3: halfspace intersection about the origin
  */
  printf( "\ncompute halfspace intersection about the origin for a diamond\n");
  sprintf (flags, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "Fp");
  numpoints= SIZEcube;
  makehalf (points, numpoints, dim);
  for (i=numpoints; i--; )
    rows[i]= points+(dim+1)*i;
  qh_printmatrix (outfile, "input as halfspace coefficients + offsets", rows, numpoints, dim+1);
  /* use qh_sethalfspace_all to transform the halfspaces yourself.  
     If so, set 'qh feasible_point and do not use option 'Hn,...' [it would retransform the halfspaces]
  */
  exitcode= qh_new_qhull (dim+1, numpoints, points, ismalloc,
                      flags, outfile, errfile); 
  if (!exitcode) 
    print_summary();
  qh_freeqhull (!qh_ALL);
  qh_memfreeshort (&curlong, &totlong);
  if (curlong || totlong)  /* could also check previous runs */
    fprintf (stderr, "qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n",
       totlong, curlong);
  return exitcode;
} /* main */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本视频在线一区| 91精品欧美福利在线观看| 欧美日韩一区二区不卡| 中文字幕乱码一区二区免费| 亚洲精品福利视频网站| 国产精品影视在线| 欧美成人猛片aaaaaaa| 亚洲日本在线a| 国产成人精品亚洲午夜麻豆| 欧美一级欧美三级| 无码av中文一区二区三区桃花岛| 91日韩一区二区三区| 久久男人中文字幕资源站| 亚洲第一福利视频在线| 91传媒视频在线播放| 国产精品国产成人国产三级 | 久久婷婷国产综合精品青草| 日韩高清不卡一区二区三区| 91偷拍与自偷拍精品| 国产精品―色哟哟| 国产伦精一区二区三区| 精品乱人伦小说| 另类人妖一区二区av| 日韩三级中文字幕| 日本伊人午夜精品| 日韩一区二区三区免费看| 午夜国产不卡在线观看视频| 欧美日韩国产美| 日韩黄色免费电影| 91精品国产综合久久久蜜臀图片| 亚洲国产日韩精品| 欧美日韩国产天堂| 日本视频免费一区| 欧美不卡一区二区三区四区| 精品一区在线看| 久久久不卡网国产精品一区| 国产专区欧美精品| 国产欧美日韩视频一区二区 | 国产欧美日韩激情| 成年人午夜久久久| 亚洲一区二区免费视频| 欧美日韩一区二区在线观看| 亚洲成人综合在线| 日韩欧美一级特黄在线播放| 国产一区二区三区在线看麻豆| 国产亚洲欧美日韩俺去了| 成+人+亚洲+综合天堂| 亚洲欧美日韩在线不卡| 在线播放国产精品二区一二区四区| 亚洲成人综合在线| 久久综合五月天婷婷伊人| 成人美女在线观看| 亚洲成人自拍偷拍| 精品福利一二区| 99riav一区二区三区| 天天操天天综合网| 久久亚洲春色中文字幕久久久| 成人禁用看黄a在线| 亚洲成人av资源| 久久久亚洲国产美女国产盗摄| 97国产精品videossex| 日日欢夜夜爽一区| 国产精品女人毛片| 91精品在线麻豆| 成人动漫一区二区在线| 日韩精彩视频在线观看| 中文字幕乱码久久午夜不卡| 欧美日韩午夜在线| 成人午夜视频在线| 日韩国产在线观看| 亚洲欧美区自拍先锋| 91精品午夜视频| 99久久er热在这里只有精品15| 日本成人在线看| 亚洲激情网站免费观看| 亚洲精品在线网站| 91超碰这里只有精品国产| 成人免费黄色大片| 韩国午夜理伦三级不卡影院| 亚洲一区日韩精品中文字幕| 日本一区免费视频| 日韩欧美区一区二| 日韩限制级电影在线观看| 大尺度一区二区| 狠狠色狠狠色综合| 无码av中文一区二区三区桃花岛| 中文字幕成人网| 久久久精品影视| 日韩免费观看高清完整版在线观看| 色久综合一二码| aaa欧美色吧激情视频| 国产一区二区免费视频| 日韩专区一卡二卡| 亚洲国产美女搞黄色| 亚洲欧美另类小说视频| 中文字幕免费不卡| 久久女同精品一区二区| 欧美r级电影在线观看| 欧美一区国产二区| 欧美理论片在线| 欧美女孩性生活视频| 欧美性感一区二区三区| 色久综合一二码| 色婷婷国产精品| 欧美制服丝袜第一页| 一本久久精品一区二区| 91美女片黄在线| 色综合av在线| 91福利精品视频| 欧美吻胸吃奶大尺度电影| 欧美性大战久久久久久久蜜臀 | 国产一区二区三区不卡在线观看| 日韩国产精品久久| 奇米影视在线99精品| 免费久久99精品国产| 久久国产日韩欧美精品| 久久成人免费电影| 国产精品一二三在| 成人夜色视频网站在线观看| av在线一区二区三区| 色狠狠桃花综合| 欧美私人免费视频| 制服视频三区第一页精品| 欧美一区二区三区四区视频| 欧美大胆人体bbbb| 久久综合九色综合久久久精品综合| 日韩限制级电影在线观看| 精品乱人伦小说| 丝袜亚洲另类欧美| 日韩中文字幕av电影| 久久精品国内一区二区三区| 国内一区二区在线| av中文字幕不卡| 欧美日韩精品欧美日韩精品一 | 免费在线观看视频一区| 久99久精品视频免费观看| 国产成人啪午夜精品网站男同| 99精品久久免费看蜜臀剧情介绍| 色伊人久久综合中文字幕| 欧美中文字幕久久| 精品国产一区二区三区四区四| 国产精品精品国产色婷婷| 婷婷丁香久久五月婷婷| 狠狠狠色丁香婷婷综合久久五月| 不卡一区二区三区四区| 欧美狂野另类xxxxoooo| 久久久五月婷婷| 亚洲国产欧美一区二区三区丁香婷 | 日韩精品一二三| 国产精品99久久久久久久女警 | 日韩久久久精品| 中文字幕一区二区三区在线播放| 亚洲午夜久久久久久久久电影网| 激情av综合网| 欧美日韩一级片网站| 国产欧美一区二区三区网站| 亚洲成人www| 成人国产精品免费观看视频| 欧美精品在线观看播放| 国产精品高潮久久久久无| 午夜电影久久久| 99久久精品国产导航| 欧美zozo另类异族| 亚洲亚洲人成综合网络| 成人理论电影网| 欧美成人video| 亚洲高清中文字幕| 99久久伊人精品| 久久久亚洲国产美女国产盗摄 | 亚洲视频免费在线| 国产一区二区三区最好精华液| 欧美日韩在线免费视频| 亚洲图片你懂的| 国产久卡久卡久卡久卡视频精品| 欧美日韩日日摸| 亚洲桃色在线一区| 成人精品一区二区三区中文字幕| 欧美电视剧免费观看| 丝袜美腿高跟呻吟高潮一区| 在线视频观看一区| 中文字幕日韩精品一区| 成人综合婷婷国产精品久久| 久久亚洲综合av| 久久99精品久久久久婷婷| 在线成人午夜影院| 三级一区在线视频先锋| 欧美视频三区在线播放| 亚洲综合成人在线视频| 色综合一区二区| 亚洲三级免费电影| 91小宝寻花一区二区三区| 国产精品对白交换视频| 成人精品免费看| 国产精品美女久久久久久久网站| 国产精品一品二品| 欧美高清一级片在线观看| 国产成人在线影院| 国产精品色哟哟| 99国产精品视频免费观看| 亚洲视频在线观看一区|