Skip to content

Document default Delaunay Triangulation algorithm as Shewchuk #6438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
6 changes: 3 additions & 3 deletions doc/rst/source/contour.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Description
Reads an ASCII [or binary] *table* and produces a raw
contour plot by triangulation. By default, the optimal Delaunay
triangulation is performed (using either Shewchuk's [1996] or Watson's
[1982] method as selected during GMT installation; run the module with argument
**-** to see which method is selected), but the user may optionally
provide a second file with network information, such as a triangular
[1982] method as selected during GMT installation; run
**gmt get GMT_TRIANGULATE** to see which method is selected), but the user may
optionally provide a second file with network information, such as a triangular
mesh used for finite element modeling. In addition to contours, the area
between contours may be painted according to the CPT.
Alternatively, the *x, y, z* positions of the contour lines may be saved to
Expand Down
2 changes: 1 addition & 1 deletion doc/rst/source/gmt.conf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ GMT Miscellaneous Parameters
Determines if we use the **Watson** or **Shewchuk**
algorithm (if configured during installation) for triangulation.
Note that Shewchuk is required for operations involving Voronoi
constructions [default is **Watson**].
constructions [default is **Shewchuk**].

**GMT_VERBOSE**
(**-V**) Determines the level of verbosity used by GMT
Expand Down
4 changes: 2 additions & 2 deletions doc/rst/source/triangulate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ input file. As an option, you may choose to create a multiple segment
file that can be piped through :doc:`plot` to draw the triangulation
network. If **-G** **-I** are set a grid will be calculated based on the
surface defined by the planar triangles. The actual algorithm used in
the triangulations is either that of Watson [1982] [Default] or Shewchuk
[1996] (if installed; type **triangulate -** to see which method is
the triangulations is either that of Watson [1982] or Shewchuk [1996] [Default]
(if installed; type **gmt get GMT_TRIANGULATE** to see which method is
selected). This choice is made during the GMT installation. Furthermore,
if the Shewchuk algorithm is installed then you can also perform the
calculation of Voronoi polygons and optionally grid your data via the
Expand Down
10 changes: 5 additions & 5 deletions src/TRIANGLE.HOWTO
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

GMT contains two programs (triangulate and pscontour) that
directly or indirectly will do a Delaunay optimal triangulation
of arbitrarily spaced (x,y,z) data. By default, GMT uses
of arbitrarily spaced (x,y,z) data. In the early days, GMT used
a public domain (published) algorithm by Dave Watson [1982] to
to this. Now, a new and much faster algorithm has been released
to this. The default now though, is a new and much faster algorithm
by Jonathan Shewchuk [1996]. Because Shewchuk holds the copyright
(i.e., it is not in the public domain nor distributed under the GNU
Public License or the equivalent) you are advised to read it (see
Expand All @@ -15,12 +15,12 @@ If you later need to change the behavior w.r.t. triangulation,
follow these guidelines:

In makegmt.macro there are two parameters that can be defined:
TRIANGLE_D and TRIANGLE_O. By default they are commented out.
TRIANGLE_D and TRIANGLE_O. By default these lines are commented out.
To use Shewchuk's [1996] routine, remove the # from the
beginning of the lines and then 'make clean' and 'make install'.
To revert to the default GMT usage of Watson's [1982] algorithm,
To revert to using Watson's [1982] algorithm,
simply place a # in the first column at these two lines.
Then, say 'make clean' and 'make install' again.
Then, run 'make clean' and 'make install' again.
Comment on lines 17 to +23
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need a bit of help rewording these lines. I don't see makegmt.macro anywhere (the git blame on this file dates back to Dec 2000!!). I do see a TRIANGLE_D here:

gmt/src/gmt_init.c

Lines 6580 to 6585 in 434ed18

/* GMT_TRIANGULATE */
#ifdef TRIANGLE_D
GMT->current.setting.triangulate = GMT_TRIANGLE_SHEWCHUK;
#else
GMT->current.setting.triangulate = GMT_TRIANGLE_WATSON;
#endif

but no mention of TRIANGLE_O.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My best guess is that these macros are in reference to the pre-CMake days. I think that this paragraph and the preceding to sentences should instead make these points:

  1. Use gmt set GMT_TRIANGULATE to control which algorithm is used on the fly.
  2. Use set (LICENSE_RESTRICTED GPL) in cmake/ConfigUserAdvanced.cmake to disable Shewchuk's routine entirely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, pre-CMake language.


Paul Wessel, 16-AUG-1999

Expand Down