Documentation

This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

vertexAttachments

Class: TriRep

(Not recommended) Return simplices attached to specified vertices

Note

`vertexAttachments(TriRep)` is not recommended. Use `vertexAttachments(triangulation)` instead.

`TriRep` is not recommended. Use `triangulation` instead.

Syntax

``` SI = vertexAttachments(TR, VI) ```

Description

` SI = vertexAttachments(TR, VI)` returns the vertex-to-simplex information for the specified vertices `VI`. For 2-D triangulations in MATLAB®, the triangles `SI` are arranged in counter-clockwise order around the attached vertex `VI`.

Input Arguments

 `TR` Triangulation representation `VI` `VI` is a column vector of indices into the array of points representing the vertex coordinates, `TR.X`. The simplices associated with vertex `i` are the `i`'th entry in the cell array. If `VI` is not specified the vertex-simplex information for the entire triangulation is returned.

Output Arguments

 `SI` Cell array of indices of the simplices attached to a vertex. A cell array is used to store the information because the number of simplices associated with each vertex can vary. The simplices associated with vertex `i` are in the `i`'th entry in the cell array `SI`.

Examples

Example 1

Load a 2-D triangulation and use `TriRep` to compute the vertex-to-triangle relations.

```load trimesh2d trep = TriRep(tri, x, y);```
Find the indices of the tetrahedra attached to the first vertex:
```Tv = vertexAttachments(trep, 1) Tv{:}```

Example 2

Perform a direct query of a 2-D triangulation created using `DelaunayTri`.

```x = rand(20,1); y = rand(20,1); dt = DelaunayTri(x,y);```
Find the triangles attached to vertex 5:
`t = vertexAttachments(dt,5);`
Plot the triangulation:
```triplot(dt); hold on;```
Plot the triangles attached to vertex 5 (in red):
```triplot(dt(t{:},:),x,y,'Color','r'); hold off;```

expand all