# Difference between revisions of "TIN with breaklines"

m |
m |
||

Line 1: | Line 1: | ||

− | + | == TIN<br> == | |

− | + | ||

− | + | <br> | |

− | + | ||

− | + | Triangular irregular networks (TIN) are widely spread in GIS community (in ESRI software, other commercial GIS and CAD) to represent surface morphology. | |

− | + | ||

− | + | The most common way of TIN construction is Delaunay triangulation. GRASS has module <v.delaunay> to do this task, but it don't work with "breaklines", e.g. with constrained Delaunay triangulation. | |

− | + | ||

− | + | <br> | |

− | + | ||

− | + | == <v.triangle> module<br> == | |

− | + | ||

− | + | Add-on module <a rel="nofollow" class="external text" href="https://raw.github.com/amuriy/GRASS-scripts/master/v.triangle">v.triangle</a> was written as attempt to close this gap. It's simply a "front-end" to the famous utility <a rel="nofollow" class="external text" href="http://www.cs.cmu.edu/~quake/triangle.html">Triangle</a> of J.R. Shewchuk, which makes exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations and high-quality triangular meshes. On GIS terminology, it produces 2D TIN, optionally with "breaklines". | |

− | + | ||

− | + | Module is a shell script that implements the main <Triangle> options and use it as "filter" to produce 2D TIN from the vector points/lines data. To use script you must to compile <Triangle> first and add it to system $PATH.<br> | |

− | + | ||

− | + | <br> | |

− | + | ||

− | + | <u>'''Usage:'''</u><br> '''v.triangle''' [-cdqalysif] ''points''=name [''lines''=name] ''tin''=name<br> [''max_area''=name] [''min_angle''=name] [''steiner_points''=name] [''save''=name]<br><br> | |

− | + | ||

− | + | <u>'''Flags:'''</u><br> '''-c''' Conforming constrained Delaunay triangulation without angle or area constraints<br> '''-d''' Conforming Delaunay triangulation<br> '''-q''' Quality mesh generation (all angles are between 20 and 140 degrees)<br> '''-a''' Imposes a maximum triangle area constraint<br> '''-l''' Uses only vertical cuts in the divide-and-conquer algorithm<br> '''-y''' Prohibits the insertion of Steiner points on the mesh boundary<br> '''-s ''' Specifies the maximum number of added Steiner points<br> '''-i ''' Uses the incremental algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm<br> '''-f''' Uses Steven Fortune's sweepline algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm<br> '''--o''' Allow output files to overwrite existing files<br> '''--v''' Verbose module output<br> '''--q ''' Quiet module output <br> | |

+ | |||

+ | <u>'''Parameters:'''</u><br> '''''points''''' Input vector map containing points<br> '''''lines''''' Input vector map containing breaklines<br> '''''tin''''' Name of output vector map (TIN)<br> '''''max_area''''' Maximum triangle area (use with "-a" flag)<br> '''''min_angle''''' Minimum mesh angle (use with "-q" flag)<br> '''''steiner_points''''' Specifies the maximum number of Steiner points that may be inserted into the mesh (use with "-s" flag)<br> '''''save''''' Path to save <Triangle> working files (*.node,*.poly,*.edge,*.ele,*.off). By default uses current location directory<br> | ||

+ | |||

+ | <br> | ||

+ | |||

+ | == Example<br> == | ||

+ | |||

+ | The following example was produced using ESRI sample data (masspoints and breaklines) to compare TIN's made in using ArcView 3D Analyst and Triangle.<br> | ||

+ | |||

+ | The command used: '''''v.triangle -c points=pts lines=lines tin=tin'''''<br> | ||

+ | |||

+ | [[File:ArcView_GRASS_TIN_breaklines.png]] | ||

+ | |||

+ | [[sv:Main Page/sv|sv:Main Page/sv]] |

## Revision as of 03:35, 23 April 2012

## TIN

Triangular irregular networks (TIN) are widely spread in GIS community (in ESRI software, other commercial GIS and CAD) to represent surface morphology.

The most common way of TIN construction is Delaunay triangulation. GRASS has module <v.delaunay> to do this task, but it don't work with "breaklines", e.g. with constrained Delaunay triangulation.

## <v.triangle> module

Add-on module <a rel="nofollow" class="external text" href="https://raw.github.com/amuriy/GRASS-scripts/master/v.triangle">v.triangle</a> was written as attempt to close this gap. It's simply a "front-end" to the famous utility <a rel="nofollow" class="external text" href="http://www.cs.cmu.edu/~quake/triangle.html">Triangle</a> of J.R. Shewchuk, which makes exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations and high-quality triangular meshes. On GIS terminology, it produces 2D TIN, optionally with "breaklines".

Module is a shell script that implements the main <Triangle> options and use it as "filter" to produce 2D TIN from the vector points/lines data. To use script you must to compile <Triangle> first and add it to system $PATH.

**Usage:**

**v.triangle** [-cdqalysif] *points*=name [*lines*=name] *tin*=name

[*max_area*=name] [*min_angle*=name] [*steiner_points*=name] [*save*=name]

**Flags:**

**-c** Conforming constrained Delaunay triangulation without angle or area constraints

**-d** Conforming Delaunay triangulation

**-q** Quality mesh generation (all angles are between 20 and 140 degrees)

**-a** Imposes a maximum triangle area constraint

**-l** Uses only vertical cuts in the divide-and-conquer algorithm

**-y** Prohibits the insertion of Steiner points on the mesh boundary

**-s ** Specifies the maximum number of added Steiner points

**-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

**--o** Allow output files to overwrite existing files

**--v** Verbose module output

**--q ** Quiet module output

**Parameters:**

* points* Input vector map containing points

*Input vector map containing breaklines*

**lines***Name of output vector map (TIN)*

**tin***Maximum triangle area (use with "-a" flag)*

**max_area***Minimum mesh angle (use with "-q" flag)*

**min_angle***Specifies the maximum number of Steiner points that may be inserted into the mesh (use with "-s" flag)*

**steiner_points***Path to save <Triangle> working files (*.node,*.poly,*.edge,*.ele,*.off). By default uses current location directory*

**save**

## Example

The following example was produced using ESRI sample data (masspoints and breaklines) to compare TIN's made in using ArcView 3D Analyst and Triangle.

The command used: **v.triangle -c points=pts lines=lines tin=tin**