Class TriangleReader | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class TriangleReader

    Helper methods for reading Triangle file formats.

    Inheritance
    System.Object
    TriangleReader
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023