4 macros that perform a variety of different forms of triangulation. These macros are part of a suite of modules for advanced Triangle generation and manipulation.
Name | Type | Description | |
in_fld | Mesh | Input data that should be triangulated. | |
Name | Type | Description | |
out_mesh | Mesh | Output triangulated data. | |
out_obj | TriObject | Directly renderable output object. | |
Delauney, Voronoi, Convex_Hull and Concave_Tri are all macros that perform various forms of triangulation. They are higher-level macros that internally use the triangle library to do the necessary calculations. The triangle library is a two-dimensional quality mesh generator and delaunay triangulator. It was written by Richard Shewchuk and more information about this library, its purpose and how it can be used can be found at http://www.cs.cmu.edu/~quake/triangle.html. Details of the license that this library is distributed under can be found in the LICENSE
file. This suite of modules has been used in a large AVS/Express project for geologic modeling.
The 4 macros presented here provide a higher-level interface to the triangle library. The triangle module provides a direct, low-level interface to the library. However using this module directly is not recommended as the interface is complex and entering incorrect data can lead to AVS/Express crashing. These macros provide an easier to use and more reliable interface to certain parts of the triangle library. The macros perform the following tasks:
Delauney
Performs a Delauney triangulation of input mesh. The input is treated as a series of points and a triangle mesh is output.
Voronoi
Performs a Voronoi triangulation of input mesh. The input is treated as a series of points and a line mesh is output. A voronoi triangulation can result in edges that extend to infinity. This macro changes these edges so that they can displayed by the standard viewer.
Convex_Hull
Determines the convex hull that surrounds the input mesh. The input is treated as a series of points and a line mesh is output.
Concave_Tri
Triangulates the polygon specified in the input mesh. The input is treated as a polygon mesh and a triangle mesh is output.
More information on the tasks that are being performed by each macro can be found on the triangle library home-page. Examples of how to use the macros can be found in the example applications library.
in_fld
The input mesh that is to be triangulated. Except for the Concave_Tri macro, all the macro treat the input mesh as a simple series of points. The Concave_Tri macro treats the input as a polygon mesh.
out_mesh
The output triangulated mesh generated from the input data. This mesh can be either a triangle or line mesh.
out_obj
The directly renderable output of these triangulation macros. This output contains the triangulated mesh and can be displayed in a 2D viewer. The modes and properties of each output object are set so that each type of output mesh can be identified.
Two utility macros are also provided along with the triangle library. These perform simpler tasks that are not done directly by the triangle library.
Triangle_Stats
Takes an input triangle mesh and calculates the area of each triangle. The calculated areas are placed into a cell data component. The macro outputs a new field structure and a renderable DataObject.
struct_to_fld
Converts a struct_triangulateio group into a field structure. The struct_triangulateio group is used by the low-level triangle module for both input and output. This macro takes that group and converts it into a triangle mesh and node data component that can be used by other Express module.
The Triangle project contains 8 example applications that provide a good illustration of what the triangle library is capable of. Most of these example use either the ClickSketch or ContinuousSketch modules to create input data. Those that use the ClickSketch module start out with a blank window and expect the user to create a polyline. This is done by clicking the right mouse button in the viewer window. You should see you polyline appear in red. Once you have completed this you should click the Done button. This begins the triangulation process. Once this has finished the results are shown in the viewer window. The ContinuousSketch module is similar except that the user should hold and drag with the right mouse button to create a trail of points.
The examples supplied are as follows, beginning with the ClickSketch examples.
TriConcavePolygonExample
TriConvexHullExample
TriDelauneyTriangulationExample
TriPointInPolygonExample
CTRL
-click the triangle containing the picked point is determined and displayed.
TriVoronoiExample
TriFaultExample
TriMovingRegionExample
TriAnimatedRegionExample
iac_proj/triangle/trimacs.v contains the V definitions of the high-level macros Delauney, Voronoi, Convex_Hull, Concave_Tri, Triangulate_Area, Triangle_Stats and struct_to_fld.
The low-level TriangleMods library containing the low-level modules does not specify a process. By default the express process will be used.
Dr. David Knight, Advanced Visual Systems, Inc.
Ma YingLiang, Manchester Visualization Centre Andrew Dodd, International AVS Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL