# triangle **Repository Path**: DLUT_MeshGene/triangle ## Basic Information - **Project Name**: triangle - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2019-01-07 - **Last Updated**: 2024-06-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Triangle [A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator](https://www.cs.cmu.edu/~quake/triangle.html). Jonathan Richard Shewchuk Computer Science Division University of California at Berkeley Berkeley, California 94720-1776 ### Command line switches To run Triangle, the command line syntax is ``` triangle [-prq__a__uAcDjevngBPNEIOXzo_YS__iFlsCQVh] input_file ``` Underscores indicate that numbers may optionally follow certain switches. Do not put a space between a switch and its numeric parameter. input_file must be a file with extension .node, or extension .poly if the -p switch is used. If -r is used, you must supply .node and .ele files, and possibly a .poly file and an .area file as well. ------ For some of the command line switches described below, you may click on the switch for detailed information. - **-p** Triangulates a [Planar Straight Line Graph](https://www.cs.cmu.edu/~quake/triangle.defs.html#pslg) ([.poly](https://www.cs.cmu.edu/~quake/triangle.poly.html) file). - **-r** Refines a previously generated mesh. - **-q** Quality mesh generation with no angles smaller than 20 degrees. An alternate minimum angle may be specified after the `q'. - **-a** Imposes a maximum triangle area constraint. A fixed area constraint (that applies to every triangle) may be specified after the `a', or varying area constraints may be read from a [.poly](https://www.cs.cmu.edu/~quake/triangle.poly.html) file or [.area](https://www.cs.cmu.edu/~quake/triangle.area.html) file. - **-u** Imposes a user-defined constraint on triangle size. - **-A** Assigns a regional attribute to each triangle that identifies what segment-bounded region it belongs to. - **-c** Encloses the convex hull with segments. - **-D** Conforming Delaunay: use this switch if you want all triangles in the mesh to be Delaunay, and not just constrained Delaunay; or if you want to ensure that all Voronoi vertices lie within the triangulation. - **-j** Jettisons vertices that are not part of the final triangulation from the output .node file (including duplicate input vertices and vertices ``eaten'' by holes). - **-e** Outputs (to an [.edge](https://www.cs.cmu.edu/~quake/triangle.edge.html) file) a list of edges of the triangulation. - **-v** Outputs the [Voronoi diagram](https://www.cs.cmu.edu/~quake/triangle.defs.html#voronoi) associated with the triangulation. Does not attempt to detect degeneracies, so some Voronoi vertices may be duplicated. - **-n** Outputs (to a [.neigh](https://www.cs.cmu.edu/~quake/triangle.neigh.html) file) a list of triangles neighboring each triangle. - **-g** Outputs the mesh to an Object File Format (.off) file, suitable for viewing with [the Geometry Center's](http://www.geom.umn.edu/) [Geomview](http://www.geom.umn.edu/software/download/geomview.html) package. - **-B** Suppresses [boundary markers](https://www.cs.cmu.edu/~quake/triangle.markers.html) in the output [.node](https://www.cs.cmu.edu/~quake/triangle.node.html), [.poly](https://www.cs.cmu.edu/~quake/triangle.poly.html), and [.edge](https://www.cs.cmu.edu/~quake/triangle.edge.html) output files. - **-P** Suppresses the output [.poly](https://www.cs.cmu.edu/~quake/triangle.poly.html) file. Saves disk space, but you lose the ability to maintain constraining [segments](https://www.cs.cmu.edu/~quake/triangle.defs.html#segment) on later refinements of the mesh. - **-N** Suppresses the output [.node](https://www.cs.cmu.edu/~quake/triangle.node.html) file. - **-E** Suppresses the output [.ele](https://www.cs.cmu.edu/~quake/triangle.ele.html) file. - **-I** Suppresses mesh [iteration numbers](https://www.cs.cmu.edu/~quake/triangle.iteration.html). - **-O** Suppresses holes: ignores the holes in the [.poly](https://www.cs.cmu.edu/~quake/triangle.poly.html) file. - **-X** Suppresses [exact arithmetic](https://www.cs.cmu.edu/~quake/triangle.exact.html). - **-z** Numbers all items starting from zero (rather than one). Note that this switch is normally overrided by the value used to number the first vertex of the input [.node](https://www.cs.cmu.edu/~quake/triangle.node.html) or [.poly](https://www.cs.cmu.edu/~quake/triangle.poly.html) file. However, this switch is useful when calling Triangle from another program. - **-o2** Generates [second-order subparametric elements](https://www.cs.cmu.edu/~quake/triangle.highorder.html) with six nodes each. - **-Y** Prohibits the insertion of [Steiner points](https://www.cs.cmu.edu/~quake/triangle.defs.html#steiner) on the mesh boundary. If specified twice (-YY), it prohibits the insertion of Steiner points on any segment, including internal segments. - **-S** Specifies the maximum number of added [Steiner points](https://www.cs.cmu.edu/~quake/triangle.defs.html#steiner). - **-i** Uses the incremental algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm. - **-F** Uses Steven Fortune's sweepline algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm. - **-l** Uses only vertical cuts in the divide-and-conquer algorithm. By default, Triangle uses alternating vertical and horizontal cuts, which usually improve the speed except with vertex sets that are small or short and wide. This switch is primarily of theoretical interest. - **-s** Specifies that segments should be forced into the triangulation by recursively splitting them at their midpoints, rather than by generating a constrained Delaunay triangulation. Segment splitting is true to Ruppert's original algorithm, but can create needlessly small triangles. This switch is primarily of theoretical interest. - **-C** Check the consistency of the final mesh. Uses exact arithmetic for checking, even if the -X switch is used. Useful if you suspect Triangle is buggy. - **-Q** Quiet: Suppresses all explanation of what Triangle is doing, unless an error occurs. - **-V** Verbose: Gives detailed information about what Triangle is doing. Add more `V's for increasing amount of detail. `-V' gives information on algorithmic progress and [detailed statistics](https://www.cs.cmu.edu/~quake/triangle.stats.html). - **-h** Help: Displays [complete instructions](https://www.cs.cmu.edu/~quake/triangle.help.html).