TriangleNet.Primitives.NonRegular C# (CSharp) Method

NonRegular() public static method

Return a positive value if the point pd is incompatible with the circle or plane passing through pa, pb, and pc (meaning that pd is inside the circle or below the plane); a negative value if it is compatible; and zero if the four points are cocircular/coplanar. The points pa, pb, and pc must be in counterclockwise order, or the sign of the result will be reversed.
public static NonRegular ( System.Point pa, System.Point pb, System.Point pc, System.Point pd ) : double
pa System.Point Point a.
pb System.Point Point b.
pc System.Point Point c.
pd System.Point Point d.
return double
        public static double NonRegular(Point pa, Point pb, Point pc, Point pd)
        {
            return InCircle(pa, pb, pc, pd);
        }

Usage Example

Example #1
0
        public bool CheckDelaunay()
        {
            Otri otri    = new Otri();
            Otri otri1   = new Otri();
            Osub osub    = new Osub();
            bool noExact = Behavior.NoExact;

            Behavior.NoExact = false;
            int num = 0;

            foreach (Triangle value in this.mesh.triangles.Values)
            {
                otri.triangle = value;
                otri.orient   = 0;
                while (otri.orient < 3)
                {
                    Vertex vertex  = otri.Org();
                    Vertex vertex1 = otri.Dest();
                    Vertex vertex2 = otri.Apex();
                    otri.Sym(ref otri1);
                    Vertex vertex3 = otri1.Apex();
                    bool   flag    = (otri1.triangle == Mesh.dummytri || Otri.IsDead(otri1.triangle) || otri.triangle.id >= otri1.triangle.id || !(vertex != this.mesh.infvertex1) || !(vertex != this.mesh.infvertex2) || !(vertex != this.mesh.infvertex3) || !(vertex1 != this.mesh.infvertex1) || !(vertex1 != this.mesh.infvertex2) || !(vertex1 != this.mesh.infvertex3) || !(vertex2 != this.mesh.infvertex1) || !(vertex2 != this.mesh.infvertex2) || !(vertex2 != this.mesh.infvertex3) || !(vertex3 != this.mesh.infvertex1) || !(vertex3 != this.mesh.infvertex2) ? false : vertex3 != this.mesh.infvertex3);
                    if (this.mesh.checksegments & flag)
                    {
                        otri.SegPivot(ref osub);
                        if (osub.seg != Mesh.dummysub)
                        {
                            flag = false;
                        }
                    }
                    if (flag && Primitives.NonRegular(vertex, vertex1, vertex2, vertex3) > 0)
                    {
                        this.logger.Warning(string.Format("Non-regular pair of triangles found (IDs {0}/{1}).", otri.triangle.id, otri1.triangle.id), "Quality.CheckDelaunay()");
                        num++;
                    }
                    otri.orient = otri.orient + 1;
                }
            }
            if (num == 0)
            {
                this.logger.Info("Mesh is Delaunay.");
            }
            Behavior.NoExact = noExact;
            return(num == 0);
        }
All Usage Examples Of TriangleNet.Primitives::NonRegular