-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download of triangle.shar (md5sum 85d5a01d036bed7889e0e15136da18e2)
- Loading branch information
0 parents
commit c895269
Showing
7 changed files
with
20,319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
29 2 1 0 | ||
1 0.200000 -0.776400 -0.57 | ||
2 0.220000 -0.773200 -0.55 | ||
3 0.245600 -0.756400 -0.51 | ||
4 0.277600 -0.702000 -0.53 | ||
5 0.488800 -0.207600 0.28 | ||
6 0.504800 -0.207600 0.30 | ||
7 0.740800 -0.739600 0 | ||
8 0.756000 -0.761200 -0.01 | ||
9 0.774400 -0.772400 0 | ||
10 0.800000 -0.776400 0.02 | ||
11 0.800000 -0.792400 0.01 | ||
12 0.579200 -0.792400 -0.21 | ||
13 0.579200 -0.776400 -0.2 | ||
14 0.621600 -0.771600 -0.15 | ||
15 0.633600 -0.762800 -0.13 | ||
16 0.639200 -0.744400 -0.1 | ||
17 0.620800 -0.684400 -0.06 | ||
18 0.587200 -0.604400 -0.01 | ||
19 0.360800 -0.604400 -0.24 | ||
20 0.319200 -0.706800 -0.39 | ||
21 0.312000 -0.739600 -0.43 | ||
22 0.318400 -0.761200 -0.44 | ||
23 0.334400 -0.771600 -0.44 | ||
24 0.371200 -0.776400 -0.41 | ||
25 0.371200 -0.792400 -0.42 | ||
26 0.374400 -0.570000 -0.2 | ||
27 0.574400 -0.570000 0 | ||
28 0.473600 -0.330800 0.14 | ||
29 0.200000 -0.792400 -0.59 | ||
29 0 | ||
1 29 1 | ||
2 1 2 | ||
3 2 3 | ||
4 3 4 | ||
5 4 5 | ||
6 5 6 | ||
7 6 7 | ||
8 7 8 | ||
9 8 9 | ||
10 9 10 | ||
11 10 11 | ||
12 11 12 | ||
13 12 13 | ||
14 13 14 | ||
15 14 15 | ||
16 15 16 | ||
17 16 17 | ||
18 17 18 | ||
19 18 19 | ||
20 19 20 | ||
21 20 21 | ||
22 21 22 | ||
23 22 23 | ||
24 23 24 | ||
25 24 25 | ||
26 25 29 | ||
27 26 27 | ||
28 27 28 | ||
29 28 26 | ||
1 | ||
1 0.47 -0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
Triangle | ||
A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator. | ||
Version 1.6 | ||
|
||
Show Me | ||
A Display Program for Meshes and More. | ||
Version 1.6 | ||
|
||
Copyright 1993, 1995, 1997, 1998, 2002, 2005 Jonathan Richard Shewchuk | ||
2360 Woolsey #H | ||
Berkeley, California 94705-1927 | ||
Please send bugs and comments to jrs@cs.berkeley.edu | ||
|
||
Created as part of the Quake project (tools for earthquake simulation). | ||
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 Delaunay | ||
triangulations, conforming Delaunay triangulations, Voronoi diagrams, and | ||
high-quality triangular meshes. The latter can be generated with no small | ||
or large angles, and are thus suitable for finite element analysis. | ||
Show Me graphically displays the contents of the geometric files used by | ||
Triangle. Show Me can also write images in PostScript form. | ||
|
||
Information on the algorithms used by Triangle, including complete | ||
references, can be found in the comments at the beginning of the triangle.c | ||
source file. Another listing of these references, with PostScript copies | ||
of 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 the | ||
copyright notices (including the copy of this notice in the code comments | ||
and the copyright notice printed when the `-h' switch is selected) are | ||
not removed, and no compensation is received. Private, research, and | ||
institutional use is free. You may distribute modified versions of this | ||
code UNDER THE CONDITION THAT THIS CODE AND ANY MODIFICATIONS MADE TO IT | ||
IN THE SAME FILE REMAIN UNDER COPYRIGHT OF THE ORIGINAL AUTHOR, BOTH | ||
SOURCE AND OBJECT CODE ARE MADE FREELY AVAILABLE WITHOUT CHARGE, AND | ||
CLEAR NOTICE IS GIVEN OF THE MODIFICATIONS. Distribution of this code as | ||
part of a commercial system is permissible ONLY BY DIRECT ARRANGEMENT | ||
WITH THE AUTHOR. (If you are not directly supplying this code to a | ||
customer, and you are instead telling them how they can obtain it for | ||
free, 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 input file. | ||
|
||
Each of Triangle and Show Me is a single portable C file. The easiest way | ||
to compile 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. | ||
|
||
The "correct" directories for include files (especially X include files), | ||
if necessary. | ||
|
||
Do you want single precision or double? (The default is double.) Do you | ||
want to leave out some of Triangle's features to reduce the size of the | ||
executable file? Investigate the SINGLE, REDUCED, and CDT_ONLY symbols. | ||
|
||
If yours is not a Unix system, define the NO_TIMER symbol to remove the | ||
Unix-specific timing code. Also, don't try to compile Show Me; it only | ||
works with X Windows. | ||
|
||
If you are compiling on an Intel x86 CPU and using gcc w/Linux or | ||
Microsoft C, be sure to define the LINUX or CPU86 (for Microsoft) symbol | ||
during compilation so that the exact arithmetic works right. | ||
|
||
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 -lX11 | ||
|
||
On some systems, the C compiler won't be able to find the X include files | ||
or 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 -lX11 | ||
|
||
Some processors, including Intel x86 family and possibly Motorola 68xxx | ||
family chips, are IEEE conformant but have extended length internal | ||
floating-point registers that may defeat Triangle's exact arithmetic | ||
routines by failing to cause enough roundoff error! Typically, there is a | ||
way to set these internal registers so that they are rounded off to IEEE | ||
single or double precision format. I believe (but I'm not certain) that | ||
Triangle has the right incantations for x86 chips, if you have gcc running | ||
under Linux (define the LINUX compiler symbol) or Microsoft C (define the | ||
CPU86 compiler symbol). | ||
|
||
If you have a different processor or operating system, or if I got the | ||
incantations wrong, you should check your C compiler or system manuals to | ||
find out how to configure these internal registers to the precision you are | ||
using. Otherwise, the exact arithmetic routines won't be exact at all. | ||
See http://www.cs.cmu.edu/~quake/robust.pc.html for details. Triangle's | ||
exact arithmetic hasn't a hope of working on machines like the Cray C90 or | ||
Y-MP, which are not IEEE conformant and have inaccurate rounding. | ||
|
||
Triangle and Show Me have both text and HTML documentation. The latter is | ||
illustrated. Find it on the Web at | ||
|
||
http://www.cs.cmu.edu/~quake/triangle.html | ||
http://www.cs.cmu.edu/~quake/showme.html | ||
|
||
Complete text instructions are printed by invoking each program with the | ||
`-h' switch: | ||
|
||
triangle -h | ||
showme -h | ||
|
||
The 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 list of command line options if they are invoked | ||
without arguments (that is, just type `triangle' or `showme'). | ||
|
||
Try 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, and | ||
write 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 buttons | ||
marked "ele" in the Show Me window; click on the top one. This will cause | ||
Show Me to load and display the triangulation. | ||
|
||
For contrast, try running | ||
|
||
triangle -pq A | ||
|
||
Now, 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 A | ||
|
||
Click the "ele" button again. You will see the Delaunay triangulation of | ||
the 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 doing | ||
so are contained in the file `triangle.h' (but read Triangle's regular | ||
instructions first!). Also look at `tricall.c', which provides an example | ||
of how to call Triangle. | ||
|
||
Type "make trilibrary" to create triangle.o, a callable object file. | ||
Alternatively, the object file is usually easy to compile without a | ||
makefile: | ||
|
||
cc -DTRILIBRARY -O -c triangle.c | ||
|
||
Type "make distclean" to remove all the object and executable files created | ||
by make. | ||
|
||
------------------------------------------------------------------------------ | ||
|
||
If you use Triangle, and especially if you use it to accomplish real work, | ||
I would like very much to hear from you. A short letter or email (to | ||
jrs@cs.berkeley.edu) describing how you use Triangle will mean a lot to me. | ||
The more people I know are using this program, the more easily I can | ||
justify spending time on improvements and on the three-dimensional | ||
successor to Triangle, which in turn will benefit you. Also, I can put you | ||
on a list to receive email whenever a new version of Triangle is available. | ||
|
||
If you use a mesh generated by Triangle or plotted by Show Me in a | ||
publication, please include an acknowledgment as well. And please spell | ||
Triangle with a capital `T'! If you want to include a citation, use | ||
`Jonathan Richard Shewchuk, ``Triangle: Engineering a 2D Quality Mesh | ||
Generator and Delaunay Triangulator,'' in Applied Computational Geometry: | ||
Towards Geometric Engineering (Ming C. Lin and Dinesh Manocha, editors), | ||
volume 1148 of Lecture Notes in Computer Science, pages 203-222, | ||
Springer-Verlag, Berlin, May 1996. (From the First ACM Workshop on Applied | ||
Computational Geometry.)' | ||
|
||
|
||
Jonathan Richard Shewchuk | ||
July 27, 2005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# makefile for Triangle and Show Me | ||
# | ||
# Type "make" to compile Triangle and Show Me. | ||
# | ||
# After compiling, type "triangle -h" and "showme -h" to read instructions | ||
# for using each of these programs. | ||
# | ||
# Type "make trilibrary" to compile Triangle as an object file (triangle.o). | ||
# | ||
# Type "make distclean" to delete all object and executable files. | ||
|
||
# SRC is the directory in which the C source files are, and BIN is the | ||
# directory where you want to put the executable programs. By default, | ||
# both are the current directory. | ||
|
||
SRC = ./ | ||
BIN = ./ | ||
|
||
# CC should be set to the name of your favorite C compiler. | ||
|
||
CC = cc | ||
|
||
# CSWITCHES is a list of all switches passed to the C compiler. I strongly | ||
# recommend using the best level of optimization. I also strongly | ||
# recommend timing each level of optimization to see which is the | ||
# best. For instance, when I had a DEC Alpha using DEC's optimizing | ||
# compiler, the -O2 switch generated a notably faster version of Triangle | ||
# than the -O3 switch. Go figure. | ||
# | ||
# By default, Triangle and Show Me use double precision floating point | ||
# numbers. If you prefer single precision, use the -DSINGLE switch. | ||
# Double precision uses more memory, but improves the resolution of | ||
# the meshes you can generate with Triangle. It also reduces the | ||
# likelihood of a floating exception due to overflow. Also, it is | ||
# much faster than single precision on many architectures. I recommend | ||
# double precision unless you want to generate a mesh for which you do | ||
# not have enough memory to use double precision. | ||
# | ||
# If yours is not a Unix system, use the -DNO_TIMER switch to eliminate the | ||
# Unix-specific timer code. Also, don't try to compile Show Me; it only | ||
# works with X Windows. | ||
# | ||
# To get the exact arithmetic to work right on an Intel processor, use the | ||
# -DCPU86 switch with Microsoft C, or the -DLINUX switch with gcc running | ||
# on Linux. The floating-point arithmetic might not be robust otherwise. | ||
# Please see http://www.cs.cmu.edu/~quake/robust.pc.html for details. | ||
# | ||
# If you are modifying Triangle, I recommend using the -DSELF_CHECK switch | ||
# while you are debugging. Defining the SELF_CHECK symbol causes | ||
# Triangle to include self-checking code. Triangle will execute more | ||
# slowly, however, so be sure to remove this switch before compiling a | ||
# production version. | ||
# | ||
# If the size of the Triangle binary is important to you, you may wish to | ||
# generate a reduced version of Triangle. The -DREDUCED switch gets rid | ||
# of all features that are primarily of research interest. Specifically, | ||
# defining the REDUCED symbol eliminates the -i, -F, -s, and -C switches. | ||
# The -DCDT_ONLY switch gets rid of all meshing algorithms above and beyond | ||
# constrained Delaunay triangulation. Specifically, defining the CDT_ONLY | ||
# symbol eliminates the -r, -q, -a, -u, -D, -S, and -s switches. The | ||
# REDUCED and CDT_ONLY symbols may be particularly attractive when Triangle | ||
# is called by another program that does not need all of Triangle's | ||
# features; in this case, these switches should appear as part of | ||
# "TRILIBDEFS" below. | ||
# | ||
# On some systems, you may need to include -I/usr/local/include and/or | ||
# -L/usr/local/lib in the compiler options to ensure that the X include | ||
# files and libraries that Show Me needs are found. If you get errors | ||
# like "Can't find include file X11/Xlib.h", you need the former switch. | ||
# Try compiling without them first; add them if that fails. | ||
# | ||
# An example CSWITCHES line is: | ||
# | ||
# CSWITCHES = -O -DNO_TIMER -DLINUX -I/usr/X11R6/include -L/usr/X11R6/lib | ||
|
||
CSWITCHES = -O -DLINUX -I/usr/X11R6/include -L/usr/X11R6/lib | ||
|
||
# TRILIBDEFS is a list of definitions used to compile an object code version | ||
# of Triangle (triangle.o) to be called by another program. The file | ||
# "triangle.h" contains detailed information on how to call triangle.o. | ||
# | ||
# The -DTRILIBRARY should always be used when compiling Triangle into an | ||
# object file. | ||
# | ||
# An example TRILIBDEFS line is: | ||
# | ||
# TRILIBDEFS = -DTRILIBRARY -DREDUCED -DCDT_ONLY | ||
|
||
TRILIBDEFS = -DTRILIBRARY | ||
|
||
# RM should be set to the name of your favorite rm (file deletion program). | ||
|
||
RM = /bin/rm | ||
|
||
# The action starts here. | ||
|
||
all: $(BIN)triangle $(BIN)showme | ||
|
||
trilibrary: $(BIN)triangle.o $(BIN)tricall | ||
|
||
$(BIN)triangle: $(SRC)triangle.c | ||
$(CC) $(CSWITCHES) -o $(BIN)triangle $(SRC)triangle.c -lm | ||
|
||
$(BIN)tricall: $(BIN)tricall.c $(BIN)triangle.o | ||
$(CC) $(CSWITCHES) -o $(BIN)tricall $(SRC)tricall.c \ | ||
$(BIN)triangle.o -lm | ||
|
||
$(BIN)triangle.o: $(SRC)triangle.c $(SRC)triangle.h | ||
$(CC) $(CSWITCHES) $(TRILIBDEFS) -c -o $(BIN)triangle.o \ | ||
$(SRC)triangle.c | ||
|
||
$(BIN)showme: $(SRC)showme.c | ||
$(CC) $(CSWITCHES) -o $(BIN)showme $(SRC)showme.c -lX11 | ||
|
||
distclean: | ||
$(RM) $(BIN)triangle $(BIN)triangle.o $(BIN)tricall $(BIN)showme |
Oops, something went wrong.