EarClipping Class

NOTE: This member is now obsolete. EarClipping class is deprecated, please use UtilityEx.Triangulate() method instead.

2D triangulation by Ear Clipping method.

EarClipping class is deprecated, please use Triangulate method instead.

Public Class EarClipping
This language is not supported or no code example is available.
public class EarClipping
This language is not supported or no code example is available.
Name Description
Public constructor EarClipping(IList<Point2D>, IList<IList<Point2D>>, bool) Point2D loops constructor.
Public constructor EarClipping(string) Loops contructor that loads the contours from a XML file generated by WriteXML method, for debugging purpose.
Top
Methods
 
Name Description
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Public method GetType Gets the Type of the current instance. (inherited from Object).
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Public method ToString Returns a string that represents the current object. (inherited from Object).
Public method Triangulate(natureType) Performs triangulation and output result in a ready to use Mesh entity.
Public method Triangulate(out Point2D[], out IndexTriangle[]) Performs triangulation and output result in the ecVertices and ecTriangles arrays.
Public method WriteXML(string, IList<Point2D>, IList<IList<Point2D>>) Write the EarClipping contours to an XML file for debugging purpose.
Public method WriteXML(string, List<IntPoint>, List<List<IntPoint>>) Write the EarClipping contours to an XML file for debugging purpose.
Top
Example
 
The following sample demonstrates how to triangulate two contours. The checkDir parameter is set to false because the contours are already properly oriented.
 Point2D[] outer = new Point2D[]
                         {
                             new Point2D(0, 0),
                             new Point2D(10, 0),
                             new Point2D(10, 6),
                             new Point2D(0, 6),
                             new Point2D(0, 0)
                         };
 
 Point2D[] inner = new Point2D[]
                         {
                             new Point2D(2, 2),
                             new Point2D(2, 3),
                             new Point2D(6, 2),
                             new Point2D(2, 2)
                         };
 
 EarClipping ea = new EarClipping(outer, new Point2D[][] { inner }, false);
 
 Mesh m = ea.Triangulate(Mesh.natureType.MulticolorSmooth);
 
 viewport1.Entities.Add(m, 0, Color.Coral);
 					
This language is not supported or no code example is available.
 Dim outer As Point2D() = New Point2D()
                          {
                             New Point2D(0, 0),
                             New Point2D(10, 0),
                             New Point2D(10, 6),
                             New Point2D(0, 6),
                             New Point2D(0, 0)
                          }
 
 Dim inner As Point2D() = New Point2D()
                          {
                             New Point2D(2, 2),
                             New Point2D(2, 3),
                             New Point2D(6, 2),
                             New Point2D(2, 2)
                          }
 
 Dim ea As New EarClipping(outer, New Point2D()() {inner}, False)
 
 Dim m As Mesh = ea.Triangulate(Mesh.natureType.MulticolorSmooth)
 
 Viewport1.Entities.Add(m, 0, Color.Coral)					
This language is not supported or no code example is available.
devDept.Eyeshot.Triangulation.EarClipping

.NET Framework

Supported in: 4.5, 4.6, 4.7

In this article

Definition