⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 triangle.shar

📁 用c语言编写的约束Delauney网格剖分程序源代码
💻 SHAR
📖 第 1 页 / 共 5 页
字号:
#! /bin/sh# This is a shell archive, meaning:# 1. Remove everything above the #! /bin/sh line.# 2. Save the resulting text in a file.# 3. Execute the file with /bin/sh (not csh) to create:#	README#	triangle.c#	showme.c#	triangle.h#	tricall.c#	makefile#	A.poly# This archive created: Sun Jul 21 01:39:19 1996export PATH; PATH=/bin:/usr/bin:$PATHif test -f 'README'then	echo shar: "will not over-write existing file 'README'"elsecat << \SHAR_EOF > 'README'TriangleA Two-Dimensional Quality Mesh Generator and Delaunay Triangulator.Version 1.3Show MeA Display Program for Meshes and More.Version 1.3Copyright 1996 Jonathan Richard ShewchukSchool of Computer ScienceCarnegie Mellon University5000 Forbes AvenuePittsburgh, Pennsylvania  15213-3891Please send bugs and comments to jrs@cs.cmu.eduCreated as part of the Archimedes project (tools for parallel FEM).Supported in part by NSF Grant CMS-9318163 and an NSERC 1967 Scholarship.There is no warranty whatsoever.  Use at your own risk.Triangle generates exact Delaunay triangulations, constrained Delaunaytriangulations, and quality conforming Delaunay triangulations.  Thelatter can be generated with no small angles, and are thus suitable forfinite element analysis.  Show Me graphically displays the contents ofthe geometric files used by Triangle.  Show Me can also write images inPostScript form.Information on the algorithms used by Triangle, including completereferences, can be found in the comments at the beginning of the triangle.csource file.  Another listing of these references, with PostScript copiesof some of the papers, is available from the Web page    http://www.cs.cmu.edu/~quake/triangle.research.html------------------------------------------------------------------------------These programs may be freely redistributed under the condition that thecopyright notices (including the copy of this notice in the code commentsand the copyright notice printed when the `-h' switch is selected) arenot removed, and no compensation is received.  Private, research, andinstitutional use is free.  You may distribute modified versions of thiscode UNDER THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO ITIN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE ORIGINAL AUTHOR, BOTHSOURCE AND OBJECT CODE ARE MADE FREELY AVAILABLE WITHOUT CHARGE, ANDCLEAR NOTICE IS GIVEN OF THE MODIFICATIONS.  Distribution of this code aspart of a commercial system is permissible ONLY BY DIRECT ARRANGEMENTWITH THE AUTHOR.  (If you are not directly supplying this code to acustomer, and you are instead telling them how they can obtain it forfree, then you are not required to make any arrangement with me.)------------------------------------------------------------------------------The files included in this distribution are:  README           The file you're reading now.  triangle.c       Complete C source code for Triangle.  showme.c         Complete C source code for Show Me.  triangle.h       Include file for calling Triangle from another program.  tricall.c        Sample program that calls Triangle.  makefile         Makefile for compiling Triangle and Show Me.  A.poly           A sample data file.Triangle and Show Me are each a single portable C file.  The easiest way tocompile them is to edit and use the included makefile.  Before compiling,read the makefile, which describes your options, and edit it accordingly.You should specify:  The source and binary directories.  The C compiler and level of optimization.  Do you want single precision or double?  Do you want to leave out some of  Triangle's features to reduce the size of the executable file?  The "correct" directories for include files (especially X include files),  if necessary.Once you've done this, type "make" to compile the programs.  Alternatively,the files are usually easy to compile without a makefile:  cc -O -o triangle triangle.c -lm  cc -O -o showme showme.c -lX11On some systems, the C compiler won't be able to find the X include filesor libraries, and you'll need to specify an include path or library path:  cc -O -I/usr/local/include -o showme showme.c -L/usr/local/lib -lX11However, on other systems (like my workstation), the latter incantationwill cause the wrong files to be read, and the Show Me mouse buttons won'twork properly in the main window.  Hence, try the "-I" and "-L" switchesONLY if the compiler fails without it.  (If you're using the makefile, youmay edit it to add this switch.)Some processors, possibly including Intel x86 family and Motorola 68xxxfamily chips, are IEEE conformant but have extended length internalfloating-point registers that may defeat Triangle's exact arithmeticroutines by failing to cause enough roundoff error!  Typically, there isa way to set these internal registers so that they are rounded off toIEEE single or double precision format.  If you have such a processor,you should check your C compiler or system manuals to find out how toconfigure these internal registers to the precision you are using.Otherwise, the exact arithmetic routines won't be exact at all.Unfortunately, I don't have access to any such systems, and can't giveadvice on how to configure them.  These problems don't occur on anyworkstations I am aware of.  However, Triangle's exact arithmetic hasn'ta hope of working on machines like the Cray C90 or Y-MP, which are notIEEE conformant and have inaccurate rounding.Triangle and Show Me both produce their own documentation.  Completeinstructions are printed by invoking each program with the `-h' switch:  triangle -h  showme -hThe instructions are long; you'll probably want to pipe the output to`more' or `lpr' or redirect it to a file.  Both programs give a short listof command line options if they are invoked without arguments (that is,just type `triangle' or `showme').  Alternatively, you may want to readthe instructions on the World Wide Web.  The appropriate URLs are:  http://www.cs.cmu.edu/~quake/triangle.html  http://www.cs.cmu.edu/~quake/showme.htmlTry out Triangle on the enclosed sample file, A.poly:  triangle -p A  showme A.poly &Triangle will read the Planar Straight Line Graph defined by A.poly, andwrite its constrained Delaunay triangulation to A.1.node and A.1.ele.Show Me will display the figure defined by A.poly.  There are two buttonsmarked "ele" in the Show Me window; click on the top one.  This will causeShow Me to load and display the triangulation.For contrast, try running  triangle -pq ANow, click on the same "ele" button.  A new triangulation will be loaded;this one having no angles smaller than 20 degrees.To see a Voronoi diagram, try this:  cp A.poly A.node  triangle -v AClick the "ele" button again.  You will see the Delaunay triangulation ofthe points in A.poly, without the segments.  Now click the top "voro" button.You will see the Voronoi diagram corresponding to that Delaunay triangulation.Click the "Reset" button to see the full extent of the diagram.------------------------------------------------------------------------------If you wish to call Triangle from another program, instructions for doingso are contained in the file `triangle.h' (but read Triangle's regularinstructions first!).  Also look at `tricall.c', which provides an example.Type "make trilibrary" to create triangle.o, a callable object file.Alternatively, the object file is usually easy to compile without amakefile:  cc -DTRILIBRARY -O -c triangle.c------------------------------------------------------------------------------If you use Triangle, and especially if you use it to accomplish realwork, I would like very much to hear from you.  A short letter or email(to jrs@cs.cmu.edu) describing how you use Triangle will mean a lot tome.  The more people I know are using this program, the more easily I canjustify spending time on improvements and on the three-dimensionalsuccessor to Triangle, which in turn will benefit you.  Also, I can putyou on a list to receive email whenever a new version of Triangle isavailable.If you use a mesh generated by Triangle or plotted by Show Me in apublication, please include an acknowledgment as well.Jonathan Richard ShewchukJuly 20, 1996SHAR_EOFfiif test -f 'triangle.c'then	echo shar: "will not over-write existing file 'triangle.c'"elsecat << \SHAR_EOF > 'triangle.c'/*****************************************************************************//*                                                                           *//*      888888888        ,o,                          / 888                  *//*         888    88o88o  "    o8888o  88o8888o o88888o 888  o88888o         *//*         888    888    888       88b 888  888 888 888 888 d888  88b        *//*         888    888    888  o88^o888 888  888 "88888" 888 8888oo888        *//*         888    888    888 C888  888 888  888  /      888 q888             *//*         888    888    888  "88o^888 888  888 Cb      888  "88oooo"        *//*                                              "8oo8D                       *//*                                                                           *//*  A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator.      *//*  (triangle.c)                                                             *//*                                                                           *//*  Version 1.3                                                              *//*  July 19, 1996                                                            *//*                                                                           *//*  Copyright 1996                                                           *//*  Jonathan Richard Shewchuk                                                *//*  School of Computer Science                                               *//*  Carnegie Mellon University                                               *//*  5000 Forbes Avenue                                                       *//*  Pittsburgh, Pennsylvania  15213-3891                                     *//*  jrs@cs.cmu.edu                                                           *//*                                                                           */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -