Search Results for

    Show / Hide Table of Contents

    Class DMesh3

    Inheritance
    Object
    DMesh3
    Implements
    IDeformableMesh
    IMesh
    IPointSet
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: g3
    Assembly: cs.temp.dll.dll
    Syntax
    public class DMesh3 : IDeformableMesh, IMesh, IPointSet

    Constructors

    DMesh3(DMesh3, Boolean, MeshComponents)

    Declaration
    public DMesh3(DMesh3 copy, bool bCompact, MeshComponents flags)
    Parameters
    Type Name Description
    DMesh3 copy
    Boolean bCompact
    MeshComponents flags

    DMesh3(DMesh3, Boolean, Boolean, Boolean, Boolean)

    Declaration
    public DMesh3(DMesh3 copy, bool bCompact = false, bool bWantNormals = true, bool bWantColors = true, bool bWantUVs = true)
    Parameters
    Type Name Description
    DMesh3 copy
    Boolean bCompact
    Boolean bWantNormals
    Boolean bWantColors
    Boolean bWantUVs

    DMesh3(IMesh, MeshHints, MeshComponents)

    Declaration
    public DMesh3(IMesh copy, MeshHints hints, MeshComponents flags)
    Parameters
    Type Name Description
    IMesh copy
    MeshHints hints
    MeshComponents flags

    DMesh3(IMesh, MeshHints, Boolean, Boolean, Boolean)

    Declaration
    public DMesh3(IMesh copy, MeshHints hints, bool bWantNormals = true, bool bWantColors = true, bool bWantUVs = true)
    Parameters
    Type Name Description
    IMesh copy
    MeshHints hints
    Boolean bWantNormals
    Boolean bWantColors
    Boolean bWantUVs

    DMesh3(MeshComponents)

    Declaration
    public DMesh3(MeshComponents flags)
    Parameters
    Type Name Description
    MeshComponents flags

    DMesh3(Boolean, Boolean, Boolean, Boolean)

    Declaration
    public DMesh3(bool bWantNormals = true, bool bWantColors = false, bool bWantUVs = false, bool bWantTriGroups = false)
    Parameters
    Type Name Description
    Boolean bWantNormals
    Boolean bWantColors
    Boolean bWantUVs
    Boolean bWantTriGroups

    Fields

    InvalidEdge

    Declaration
    public static readonly Index2i InvalidEdge
    Field Value
    Type Description
    Index2i

    InvalidID

    Declaration
    public const int InvalidID = -1
    Field Value
    Type Description
    Int32

    InvalidTriangle

    Declaration
    public static readonly Index3i InvalidTriangle
    Field Value
    Type Description
    Index3i

    InvalidVertex

    Declaration
    public static readonly Vector3d InvalidVertex
    Field Value
    Type Description
    Vector3d

    NonManifoldID

    Declaration
    public const int NonManifoldID = -2
    Field Value
    Type Description
    Int32

    Properties

    CachedBounds

    cached bounding box, lazily re-computed on access if mesh has changed

    Declaration
    public AxisAlignedBox3d CachedBounds { get; }
    Property Value
    Type Description
    AxisAlignedBox3d

    CachedIsClosed

    Declaration
    public bool CachedIsClosed { get; }
    Property Value
    Type Description
    Boolean

    ColorsBuffer

    Declaration
    public DVector<float> ColorsBuffer { get; set; }
    Property Value
    Type Description
    DVector<Single>

    CompactMetric

    returns measure of compactness in range [0,1], where 1 is fully compacted

    Declaration
    public double CompactMetric { get; }
    Property Value
    Type Description
    Double

    Components

    Declaration
    public MeshComponents Components { get; }
    Property Value
    Type Description
    MeshComponents

    EdgeCount

    Declaration
    public int EdgeCount { get; }
    Property Value
    Type Description
    Int32

    EdgesBuffer

    Declaration
    public DVector<int> EdgesBuffer { get; set; }
    Property Value
    Type Description
    DVector<Int32>

    EdgesRefCounts

    Declaration
    public RefCountVector EdgesRefCounts { get; set; }
    Property Value
    Type Description
    RefCountVector

    GroupsBuffer

    Declaration
    public DVector<int> GroupsBuffer { get; set; }
    Property Value
    Type Description
    DVector<Int32>

    HasMetadata

    Declaration
    public bool HasMetadata { get; }
    Property Value
    Type Description
    Boolean

    HasTriangleGroups

    Declaration
    public bool HasTriangleGroups { get; }
    Property Value
    Type Description
    Boolean

    HasVertexColors

    Declaration
    public bool HasVertexColors { get; }
    Property Value
    Type Description
    Boolean

    HasVertexNormals

    Declaration
    public bool HasVertexNormals { get; }
    Property Value
    Type Description
    Boolean

    HasVertexUVs

    Declaration
    public bool HasVertexUVs { get; }
    Property Value
    Type Description
    Boolean

    IsCompact

    returns true if vertices, edges, and triangles are all "dense" (Count == MaxID)

    Declaration
    public bool IsCompact { get; }
    Property Value
    Type Description
    Boolean

    IsCompactT

    returns true if triangle count == max triangle id

    Declaration
    public bool IsCompactT { get; }
    Property Value
    Type Description
    Boolean

    IsCompactV

    Returns true if vertex count == max vertex id

    Declaration
    public bool IsCompactV { get; }
    Property Value
    Type Description
    Boolean

    MaxEdgeID

    Declaration
    public int MaxEdgeID { get; }
    Property Value
    Type Description
    Int32

    MaxGroupID

    Declaration
    public int MaxGroupID { get; }
    Property Value
    Type Description
    Int32

    MaxTriangleID

    Declaration
    public int MaxTriangleID { get; }
    Property Value
    Type Description
    Int32

    MaxVertexID

    Declaration
    public int MaxVertexID { get; }
    Property Value
    Type Description
    Int32

    NormalsBuffer

    Declaration
    public DVector<float> NormalsBuffer { get; set; }
    Property Value
    Type Description
    DVector<Single>

    ShapeTimestamp

    ShapeTimestamp is incremented any time any vertex position is changed or the mesh topology is modified

    Declaration
    public int ShapeTimestamp { get; }
    Property Value
    Type Description
    Int32

    Timestamp

    Timestamp is incremented any time any change is made to the mesh

    Declaration
    public int Timestamp { get; }
    Property Value
    Type Description
    Int32

    TriangleCount

    Declaration
    public int TriangleCount { get; }
    Property Value
    Type Description
    Int32

    TrianglesBuffer

    Declaration
    public DVector<int> TrianglesBuffer { get; set; }
    Property Value
    Type Description
    DVector<Int32>

    TrianglesRefCounts

    Declaration
    public RefCountVector TrianglesRefCounts { get; set; }
    Property Value
    Type Description
    RefCountVector

    UVBuffer

    Declaration
    public DVector<float> UVBuffer { get; set; }
    Property Value
    Type Description
    DVector<Single>

    VertexCount

    Declaration
    public int VertexCount { get; }
    Property Value
    Type Description
    Int32

    VertexEdges

    Declaration
    public SmallListSet VertexEdges { get; set; }
    Property Value
    Type Description
    SmallListSet

    VerticesBuffer

    Declaration
    public DVector<double> VerticesBuffer { get; set; }
    Property Value
    Type Description
    DVector<Double>

    VerticesRefCounts

    Declaration
    public RefCountVector VerticesRefCounts { get; set; }
    Property Value
    Type Description
    RefCountVector

    Methods

    AllocateTriangleGroup()

    Declaration
    public int AllocateTriangleGroup()
    Returns
    Type Description
    Int32

    AppendTriangle(Index3i, Int32)

    Declaration
    public int AppendTriangle(Index3i tv, int gid = -1)
    Parameters
    Type Name Description
    Index3i tv
    Int32 gid
    Returns
    Type Description
    Int32

    AppendTriangle(Int32, Int32, Int32, Int32)

    Declaration
    public int AppendTriangle(int v0, int v1, int v2, int gid = -1)
    Parameters
    Type Name Description
    Int32 v0
    Int32 v1
    Int32 v2
    Int32 gid
    Returns
    Type Description
    Int32

    AppendVertex(DMesh3, Int32)

    copy vertex fromVID from existing source mesh, returns new vid

    Declaration
    public int AppendVertex(DMesh3 from, int fromVID)
    Parameters
    Type Name Description
    DMesh3 from
    Int32 fromVID
    Returns
    Type Description
    Int32

    AppendVertex(NewVertexInfo)

    Declaration
    public int AppendVertex(NewVertexInfo info)
    Parameters
    Type Name Description
    NewVertexInfo info
    Returns
    Type Description
    Int32

    AppendVertex(ref NewVertexInfo)

    Append new vertex at position and other fields, returns new vid

    Declaration
    public int AppendVertex(ref NewVertexInfo info)
    Parameters
    Type Name Description
    NewVertexInfo info
    Returns
    Type Description
    Int32

    AppendVertex(Vector3d)

    Append new vertex at position, returns new vid

    Declaration
    public int AppendVertex(Vector3d v)
    Parameters
    Type Name Description
    Vector3d v
    Returns
    Type Description
    Int32

    AttachMetadata(String, Object)

    Declaration
    public void AttachMetadata(string key, object o)
    Parameters
    Type Name Description
    String key
    Object o

    BeginUnsafeTrianglesInsert()

    Declaration
    public virtual void BeginUnsafeTrianglesInsert()

    BeginUnsafeVerticesInsert()

    Declaration
    public virtual void BeginUnsafeVerticesInsert()

    BoundaryEdgeIndices()

    Enumerate ids of boundary edges

    Declaration
    public IEnumerable<int> BoundaryEdgeIndices()
    Returns
    Type Description
    IEnumerable<Int32>

    CheckValidity(Boolean, FailMode)

    Declaration
    public bool CheckValidity(bool bAllowNonManifoldVertices = false, FailMode eFailMode = FailMode.Throw)
    Parameters
    Type Name Description
    Boolean bAllowNonManifoldVertices
    FailMode eFailMode
    Returns
    Type Description
    Boolean

    ClearMetadata()

    Declaration
    public void ClearMetadata()

    CollapseEdge(Int32, Int32, out DMesh3.EdgeCollapseInfo)

    Declaration
    public MeshResult CollapseEdge(int vKeep, int vRemove, out DMesh3.EdgeCollapseInfo collapse)
    Parameters
    Type Name Description
    Int32 vKeep
    Int32 vRemove
    DMesh3.EdgeCollapseInfo collapse
    Returns
    Type Description
    MeshResult

    CompactCopy(DMesh3, Boolean, Boolean, Boolean)

    Declaration
    public DMesh3.CompactInfo CompactCopy(DMesh3 copy, bool bNormals = true, bool bColors = true, bool bUVs = true)
    Parameters
    Type Name Description
    DMesh3 copy
    Boolean bNormals
    Boolean bColors
    Boolean bUVs
    Returns
    Type Description
    DMesh3.CompactInfo

    CompactInPlace(Boolean)

    Compact mesh in-place, by moving vertices around and rewriting indices. Should be faster if the amount of compacting is not too significant, and is useful in some places. [TODO] vertex_edges is not compacted. does not affect indices, but does keep memory.

    If bComputeCompactInfo=false, the returned CompactInfo is not initialized

    Declaration
    public DMesh3.CompactInfo CompactInPlace(bool bComputeCompactInfo = false)
    Parameters
    Type Name Description
    Boolean bComputeCompactInfo
    Returns
    Type Description
    DMesh3.CompactInfo

    Copy(DMesh3, Boolean, Boolean, Boolean)

    Declaration
    public void Copy(DMesh3 copy, bool bNormals = true, bool bColors = true, bool bUVs = true)
    Parameters
    Type Name Description
    DMesh3 copy
    Boolean bNormals
    Boolean bColors
    Boolean bUVs

    Copy(IMesh, MeshHints, Boolean, Boolean, Boolean)

    Copy IMesh into this mesh. Currently always compacts. [TODO] if we get dense hint, we could be smarter w/ vertex map, etc

    Declaration
    public DMesh3.CompactInfo Copy(IMesh copy, MeshHints hints, bool bNormals = true, bool bColors = true, bool bUVs = true)
    Parameters
    Type Name Description
    IMesh copy
    MeshHints hints
    Boolean bNormals
    Boolean bColors
    Boolean bUVs
    Returns
    Type Description
    DMesh3.CompactInfo

    debug_check_is_edge(Int32)

    Declaration
    public void debug_check_is_edge(int e)
    Parameters
    Type Name Description
    Int32 e

    debug_check_is_triangle(Int32)

    Declaration
    public void debug_check_is_triangle(int t)
    Parameters
    Type Name Description
    Int32 t

    debug_check_is_vertex(Int32)

    Declaration
    public void debug_check_is_vertex(int v)
    Parameters
    Type Name Description
    Int32 v

    debug_print_mesh()

    Declaration
    public void debug_print_mesh()

    debug_print_vertex(Int32)

    Declaration
    public void debug_print_vertex(int v)
    Parameters
    Type Name Description
    Int32 v

    DiscardTriangleGroups()

    Declaration
    public void DiscardTriangleGroups()

    DiscardVertexColors()

    Declaration
    public void DiscardVertexColors()

    DiscardVertexNormals()

    Declaration
    public void DiscardVertexNormals()

    DiscardVertexUVs()

    Declaration
    public void DiscardVertexUVs()

    edge_has_t(Int32, Int32)

    Declaration
    public bool edge_has_t(int eid, int tid)
    Parameters
    Type Name Description
    Int32 eid
    Int32 tid
    Returns
    Type Description
    Boolean

    edge_has_v(Int32, Int32)

    Declaration
    public bool edge_has_v(int eid, int vid)
    Parameters
    Type Name Description
    Int32 eid
    Int32 vid
    Returns
    Type Description
    Boolean

    edge_is_boundary(Int32)

    Declaration
    [Obsolete("edge_is_boundary will be removed in future, use IsBoundaryEdge instead")]
    public bool edge_is_boundary(int eid)
    Parameters
    Type Name Description
    Int32 eid
    Returns
    Type Description
    Boolean

    edge_other_t(Int32, Int32)

    Declaration
    public int edge_other_t(int eID, int tid)
    Parameters
    Type Name Description
    Int32 eID
    Int32 tid
    Returns
    Type Description
    Int32

    edge_other_v(Int32, Int32)

    Declaration
    public int edge_other_v(int eID, int vID)
    Parameters
    Type Name Description
    Int32 eID
    Int32 vID
    Returns
    Type Description
    Int32

    EdgeIndices()

    Declaration
    public IEnumerable<int> EdgeIndices()
    Returns
    Type Description
    IEnumerable<Int32>

    Edges()

    Enumerage edges. return value is [v0,v1,t0,t1], where t1 will be InvalidID if this is a boundary edge

    Declaration
    public IEnumerable<Index4i> Edges()
    Returns
    Type Description
    IEnumerable<Index4i>

    EnableTriangleGroups(Int32)

    Declaration
    public void EnableTriangleGroups(int initial_group = 0)
    Parameters
    Type Name Description
    Int32 initial_group

    EnableVertexColors(Vector3f)

    Declaration
    public void EnableVertexColors(Vector3f initial_color)
    Parameters
    Type Name Description
    Vector3f initial_color

    EnableVertexNormals(Vector3f)

    Declaration
    public void EnableVertexNormals(Vector3f initial_normal)
    Parameters
    Type Name Description
    Vector3f initial_normal

    EnableVertexUVs(Vector2f)

    Declaration
    public void EnableVertexUVs(Vector2f initial_uv)
    Parameters
    Type Name Description
    Vector2f initial_uv

    EndUnsafeTrianglesInsert()

    Declaration
    public virtual void EndUnsafeTrianglesInsert()

    EndUnsafeVerticesInsert()

    Declaration
    public virtual void EndUnsafeVerticesInsert()

    find_tri_neighbour_edge(Int32, Int32, Int32)

    Declaration
    public int find_tri_neighbour_edge(int tID, int vA, int vB)
    Parameters
    Type Name Description
    Int32 tID
    Int32 vA
    Int32 vB
    Returns
    Type Description
    Int32

    find_tri_neighbour_index(Int32, Int32, Int32)

    Declaration
    public int find_tri_neighbour_index(int tID, int vA, int vB)
    Parameters
    Type Name Description
    Int32 tID
    Int32 vA
    Int32 vB
    Returns
    Type Description
    Int32

    FindEdge(Int32, Int32)

    Find edgeid for edge [a,b]

    Declaration
    public int FindEdge(int vA, int vB)
    Parameters
    Type Name Description
    Int32 vA
    Int32 vB
    Returns
    Type Description
    Int32

    FindEdgeFromTri(Int32, Int32, Int32)

    Find edgeid for edge [a,b] from triangle that contains the edge. This is faster than FindEdge() because it is constant-time

    Declaration
    public int FindEdgeFromTri(int vA, int vB, int tID)
    Parameters
    Type Name Description
    Int32 vA
    Int32 vB
    Int32 tID
    Returns
    Type Description
    Int32

    FindMetadata(String)

    Declaration
    public object FindMetadata(string key)
    Parameters
    Type Name Description
    String key
    Returns
    Type Description
    Object

    FindTriangle(Int32, Int32, Int32)

    Find triangle made up of any permutation of vertices [a,b,c]

    Declaration
    public int FindTriangle(int a, int b, int c)
    Parameters
    Type Name Description
    Int32 a
    Int32 b
    Int32 c
    Returns
    Type Description
    Int32

    FlipEdge(Int32, out DMesh3.EdgeFlipInfo)

    Declaration
    public MeshResult FlipEdge(int eab, out DMesh3.EdgeFlipInfo flip)
    Parameters
    Type Name Description
    Int32 eab
    DMesh3.EdgeFlipInfo flip
    Returns
    Type Description
    MeshResult

    FlipEdge(Int32, Int32, out DMesh3.EdgeFlipInfo)

    Declaration
    public MeshResult FlipEdge(int vA, int vB, out DMesh3.EdgeFlipInfo flip)
    Parameters
    Type Name Description
    Int32 vA
    Int32 vB
    DMesh3.EdgeFlipInfo flip
    Returns
    Type Description
    MeshResult

    GetAllVertexGroups(Int32)

    Declaration
    public List<int> GetAllVertexGroups(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    List<Int32>

    GetAllVertexGroups(Int32, ref List<Int32>)

    returns all group IDs at vertex

    Declaration
    public bool GetAllVertexGroups(int vID, ref List<int> groups)
    Parameters
    Type Name Description
    Int32 vID
    List<Int32> groups
    Returns
    Type Description
    Boolean

    GetBounds()

    Computes bounding box of all vertices.

    Declaration
    public AxisAlignedBox3d GetBounds()
    Returns
    Type Description
    AxisAlignedBox3d

    GetEdge(Int32)

    return [v0,v1,t0,t1], or Index4i.Max if eid is invalid

    Declaration
    public Index4i GetEdge(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Index4i

    GetEdge(Int32, ref Int32, ref Int32, ref Int32, ref Int32)

    Declaration
    public bool GetEdge(int eID, ref int a, ref int b, ref int t0, ref int t1)
    Parameters
    Type Name Description
    Int32 eID
    Int32 a
    Int32 b
    Int32 t0
    Int32 t1
    Returns
    Type Description
    Boolean

    GetEdgeNormal(Int32)

    Declaration
    public Vector3d GetEdgeNormal(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Vector3d

    GetEdgeOpposingV(Int32)

    If edge has vertices [a,b], and is connected two triangles [a,b,c] and [a,b,d], this returns [c,d], or [c,InvalidID] for a boundary edge

    Declaration
    public Index2i GetEdgeOpposingV(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Index2i

    GetEdgePoint(Int32, Double)

    Declaration
    public Vector3d GetEdgePoint(int eID, double t)
    Parameters
    Type Name Description
    Int32 eID
    Double t
    Returns
    Type Description
    Vector3d

    GetEdgeT(Int32)

    Declaration
    public Index2i GetEdgeT(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Index2i

    GetEdgeV(Int32)

    Declaration
    public Index2i GetEdgeV(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Index2i

    GetEdgeV(Int32, ref Vector3d, ref Vector3d)

    Declaration
    public bool GetEdgeV(int eID, ref Vector3d a, ref Vector3d b)
    Parameters
    Type Name Description
    Int32 eID
    Vector3d a
    Vector3d b
    Returns
    Type Description
    Boolean

    GetMaxVtxEdgeCount()

    Declaration
    public int GetMaxVtxEdgeCount()
    Returns
    Type Description
    Int32

    GetOrientedBoundaryEdgeV(Int32)

    Declaration
    public Index2i GetOrientedBoundaryEdgeV(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Index2i

    GetTriangle(Int32)

    Declaration
    public Index3i GetTriangle(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Index3i

    GetTriangleGroup(Int32)

    Declaration
    public int GetTriangleGroup(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Int32

    GetTriArea(Int32)

    Declaration
    public double GetTriArea(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Double

    GetTriBaryNormal(Int32, Double, Double, Double)

    interpolate vertex normals of triangle using barycentric coordinates

    Declaration
    public Vector3d GetTriBaryNormal(int tID, double bary0, double bary1, double bary2)
    Parameters
    Type Name Description
    Int32 tID
    Double bary0
    Double bary1
    Double bary2
    Returns
    Type Description
    Vector3d

    GetTriBaryPoint(Int32, Double, Double, Double)

    Declaration
    public Vector3d GetTriBaryPoint(int tID, double bary0, double bary1, double bary2)
    Parameters
    Type Name Description
    Int32 tID
    Double bary0
    Double bary1
    Double bary2
    Returns
    Type Description
    Vector3d

    GetTriBaryPoint(Int32, Double, Double, Double, out NewVertexInfo)

    Compute interpolated vertex attributes at point of triangle

    Declaration
    public void GetTriBaryPoint(int tID, double bary0, double bary1, double bary2, out NewVertexInfo vinfo)
    Parameters
    Type Name Description
    Int32 tID
    Double bary0
    Double bary1
    Double bary2
    NewVertexInfo vinfo

    GetTriBounds(Int32)

    construct bounding box of triangle as efficiently as possible

    Declaration
    public AxisAlignedBox3d GetTriBounds(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    AxisAlignedBox3d

    GetTriCentroid(Int32)

    efficiently compute centroid of triangle

    Declaration
    public Vector3d GetTriCentroid(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Vector3d

    GetTriEdge(Int32, Int32)

    Declaration
    public int GetTriEdge(int tid, int j)
    Parameters
    Type Name Description
    Int32 tid
    Int32 j
    Returns
    Type Description
    Int32

    GetTriEdges(Int32)

    Declaration
    public Index3i GetTriEdges(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Index3i

    GetTriFrame(Int32, Int32)

    Construct stable frame at triangle centroid, where frame.Z is face normal, and frame.X is aligned with edge nEdge of triangle.

    Declaration
    public Frame3f GetTriFrame(int tID, int nEdge = 0)
    Parameters
    Type Name Description
    Int32 tID
    Int32 nEdge
    Returns
    Type Description
    Frame3f

    GetTriInfo(Int32, out Vector3d, out Double, out Vector3d)

    Declaration
    public void GetTriInfo(int tID, out Vector3d normal, out double fArea, out Vector3d vCentroid)
    Parameters
    Type Name Description
    Int32 tID
    Vector3d normal
    Double fArea
    Vector3d vCentroid

    GetTriInternalAngleR(Int32, Int32)

    compute internal angle at vertex i of triangle (where i is 0,1,2); TODO can be more efficient here, probably...

    Declaration
    public double GetTriInternalAngleR(int tID, int i)
    Parameters
    Type Name Description
    Int32 tID
    Int32 i
    Returns
    Type Description
    Double

    GetTriNeighbourTris(Int32)

    Declaration
    public Index3i GetTriNeighbourTris(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Index3i

    GetTriNormal(Int32)

    Declaration
    public Vector3d GetTriNormal(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Vector3d

    GetTriSolidAngle(Int32, ref Vector3d)

    compute solid angle of oriented triangle tID relative to point p - see WindingNumber()

    Declaration
    public double GetTriSolidAngle(int tID, ref Vector3d p)
    Parameters
    Type Name Description
    Int32 tID
    Vector3d p
    Returns
    Type Description
    Double

    GetTriVertex(Int32, Int32)

    Declaration
    public Vector3d GetTriVertex(int tid, int j)
    Parameters
    Type Name Description
    Int32 tid
    Int32 j
    Returns
    Type Description
    Vector3d

    GetTriVertices(Int32, ref Vector3d, ref Vector3d, ref Vector3d)

    Declaration
    public void GetTriVertices(int tID, ref Vector3d v0, ref Vector3d v1, ref Vector3d v2)
    Parameters
    Type Name Description
    Int32 tID
    Vector3d v0
    Vector3d v1
    Vector3d v2

    GetVertex(Int32)

    Declaration
    public Vector3d GetVertex(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Vector3d

    GetVertex(Int32, ref NewVertexInfo, Boolean, Boolean, Boolean)

    Declaration
    public bool GetVertex(int vID, ref NewVertexInfo vinfo, bool bWantNormals, bool bWantColors, bool bWantUVs)
    Parameters
    Type Name Description
    Int32 vID
    NewVertexInfo vinfo
    Boolean bWantNormals
    Boolean bWantColors
    Boolean bWantUVs
    Returns
    Type Description
    Boolean

    GetVertexAll(Int32)

    Declaration
    public NewVertexInfo GetVertexAll(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    NewVertexInfo

    GetVertexColor(Int32)

    Declaration
    public Vector3f GetVertexColor(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Vector3f

    GetVertexf(Int32)

    Declaration
    public Vector3f GetVertexf(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Vector3f

    GetVertexFrame(Int32, Boolean)

    Compute a normal/tangent frame at vertex that is "stable" as long as the mesh topology doesn't change, meaning that one axis of the frame will be computed from projection of outgoing edge. Requires that vertex normals are available. by default, frame.Z is normal, and .X points along mesh edge if bFrameNormalY, then frame.Y is normal (X still points along mesh edge)

    Declaration
    public Frame3f GetVertexFrame(int vID, bool bFrameNormalY = false)
    Parameters
    Type Name Description
    Int32 vID
    Boolean bFrameNormalY
    Returns
    Type Description
    Frame3f

    GetVertexGroups(Int32, out Index4i)

    returns up to 4 group IDs at vertex. Returns false if > 4 encountered

    Declaration
    public bool GetVertexGroups(int vID, out Index4i groups)
    Parameters
    Type Name Description
    Int32 vID
    Index4i groups
    Returns
    Type Description
    Boolean

    GetVertexNormal(Int32)

    Declaration
    public Vector3f GetVertexNormal(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Vector3f

    GetVertexUV(Int32)

    Declaration
    public Vector2f GetVertexUV(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Vector2f

    GetVtxEdgeCount(Int32)

    Declaration
    public int GetVtxEdgeCount(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Int32

    GetVtxEdges(Int32)

    Declaration
    [Obsolete("GetVtxEdges will be removed in future, use VtxEdgesItr instead")]
    public ReadOnlyCollection<int> GetVtxEdges(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    ReadOnlyCollection<Int32>

    GetVtxEdgeValence(Int32)

    Declaration
    [Obsolete("GetVtxEdgeValence will be removed in future, use GetVtxEdgeCount instead")]
    public int GetVtxEdgeValence(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Int32

    GetVtxNbrhood(Int32, Int32, ref Int32, ref Int32, ref Int32, ref Int32, ref Int32)

    from edge and vert, returns other vert, two opposing verts, and two triangles

    Declaration
    public void GetVtxNbrhood(int eID, int vID, ref int vOther, ref int oppV1, ref int oppV2, ref int t1, ref int t2)
    Parameters
    Type Name Description
    Int32 eID
    Int32 vID
    Int32 vOther
    Int32 oppV1
    Int32 oppV2
    Int32 t1
    Int32 t2

    GetVtxTriangleCount(Int32, Boolean)

    return # of triangles attached to vID, or -1 if invalid vertex if bBruteForce = true, explicitly checks, which creates a list and is expensive default is false, uses orientation, no memory allocation

    Declaration
    public int GetVtxTriangleCount(int vID, bool bBruteForce = false)
    Parameters
    Type Name Description
    Int32 vID
    Boolean bBruteForce
    Returns
    Type Description
    Int32

    GetVtxTriangles(Int32, List<Int32>, Boolean)

    Get triangle one-ring at vertex. bUseOrientation is more efficient but returns incorrect result if vertex is a bowtie

    Declaration
    public MeshResult GetVtxTriangles(int vID, List<int> vTriangles, bool bUseOrientation)
    Parameters
    Type Name Description
    Int32 vID
    List<Int32> vTriangles
    Boolean bUseOrientation
    Returns
    Type Description
    MeshResult

    InsertTriangle(Int32, Index3i, Int32, Boolean)

    Insert triangle at given index, assuming it is unused. If bUnsafe, we use fast id allocation that does not update free list. You should only be using this between BeginUnsafeTrianglesInsert() / EndUnsafeTrianglesInsert() calls

    Declaration
    public MeshResult InsertTriangle(int tid, Index3i tv, int gid = -1, bool bUnsafe = false)
    Parameters
    Type Name Description
    Int32 tid
    Index3i tv
    Int32 gid
    Boolean bUnsafe
    Returns
    Type Description
    MeshResult

    InsertVertex(Int32, NewVertexInfo)

    Declaration
    public MeshResult InsertVertex(int vid, NewVertexInfo info)
    Parameters
    Type Name Description
    Int32 vid
    NewVertexInfo info
    Returns
    Type Description
    MeshResult

    InsertVertex(Int32, ref NewVertexInfo, Boolean)

    insert vertex at given index, assuming it is unused If bUnsafe, we use fast id allocation that does not update free list. You should only be using this between BeginUnsafeVerticesInsert() / EndUnsafeVerticesInsert() calls

    Declaration
    public MeshResult InsertVertex(int vid, ref NewVertexInfo info, bool bUnsafe = false)
    Parameters
    Type Name Description
    Int32 vid
    NewVertexInfo info
    Boolean bUnsafe
    Returns
    Type Description
    MeshResult

    IsBoundaryEdge(Int32)

    Declaration
    public bool IsBoundaryEdge(int eid)
    Parameters
    Type Name Description
    Int32 eid
    Returns
    Type Description
    Boolean

    IsBoundaryTriangle(Int32)

    Returns true if any edge of triangle is a boundary edge

    Declaration
    public bool IsBoundaryTriangle(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Boolean

    IsBoundaryVertex(Int32)

    Declaration
    public bool IsBoundaryVertex(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Boolean

    IsBowtieVertex(Int32)

    returns true if vID is a "bowtie" vertex, ie multiple disjoint triangle sets in one-ring

    Declaration
    public bool IsBowtieVertex(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Boolean

    IsClosed()

    Declaration
    public bool IsClosed()
    Returns
    Type Description
    Boolean

    IsEdge(Int32)

    Declaration
    public bool IsEdge(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Boolean

    IsGroupBoundaryEdge(Int32)

    Returns true if the two triangles connected to edge have different group IDs

    Declaration
    public bool IsGroupBoundaryEdge(int eID)
    Parameters
    Type Name Description
    Int32 eID
    Returns
    Type Description
    Boolean

    IsGroupBoundaryVertex(Int32)

    returns true if vertex has more than one tri group in its tri nbrhood

    Declaration
    public bool IsGroupBoundaryVertex(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Boolean

    IsGroupJunctionVertex(Int32)

    returns true if more than two group boundary edges meet at vertex (ie 3+ groups meet at this vertex)

    Declaration
    public bool IsGroupJunctionVertex(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Boolean

    IsSameMesh(DMesh3, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Single)

    Check if this m2 is the same as this mesh. By default only checks vertices and triangles, turn on other parameters w/ flags

    Declaration
    public bool IsSameMesh(DMesh3 m2, bool bCheckConnectivity, bool bCheckEdgeIDs = false, bool bCheckNormals = false, bool bCheckColors = false, bool bCheckUVs = false, bool bCheckGroups = false, float Epsilon = 1.1920929E-07F)
    Parameters
    Type Name Description
    DMesh3 m2
    Boolean bCheckConnectivity
    Boolean bCheckEdgeIDs
    Boolean bCheckNormals
    Boolean bCheckColors
    Boolean bCheckUVs
    Boolean bCheckGroups
    Single Epsilon
    Returns
    Type Description
    Boolean

    IsTriangle(Int32)

    Declaration
    public bool IsTriangle(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Boolean

    IsVertex(Int32)

    Declaration
    public bool IsVertex(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Boolean

    MergeEdges(Int32, Int32, out DMesh3.MergeEdgesInfo)

    Declaration
    public MeshResult MergeEdges(int eKeep, int eDiscard, out DMesh3.MergeEdgesInfo merge_info)
    Parameters
    Type Name Description
    Int32 eKeep
    Int32 eDiscard
    DMesh3.MergeEdgesInfo merge_info
    Returns
    Type Description
    MeshResult

    MeshInfoString()

    Declaration
    public string MeshInfoString()
    Returns
    Type Description
    String

    PokeTriangle(Int32, out DMesh3.PokeTriangleInfo)

    Declaration
    public virtual MeshResult PokeTriangle(int tid, out DMesh3.PokeTriangleInfo result)
    Parameters
    Type Name Description
    Int32 tid
    DMesh3.PokeTriangleInfo result
    Returns
    Type Description
    MeshResult

    PokeTriangle(Int32, Vector3d, out DMesh3.PokeTriangleInfo)

    Declaration
    public virtual MeshResult PokeTriangle(int tid, Vector3d baryCoordinates, out DMesh3.PokeTriangleInfo result)
    Parameters
    Type Name Description
    Int32 tid
    Vector3d baryCoordinates
    DMesh3.PokeTriangleInfo result
    Returns
    Type Description
    MeshResult

    RebuildFromEdgeRefcounts()

    Rebuild mesh topology. assumes that we have initialized vertices, triangles, and edges buffers, and edges refcounts. Rebuilds vertex and tri refcounts, triangle edges, vertex edges.

    Declaration
    public void RebuildFromEdgeRefcounts()

    RemoveMetadata(String)

    Declaration
    public bool RemoveMetadata(string key)
    Parameters
    Type Name Description
    String key
    Returns
    Type Description
    Boolean

    RemoveTriangle(Int32, Boolean, Boolean)

    Remove a tID from the mesh. Also removes any unreferenced edges after tri is removed. If bRemoveIsolatedVertices is false, then if you remove all tris from a vert, that vert is also removed. If bPreserveManifold, we check that you will not create a bowtie vertex (and return false). If this check is not done, you have to make sure you don't create a bowtie, because other code assumes we don't have bowties, and will not handle it properly

    Declaration
    public MeshResult RemoveTriangle(int tID, bool bRemoveIsolatedVertices = true, bool bPreserveManifold = false)
    Parameters
    Type Name Description
    Int32 tID
    Boolean bRemoveIsolatedVertices
    Boolean bPreserveManifold
    Returns
    Type Description
    MeshResult

    RemoveVertex(Int32, Boolean, Boolean)

    Remove vertex vID, and all connected triangles if bRemoveAllTriangles = true (if false, them throws exception if there are still any triangles!) if bPreserveManifold, checks that we will not create a bowtie vertex first

    Declaration
    public MeshResult RemoveVertex(int vID, bool bRemoveAllTriangles = true, bool bPreserveManifold = false)
    Parameters
    Type Name Description
    Int32 vID
    Boolean bRemoveAllTriangles
    Boolean bPreserveManifold
    Returns
    Type Description
    MeshResult

    ReverseOrientation(Boolean)

    Declaration
    public void ReverseOrientation(bool bFlipNormals = true)
    Parameters
    Type Name Description
    Boolean bFlipNormals

    ReverseTriOrientation(Int32)

    Declaration
    public MeshResult ReverseTriOrientation(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    MeshResult

    SetTriangle(Int32, Index3i, Boolean)

    Declaration
    public virtual MeshResult SetTriangle(int tID, Index3i newv, bool bRemoveIsolatedVertices = true)
    Parameters
    Type Name Description
    Int32 tID
    Index3i newv
    Boolean bRemoveIsolatedVertices
    Returns
    Type Description
    MeshResult

    SetTriangleGroup(Int32, Int32)

    Declaration
    public void SetTriangleGroup(int tid, int group_id)
    Parameters
    Type Name Description
    Int32 tid
    Int32 group_id

    SetVertex(Int32, Vector3d)

    Declaration
    public void SetVertex(int vID, Vector3d vNewPos)
    Parameters
    Type Name Description
    Int32 vID
    Vector3d vNewPos

    SetVertexColor(Int32, Vector3f)

    Declaration
    public void SetVertexColor(int vID, Vector3f vNewColor)
    Parameters
    Type Name Description
    Int32 vID
    Vector3f vNewColor

    SetVertexNormal(Int32, Vector3f)

    Declaration
    public void SetVertexNormal(int vID, Vector3f vNewNormal)
    Parameters
    Type Name Description
    Int32 vID
    Vector3f vNewNormal

    SetVertexUV(Int32, Vector2f)

    Declaration
    public void SetVertexUV(int vID, Vector2f vNewUV)
    Parameters
    Type Name Description
    Int32 vID
    Vector2f vNewUV

    SplitEdge(Int32, out DMesh3.EdgeSplitInfo, Double)

    Split edge eab. split_t defines position along edge, and is assumed to be based on order of vertices returned by GetEdgeV()

    Declaration
    public MeshResult SplitEdge(int eab, out DMesh3.EdgeSplitInfo split, double split_t = 0.5)
    Parameters
    Type Name Description
    Int32 eab
    DMesh3.EdgeSplitInfo split
    Double split_t
    Returns
    Type Description
    MeshResult

    SplitEdge(Int32, Int32, out DMesh3.EdgeSplitInfo)

    Declaration
    public MeshResult SplitEdge(int vA, int vB, out DMesh3.EdgeSplitInfo split)
    Parameters
    Type Name Description
    Int32 vA
    Int32 vB
    DMesh3.EdgeSplitInfo split
    Returns
    Type Description
    MeshResult

    tri_has_neighbour_t(Int32, Int32)

    Declaration
    public bool tri_has_neighbour_t(int tCheck, int tNbr)
    Parameters
    Type Name Description
    Int32 tCheck
    Int32 tNbr
    Returns
    Type Description
    Boolean

    tri_has_sequential_v(Int32, Int32, Int32)

    Declaration
    public bool tri_has_sequential_v(int tID, int vA, int vB)
    Parameters
    Type Name Description
    Int32 tID
    Int32 vA
    Int32 vB
    Returns
    Type Description
    Boolean

    tri_has_v(Int32, Int32)

    Declaration
    public bool tri_has_v(int tID, int vID)
    Parameters
    Type Name Description
    Int32 tID
    Int32 vID
    Returns
    Type Description
    Boolean

    tri_is_boundary(Int32)

    Declaration
    public bool tri_is_boundary(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    Boolean

    TriangleIndices()

    Declaration
    public IEnumerable<int> TriangleIndices()
    Returns
    Type Description
    IEnumerable<Int32>

    Triangles()

    Enumerate triangles

    Declaration
    public IEnumerable<Index3i> Triangles()
    Returns
    Type Description
    IEnumerable<Index3i>

    TriTrianglesItr(Int32)

    Declaration
    public IEnumerable<int> TriTrianglesItr(int tID)
    Parameters
    Type Name Description
    Int32 tID
    Returns
    Type Description
    IEnumerable<Int32>

    vertex_is_boundary(Int32)

    Declaration
    [Obsolete("vertex_is_boundary will be removed in future, use IsBoundaryVertex instead")]
    public bool vertex_is_boundary(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    Boolean

    VertexIndices()

    Declaration
    public IEnumerable<int> VertexIndices()
    Returns
    Type Description
    IEnumerable<Int32>

    Vertices()

    Enumerate vertices

    Declaration
    public IEnumerable<Vector3d> Vertices()
    Returns
    Type Description
    IEnumerable<Vector3d>

    VtxAllBoundaryEdges(Int32, Int32[])

    Find edge ids of boundary edges connected to vertex. e needs to be large enough (ie call VtxBoundaryEdges, or as large as max one-ring) returns count, ie number of elements of e that were filled

    Declaration
    public int VtxAllBoundaryEdges(int vID, int[] e)
    Parameters
    Type Name Description
    Int32 vID
    Int32[] e
    Returns
    Type Description
    Int32

    VtxBoundaryEdges(Int32, ref Int32, ref Int32)

    Returns count of boundary edges at vertex, and the first two boundary edges if found. If return is > 2, call VtxAllBoundaryEdges

    Declaration
    public int VtxBoundaryEdges(int vID, ref int e0, ref int e1)
    Parameters
    Type Name Description
    Int32 vID
    Int32 e0
    Int32 e1
    Returns
    Type Description
    Int32

    VtxEdgesItr(Int32)

    Enumerate edge ids connected to vertex (ie edge one-ring)

    Declaration
    public IEnumerable<int> VtxEdgesItr(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    IEnumerable<Int32>

    VtxOneRingCentroid(Int32, ref Vector3d)

    Fastest possible one-ring centroid. This is used inside many other algorithms so it helps to have it be maximally efficient

    Declaration
    public void VtxOneRingCentroid(int vID, ref Vector3d centroid)
    Parameters
    Type Name Description
    Int32 vID
    Vector3d centroid

    VtxTrianglesItr(Int32)

    iterate over triangle IDs of vertex one-ring

    Declaration
    public IEnumerable<int> VtxTrianglesItr(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    IEnumerable<Int32>

    VtxVerticesItr(Int32)

    Enumerate "other" vertices of edges connected to vertex (ie vertex one-ring)

    Declaration
    public IEnumerable<int> VtxVerticesItr(int vID)
    Parameters
    Type Name Description
    Int32 vID
    Returns
    Type Description
    IEnumerable<Int32>

    WindingNumber(Vector3d)

    Compute mesh winding number, from Jacobson et al, Robust Inside-Outside Segmentation using Generalized Winding Numbers http://igl.ethz.ch/projects/winding-number/ returns ~0 for points outside a closed, consistently oriented mesh, and a positive or negative integer for points inside, with value > 1 depending on how many "times" the point inside the mesh (like in 2D polygon winding)

    Declaration
    public double WindingNumber(Vector3d v)
    Parameters
    Type Name Description
    Vector3d v
    Returns
    Type Description
    Double

    Implements

    IDeformableMesh
    IMesh
    IPointSet
    In This Article
    Back to top ViRGIS VR GIS