Class TriangleReader
Helper methods for reading Triangle file formats.
Inheritance
Inherited Members
Namespace: UnityEngine.Experimental.U2D.TriangleNet.IO
Syntax
public class TriangleReader
Methods
Read(String)
Reads geometry information from .node or .poly files.
Declaration
public IPolygon Read(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename |
Returns
| Type | Description |
|---|---|
| IPolygon |
Read(String, out Polygon)
Reads geometry information from .node or .poly files.
Declaration
public void Read(string filename, out Polygon polygon)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | |
| Polygon | polygon |
Read(String, out Polygon, out List<ITriangle>)
Reads a mesh from .node, .poly or .ele files.
Declaration
public void Read(string filename, out Polygon geometry, out List<ITriangle> triangles)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | |
| Polygon | geometry | |
| System.Collections.Generic.List<ITriangle> | triangles |
ReadEdgeFile(String, Int32)
Read an .edge file.
Declaration
public List<Edge> ReadEdgeFile(string edgeFile, int invertices)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | edgeFile | The file name. |
| System.Int32 | invertices | The number of input vertices (read from a .node or .poly file). |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<Edge> | A List of edges. |
ReadEleFile(String)
Read elements from an .ele file.
Declaration
public List<ITriangle> ReadEleFile(string elefilename)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | elefilename | The file name. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<ITriangle> | A list of triangles. |
ReadNodeFile(String)
Read the vertices from a file, which may be a .node or .poly file.
Declaration
public Polygon ReadNodeFile(string nodefilename)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | nodefilename |
Returns
| Type | Description |
|---|---|
| Polygon |
Remarks
Will NOT read associated .ele by default.
ReadNodeFile(String, Boolean)
Read the vertices from a file, which may be a .node or .poly file.
Declaration
public Polygon ReadNodeFile(string nodefilename, bool readElements)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | nodefilename | |
| System.Boolean | readElements |
Returns
| Type | Description |
|---|---|
| Polygon |
ReadPolyFile(String)
Read the vertices and segments from a .poly file.
Declaration
public Polygon ReadPolyFile(string polyfilename)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | polyfilename |
Returns
| Type | Description |
|---|---|
| Polygon |
Remarks
Will NOT read associated .ele by default.
ReadPolyFile(String, Boolean)
Read the vertices and segments from a .poly file.
Declaration
public Polygon ReadPolyFile(string polyfilename, bool readElements)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | polyfilename | |
| System.Boolean | readElements | If true, look for an associated .ele file. |
Returns
| Type | Description |
|---|---|
| Polygon |
Remarks
Will NOT read associated .area by default.
ReadPolyFile(String, Boolean, Boolean)
Read the vertices and segments from a .poly file.
Declaration
public Polygon ReadPolyFile(string polyfilename, bool readElements, bool readArea)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | polyfilename | |
| System.Boolean | readElements | If true, look for an associated .ele file. |
| System.Boolean | readArea |
Returns
| Type | Description |
|---|---|
| Polygon |