QualityOptions.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. namespace UnityEngine.U2D.Animation.TriangleNet
  2. .Meshing
  3. {
  4. using System;
  5. using Animation.TriangleNet.Geometry;
  6. /// <summary>
  7. /// Mesh constraint options for quality triangulation.
  8. /// </summary>
  9. internal class QualityOptions
  10. {
  11. /// <summary>
  12. /// Gets or sets a maximum angle constraint.
  13. /// </summary>
  14. public double MaximumAngle { get; set; }
  15. /// <summary>
  16. /// Gets or sets a minimum angle constraint.
  17. /// </summary>
  18. public double MinimumAngle { get; set; }
  19. /// <summary>
  20. /// Gets or sets a maximum triangle area constraint.
  21. /// </summary>
  22. public double MaximumArea { get; set; }
  23. /// <summary>
  24. /// Gets or sets a user-defined triangle constraint.
  25. /// </summary>
  26. /// <remarks>
  27. /// The test function will be called for each triangle in the mesh. The
  28. /// second argument is the area of the triangle tested. If the function
  29. /// returns true, the triangle is considered bad and will be refined.
  30. /// </remarks>
  31. public Func<ITriangle, double, bool> UserTest { get; set; }
  32. /// <summary>
  33. /// Gets or sets an area constraint per triangle.
  34. /// </summary>
  35. /// <remarks>
  36. /// If this flag is set to true, the <see cref="ITriangle.Area"/> value will
  37. /// be used to check if a triangle needs refinement.
  38. /// </remarks>
  39. public bool VariableArea { get; set; }
  40. /// <summary>
  41. /// Gets or sets the maximum number of Steiner points to be inserted into the mesh.
  42. /// </summary>
  43. /// <remarks>
  44. /// If the value is 0 (default), an unknown number of Steiner points may be inserted
  45. /// to meet the other quality constraints.
  46. /// </remarks>
  47. public int SteinerPoints { get; set; }
  48. }
  49. }