Class DMesh3
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
DMesh3(DMesh3, Boolean, Boolean, Boolean, Boolean)
Declaration
public DMesh3(DMesh3 copy, bool bCompact = false, bool bWantNormals = true, bool bWantColors = true, bool bWantUVs = true)
Parameters
DMesh3(IMesh, MeshHints, MeshComponents)
Declaration
public DMesh3(IMesh copy, MeshHints hints, MeshComponents flags)
Parameters
DMesh3(IMesh, MeshHints, Boolean, Boolean, Boolean)
Declaration
public DMesh3(IMesh copy, MeshHints hints, bool bWantNormals = true, bool bWantColors = true, bool bWantUVs = true)
Parameters
DMesh3(MeshComponents)
Declaration
public DMesh3(MeshComponents flags)
Parameters
DMesh3(Boolean, Boolean, Boolean, Boolean)
Declaration
public DMesh3(bool bWantNormals = true, bool bWantColors = false, bool bWantUVs = false, bool bWantTriGroups = false)
Parameters
Fields
InvalidEdge
Declaration
public static readonly Index2i InvalidEdge
Field Value
InvalidID
Declaration
public const int InvalidID = -1
Field Value
InvalidTriangle
Declaration
public static readonly Index3i InvalidTriangle
Field Value
InvalidVertex
Declaration
public static readonly Vector3d InvalidVertex
Field Value
NonManifoldID
Declaration
public const int NonManifoldID = -2
Field Value
Properties
CachedBounds
cached bounding box, lazily re-computed on access if mesh has changed
Declaration
public AxisAlignedBox3d CachedBounds { get; }
Property Value
CachedIsClosed
Declaration
public bool CachedIsClosed { get; }
Property Value
ColorsBuffer
Declaration
public DVector<float> ColorsBuffer { get; set; }
Property Value
CompactMetric
returns measure of compactness in range [0,1], where 1 is fully compacted
Declaration
public double CompactMetric { get; }
Property Value
Components
Declaration
public MeshComponents Components { get; }
Property Value
EdgeCount
Declaration
public int EdgeCount { get; }
Property Value
EdgesBuffer
Declaration
public DVector<int> EdgesBuffer { get; set; }
Property Value
EdgesRefCounts
Declaration
public RefCountVector EdgesRefCounts { get; set; }
Property Value
GroupsBuffer
Declaration
public DVector<int> GroupsBuffer { get; set; }
Property Value
Declaration
public bool HasMetadata { get; }
Property Value
HasTriangleGroups
Declaration
public bool HasTriangleGroups { get; }
Property Value
HasVertexColors
Declaration
public bool HasVertexColors { get; }
Property Value
HasVertexNormals
Declaration
public bool HasVertexNormals { get; }
Property Value
HasVertexUVs
Declaration
public bool HasVertexUVs { get; }
Property Value
IsCompact
returns true if vertices, edges, and triangles are all "dense" (Count == MaxID)
Declaration
public bool IsCompact { get; }
Property Value
IsCompactT
returns true if triangle count == max triangle id
Declaration
public bool IsCompactT { get; }
Property Value
IsCompactV
Returns true if vertex count == max vertex id
Declaration
public bool IsCompactV { get; }
Property Value
MaxEdgeID
Declaration
public int MaxEdgeID { get; }
Property Value
MaxGroupID
Declaration
public int MaxGroupID { get; }
Property Value
MaxTriangleID
Declaration
public int MaxTriangleID { get; }
Property Value
MaxVertexID
Declaration
public int MaxVertexID { get; }
Property Value
NormalsBuffer
Declaration
public DVector<float> NormalsBuffer { get; set; }
Property Value
ShapeTimestamp
ShapeTimestamp is incremented any time any vertex position is changed or the mesh topology is modified
Declaration
public int ShapeTimestamp { get; }
Property Value
Timestamp
Timestamp is incremented any time any change is made to the mesh
Declaration
public int Timestamp { get; }
Property Value
TriangleCount
Declaration
public int TriangleCount { get; }
Property Value
TrianglesBuffer
Declaration
public DVector<int> TrianglesBuffer { get; set; }
Property Value
TrianglesRefCounts
Declaration
public RefCountVector TrianglesRefCounts { get; set; }
Property Value
UVBuffer
Declaration
public DVector<float> UVBuffer { get; set; }
Property Value
VertexCount
Declaration
public int VertexCount { get; }
Property Value
VertexEdges
Declaration
public SmallListSet VertexEdges { get; set; }
Property Value
VerticesBuffer
Declaration
public DVector<double> VerticesBuffer { get; set; }
Property Value
VerticesRefCounts
Declaration
public RefCountVector VerticesRefCounts { get; set; }
Property Value
Methods
AllocateTriangleGroup()
Declaration
public int AllocateTriangleGroup()
Returns
AppendTriangle(Index3i, Int32)
Declaration
public int AppendTriangle(Index3i tv, int gid = -1)
Parameters
Returns
AppendTriangle(Int32, Int32, Int32, Int32)
Declaration
public int AppendTriangle(int v0, int v1, int v2, int gid = -1)
Parameters
Returns
AppendVertex(DMesh3, Int32)
copy vertex fromVID from existing source mesh, returns new vid
Declaration
public int AppendVertex(DMesh3 from, int fromVID)
Parameters
Returns
AppendVertex(NewVertexInfo)
Declaration
public int AppendVertex(NewVertexInfo info)
Parameters
Returns
AppendVertex(ref NewVertexInfo)
Append new vertex at position and other fields, returns new vid
Declaration
public int AppendVertex(ref NewVertexInfo info)
Parameters
Returns
AppendVertex(Vector3d)
Append new vertex at position, returns new vid
Declaration
public int AppendVertex(Vector3d v)
Parameters
Returns
Declaration
public void AttachMetadata(string key, object o)
Parameters
BeginUnsafeTrianglesInsert()
Declaration
public virtual void BeginUnsafeTrianglesInsert()
BeginUnsafeVerticesInsert()
Declaration
public virtual void BeginUnsafeVerticesInsert()
BoundaryEdgeIndices()
Enumerate ids of boundary edges
Declaration
public IEnumerable<int> BoundaryEdgeIndices()
Returns
CheckValidity(Boolean, FailMode)
Declaration
public bool CheckValidity(bool bAllowNonManifoldVertices = false, FailMode eFailMode = FailMode.Throw)
Parameters
Returns
Declaration
public void ClearMetadata()
CollapseEdge(Int32, Int32, out DMesh3.EdgeCollapseInfo)
Declaration
public MeshResult CollapseEdge(int vKeep, int vRemove, out DMesh3.EdgeCollapseInfo collapse)
Parameters
Returns
CompactCopy(DMesh3, Boolean, Boolean, Boolean)
Declaration
public DMesh3.CompactInfo CompactCopy(DMesh3 copy, bool bNormals = true, bool bColors = true, bool bUVs = true)
Parameters
Returns
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
Copy(DMesh3, Boolean, Boolean, Boolean)
Declaration
public void Copy(DMesh3 copy, bool bNormals = true, bool bColors = true, bool bUVs = true)
Parameters
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
Returns
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
Returns
edge_has_v(Int32, Int32)
Declaration
public bool edge_has_v(int eid, int vid)
Parameters
Returns
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
edge_other_t(Int32, Int32)
Declaration
public int edge_other_t(int eID, int tid)
Parameters
Returns
edge_other_v(Int32, Int32)
Declaration
public int edge_other_v(int eID, int vID)
Parameters
Returns
EdgeIndices()
Declaration
public IEnumerable<int> EdgeIndices()
Returns
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
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
Returns
find_tri_neighbour_index(Int32, Int32, Int32)
Declaration
public int find_tri_neighbour_index(int tID, int vA, int vB)
Parameters
Returns
FindEdge(Int32, Int32)
Find edgeid for edge [a,b]
Declaration
public int FindEdge(int vA, int vB)
Parameters
Returns
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
Returns
Declaration
public object FindMetadata(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
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
Returns
FlipEdge(Int32, out DMesh3.EdgeFlipInfo)
Declaration
public MeshResult FlipEdge(int eab, out DMesh3.EdgeFlipInfo flip)
Parameters
Returns
FlipEdge(Int32, Int32, out DMesh3.EdgeFlipInfo)
Declaration
public MeshResult FlipEdge(int vA, int vB, out DMesh3.EdgeFlipInfo flip)
Parameters
Returns
GetAllVertexGroups(Int32)
Declaration
public List<int> GetAllVertexGroups(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
GetAllVertexGroups(Int32, ref List<Int32>)
returns all group IDs at vertex
Declaration
public bool GetAllVertexGroups(int vID, ref List<int> groups)
Parameters
Returns
GetBounds()
Computes bounding box of all vertices.
Declaration
public AxisAlignedBox3d GetBounds()
Returns
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
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
Returns
GetEdgeNormal(Int32)
Declaration
public Vector3d GetEdgeNormal(int eID)
Parameters
Type |
Name |
Description |
Int32 |
eID |
|
Returns
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
GetEdgePoint(Int32, Double)
Declaration
public Vector3d GetEdgePoint(int eID, double t)
Parameters
Returns
GetEdgeT(Int32)
Declaration
public Index2i GetEdgeT(int eID)
Parameters
Type |
Name |
Description |
Int32 |
eID |
|
Returns
GetEdgeV(Int32)
Declaration
public Index2i GetEdgeV(int eID)
Parameters
Type |
Name |
Description |
Int32 |
eID |
|
Returns
GetEdgeV(Int32, ref Vector3d, ref Vector3d)
Declaration
public bool GetEdgeV(int eID, ref Vector3d a, ref Vector3d b)
Parameters
Returns
GetMaxVtxEdgeCount()
Declaration
public int GetMaxVtxEdgeCount()
Returns
GetOrientedBoundaryEdgeV(Int32)
Declaration
public Index2i GetOrientedBoundaryEdgeV(int eID)
Parameters
Type |
Name |
Description |
Int32 |
eID |
|
Returns
GetTriangle(Int32)
Declaration
public Index3i GetTriangle(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
GetTriangleGroup(Int32)
Declaration
public int GetTriangleGroup(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
GetTriArea(Int32)
Declaration
public double GetTriArea(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
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
Returns
GetTriBaryPoint(Int32, Double, Double, Double)
Declaration
public Vector3d GetTriBaryPoint(int tID, double bary0, double bary1, double bary2)
Parameters
Returns
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
GetTriBounds(Int32)
construct bounding box of triangle as efficiently as possible
Declaration
public AxisAlignedBox3d GetTriBounds(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
GetTriCentroid(Int32)
efficiently compute centroid of triangle
Declaration
public Vector3d GetTriCentroid(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
GetTriEdge(Int32, Int32)
Declaration
public int GetTriEdge(int tid, int j)
Parameters
Returns
GetTriEdges(Int32)
Declaration
public Index3i GetTriEdges(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
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
Returns
GetTriInfo(Int32, out Vector3d, out Double, out Vector3d)
Declaration
public void GetTriInfo(int tID, out Vector3d normal, out double fArea, out Vector3d vCentroid)
Parameters
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
Returns
GetTriNeighbourTris(Int32)
Declaration
public Index3i GetTriNeighbourTris(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
GetTriNormal(Int32)
Declaration
public Vector3d GetTriNormal(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
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
Returns
GetTriVertex(Int32, Int32)
Declaration
public Vector3d GetTriVertex(int tid, int j)
Parameters
Returns
GetTriVertices(Int32, ref Vector3d, ref Vector3d, ref Vector3d)
Declaration
public void GetTriVertices(int tID, ref Vector3d v0, ref Vector3d v1, ref Vector3d v2)
Parameters
GetVertex(Int32)
Declaration
public Vector3d GetVertex(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
GetVertex(Int32, ref NewVertexInfo, Boolean, Boolean, Boolean)
Declaration
public bool GetVertex(int vID, ref NewVertexInfo vinfo, bool bWantNormals, bool bWantColors, bool bWantUVs)
Parameters
Returns
GetVertexAll(Int32)
Declaration
public NewVertexInfo GetVertexAll(int i)
Parameters
Type |
Name |
Description |
Int32 |
i |
|
Returns
GetVertexColor(Int32)
Declaration
public Vector3f GetVertexColor(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
GetVertexf(Int32)
Declaration
public Vector3f GetVertexf(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
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
Returns
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
Returns
GetVertexNormal(Int32)
Declaration
public Vector3f GetVertexNormal(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
GetVertexUV(Int32)
Declaration
public Vector2f GetVertexUV(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
GetVtxEdgeCount(Int32)
Declaration
public int GetVtxEdgeCount(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
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
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
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
Returns
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
Returns
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
Returns
InsertVertex(Int32, NewVertexInfo)
Declaration
public MeshResult InsertVertex(int vid, NewVertexInfo info)
Parameters
Returns
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
Returns
IsBoundaryEdge(Int32)
Declaration
public bool IsBoundaryEdge(int eid)
Parameters
Type |
Name |
Description |
Int32 |
eid |
|
Returns
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
IsBoundaryVertex(Int32)
Declaration
public bool IsBoundaryVertex(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
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
IsClosed()
Declaration
Returns
IsEdge(Int32)
Declaration
public bool IsEdge(int eID)
Parameters
Type |
Name |
Description |
Int32 |
eID |
|
Returns
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
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
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
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
Returns
IsTriangle(Int32)
Declaration
public bool IsTriangle(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
IsVertex(Int32)
Declaration
public bool IsVertex(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
MergeEdges(Int32, Int32, out DMesh3.MergeEdgesInfo)
Declaration
public MeshResult MergeEdges(int eKeep, int eDiscard, out DMesh3.MergeEdgesInfo merge_info)
Parameters
Returns
MeshInfoString()
Declaration
public string MeshInfoString()
Returns
PokeTriangle(Int32, out DMesh3.PokeTriangleInfo)
Declaration
public virtual MeshResult PokeTriangle(int tid, out DMesh3.PokeTriangleInfo result)
Parameters
Returns
PokeTriangle(Int32, Vector3d, out DMesh3.PokeTriangleInfo)
Declaration
public virtual MeshResult PokeTriangle(int tid, Vector3d baryCoordinates, out DMesh3.PokeTriangleInfo result)
Parameters
Returns
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()
Declaration
public bool RemoveMetadata(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
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
Returns
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
Returns
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
SetTriangle(Int32, Index3i, Boolean)
Declaration
public virtual MeshResult SetTriangle(int tID, Index3i newv, bool bRemoveIsolatedVertices = true)
Parameters
Returns
SetTriangleGroup(Int32, Int32)
Declaration
public void SetTriangleGroup(int tid, int group_id)
Parameters
SetVertex(Int32, Vector3d)
Declaration
public void SetVertex(int vID, Vector3d vNewPos)
Parameters
SetVertexColor(Int32, Vector3f)
Declaration
public void SetVertexColor(int vID, Vector3f vNewColor)
Parameters
SetVertexNormal(Int32, Vector3f)
Declaration
public void SetVertexNormal(int vID, Vector3f vNewNormal)
Parameters
SetVertexUV(Int32, Vector2f)
Declaration
public void SetVertexUV(int vID, Vector2f vNewUV)
Parameters
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
Returns
SplitEdge(Int32, Int32, out DMesh3.EdgeSplitInfo)
Declaration
public MeshResult SplitEdge(int vA, int vB, out DMesh3.EdgeSplitInfo split)
Parameters
Returns
tri_has_neighbour_t(Int32, Int32)
Declaration
public bool tri_has_neighbour_t(int tCheck, int tNbr)
Parameters
Returns
tri_has_sequential_v(Int32, Int32, Int32)
Declaration
public bool tri_has_sequential_v(int tID, int vA, int vB)
Parameters
Returns
tri_has_v(Int32, Int32)
Declaration
public bool tri_has_v(int tID, int vID)
Parameters
Returns
tri_is_boundary(Int32)
Declaration
public bool tri_is_boundary(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
TriangleIndices()
Declaration
public IEnumerable<int> TriangleIndices()
Returns
Triangles()
Declaration
public IEnumerable<Index3i> Triangles()
Returns
TriTrianglesItr(Int32)
Declaration
public IEnumerable<int> TriTrianglesItr(int tID)
Parameters
Type |
Name |
Description |
Int32 |
tID |
|
Returns
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
VertexIndices()
Declaration
public IEnumerable<int> VertexIndices()
Returns
Vertices()
Declaration
public IEnumerable<Vector3d> Vertices()
Returns
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
Returns
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
Returns
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
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
VtxTrianglesItr(Int32)
iterate over triangle IDs of vertex one-ring
Declaration
public IEnumerable<int> VtxTrianglesItr(int vID)
Parameters
Type |
Name |
Description |
Int32 |
vID |
|
Returns
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
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
Returns
Implements