Class TriangleWriter
Helper methods for writing Triangle file formats.
Inheritance
Inherited Members
Namespace: UnityEngine.Experimental.U2D.TriangleNet.IO
Syntax
public class TriangleWriter
Methods
Write(Mesh, String)
Number the vertices and write them to a .node file.
Declaration
public void Write(Mesh mesh, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | |
| System.String | filename |
WriteEdges(Mesh, String)
Write the edges to an .edge file.
Declaration
public void WriteEdges(Mesh mesh, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | |
| System.String | filename |
WriteElements(Mesh, String)
Write the triangles to an .ele file.
Declaration
public void WriteElements(Mesh mesh, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | |
| System.String | filename |
WriteNeighbors(Mesh, String)
Write the triangle neighbors to a .neigh file.
Declaration
public void WriteNeighbors(Mesh mesh, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | |
| System.String | filename |
Remarks
WARNING: Be sure WriteElements has been called before, so the elements are numbered right!
WriteNodes(Mesh, String)
Number the vertices and write them to a .node file.
Declaration
public void WriteNodes(Mesh mesh, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | |
| System.String | filename |
WritePoly(IPolygon, String)
Write the segments and holes to a .poly file.
Declaration
public void WritePoly(IPolygon polygon, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| IPolygon | polygon | Data source. |
| System.String | filename | File name. |
Remarks
If the nodes should not be written into this file, make sure a .node file was written before, so that the nodes are numbered right.
WritePoly(Mesh, String)
Write the segments and holes to a .poly file.
Declaration
public void WritePoly(Mesh mesh, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | |
| System.String | filename |
WritePoly(Mesh, String, Boolean)
Write the segments and holes to a .poly file.
Declaration
public void WritePoly(Mesh mesh, string filename, bool writeNodes)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | Data source. |
| System.String | filename | File name. |
| System.Boolean | writeNodes | Write nodes into this file. |
Remarks
If the nodes should not be written into this file, make sure a .node file was written before, so that the nodes are numbered right.