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.
Name | Description | |
---|---|---|
EarClipping(IList<Point2D>, IList<IList<Point2D>>, bool) | Point2D loops constructor. | |
EarClipping(string) | Loops contructor that loads the contours from a XML file generated by WriteXML method, for debugging purpose. |
Name | Description | |
---|---|---|
Equals(Object) | Determines whether the specified object is equal to the current object. (inherited from Object). | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object). | |
GetHashCode | Serves as the default hash function. (inherited from Object). | |
GetType | Gets the Type of the current instance. (inherited from Object). | |
MemberwiseClone | Creates a shallow copy of the current Object. (inherited from Object). | |
ToString | Returns a string that represents the current object. (inherited from Object). | |
Triangulate(natureType) | Performs triangulation and output result in a ready to use Mesh entity. | |
Triangulate(out Point2D[], out IndexTriangle[]) | Performs triangulation and output result in the ecVertices and ecTriangles arrays. | |
WriteXML(string, IList<Point2D>, IList<IList<Point2D>>) | Write the EarClipping contours to an XML file for debugging purpose. | |
WriteXML(string, List<IntPoint>, List<List<IntPoint>>) | Write the EarClipping contours to an XML file for debugging purpose. |
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