BadTriangle.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // -----------------------------------------------------------------------
  2. // <copyright file="BadTriangle.cs" company="">
  3. // Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
  4. // Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
  5. // </copyright>
  6. // -----------------------------------------------------------------------
  7. namespace UnityEngine.U2D.Animation.TriangleNet
  8. .Meshing.Data
  9. {
  10. using System;
  11. using Animation.TriangleNet.Geometry;
  12. using Animation.TriangleNet.Topology;
  13. /// <summary>
  14. /// A queue used to store bad triangles.
  15. /// </summary>
  16. /// <remarks>
  17. /// The key is the square of the cosine of the smallest angle of the triangle.
  18. /// Each triangle's vertices are stored so that one can check whether a
  19. /// triangle is still the same.
  20. /// </remarks>
  21. class BadTriangle
  22. {
  23. public Otri poortri; // A skinny or too-large triangle.
  24. public double key; // cos^2 of smallest (apical) angle.
  25. public Vertex org, dest, apex; // Its three vertices.
  26. public BadTriangle next; // Pointer to next bad triangle.
  27. public override string ToString()
  28. {
  29. return String.Format("B-TID {0}", poortri.tri.hash);
  30. }
  31. }
  32. }