Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# directory where you want to put the executable programs. By default,
# both are the current directory.

SRC = ./
SRC = ./src/
BIN = ./

# CC should be set to the name of your favorite C compiler.
Expand Down Expand Up @@ -101,7 +101,7 @@ 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
$(BIN)tricall: $(SRC)tricall.c $(BIN)triangle.o
$(CC) $(CSWITCHES) -o $(BIN)tricall $(SRC)tricall.c \
$(BIN)triangle.o -lm

Expand Down
16 changes: 8 additions & 8 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ 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.
Makefile Makefile for compiling Triangle and Show Me.
src/triangle.c Complete C source code for Triangle.
src/showme.c Complete C source code for Show Me.
src/triangle.h Include file for calling Triangle from another program.
src/tricall.c Sample program that calls Triangle.
A.poly A sample input file.

Each of Triangle and Show Me is a single portable C file. The easiest way
Expand Down Expand Up @@ -85,13 +85,13 @@ accordingly. You should specify:
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
cc -O -o triangle src/triangle.c -lm
cc -O -o showme src/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
cc -O -I/usr/local/include -o showme src/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
Expand Down
58 changes: 36 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ of some of the papers, is available from the Web page

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
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
Expand All @@ -52,13 +52,13 @@ 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.
* README The file you're reading now.
* Makefile Makefile for compiling Triangle and Show Me.
* src/triangle.c Complete C source code for Triangle.
* src/showme.c Complete C source code for Show Me.
* src/triangle.h Include file for calling Triangle from another program.
* src/tricall.c Sample program that calls Triangle.
* 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
Expand Down Expand Up @@ -87,13 +87,17 @@ accordingly. You should specify:
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
```sh
cc -O -o triangle src/triangle.c -lm
cc -O -o showme src/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
```sh
cc -O -I/usr/local/include -o showme src/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
Expand All @@ -120,21 +124,25 @@ illustrated. Find it on the Web at
http://www.cs.cmu.edu/~quake/showme.html

Complete text instructions are printed by invoking each program with the
`-h' switch:
`-h` switch:

```sh
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.
`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').
without arguments (that is, just type `triangle` or `showme`).

Try out Triangle on the enclosed sample file, A.poly:

```sh
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.
Expand All @@ -144,15 +152,19 @@ Show Me to load and display the triangulation.

For contrast, try running

```sh
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:

```sh
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.
Expand All @@ -162,15 +174,17 @@ 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
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.
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
```sh
cc -DTRILIBRARY -O -c src/triangle.c
```

Type "make distclean" to remove all the object and executable files created
by make.
Expand All @@ -187,13 +201,13 @@ 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:
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.)'
Computational Geometry.)`


Jonathan Richard Shewchuk
Expand Down
6 changes: 3 additions & 3 deletions VS2010/Triangle.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\triangle.c" />
<ClCompile Include="..\src\triangle.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\triangle.h" />
<ClInclude Include="..\src\triangle.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions VS2010/Triangle.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\triangle.c">
<ClCompile Include="..\src\triangle.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\triangle.h">
<ClInclude Include="..\src\triangle.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.