예제 #1
0
        internal static double CompatibleTriangleQuality(GhostTriangle2D ghostTriangle, Polygon2D firstPolygon, Polygon2D secondPolygon)
        {
            double d1 = TriangleQuality(ghostTriangle.ToTriangle(firstPolygon));
            double d2 = TriangleQuality(ghostTriangle.ToTriangle(secondPolygon));

            return Math.Min(d1, d2);
        }
예제 #2
0
        static internal double CompatibleTriangleQuality(GhostTriangle2D ghostTriangle, Polygon2D firstPolygon, Polygon2D secondPolygon)
        {
            double d1 = TriangleQuality(ghostTriangle.ToTriangle(firstPolygon));
            double d2 = TriangleQuality(ghostTriangle.ToTriangle(secondPolygon));

            return(Math.Min(d1, d2));
        }
예제 #3
0
        private void Divide(GhostTriangle2D ghostTriangle)
        {
            Triangle2D triangle = ghostTriangle.ToTriangle(firstPolygon);

            Point2D point = (triangle.A + triangle.B.ToVector() + triangle.C.ToVector()) / 3;

            Polygon2DEditor polygonEditor = new Polygon2DEditor(firstPolygon);

            polygonEditor.AddInnerPoint(point);

            triangle = ghostTriangle.ToTriangle(secondPolygon);

            point = (triangle.A + triangle.B.ToVector() + triangle.C.ToVector()) / 3;

            polygonEditor = new Polygon2DEditor(secondPolygon);

            polygonEditor.AddInnerPoint(point);
        }
예제 #4
0
        private GhostTriangle2D Split(Polygon2D first, Polygon2D second, GhostTriangle2D ghostTriangle)
        {
            Triangle2D    triangle  = ghostTriangle.ToTriangle(first);
            LineSegment2D splitLine = Max(triangle.AB, triangle.BC, triangle.AC);
            int           a         = first.GetPointIndex(splitLine.FirstPoint);
            int           b         = first.GetPointIndex(splitLine.LastPoint);
            Point2D       p1        = splitLine.MidPoint;

            splitLine = new LineSegment2D(second.GetPoint(a), second.GetPoint(b));
            Point2D p2 = splitLine.MidPoint;

            Polygon2DEditor polygonEditor = new Polygon2DEditor(first);

            polygonEditor.AddInnerPoint(p1);
            polygonEditor = new Polygon2DEditor(second);
            polygonEditor.AddInnerPoint(p2);

            return(new GhostTriangle2D(a, b, first.PointCount - 1));
        }
예제 #5
0
        private void Divide(GhostTriangle2D ghostTriangle)
        {
            Triangle2D triangle = ghostTriangle.ToTriangle(firstPolygon);

            Point2D point = (triangle.A + triangle.B.ToVector() + triangle.C.ToVector()) / 3;

            Polygon2DEditor polygonEditor = new Polygon2DEditor(firstPolygon);

            polygonEditor.AddInnerPoint(point);

            triangle = ghostTriangle.ToTriangle(secondPolygon);

            point = (triangle.A + triangle.B.ToVector() + triangle.C.ToVector()) / 3;

            polygonEditor = new Polygon2DEditor(secondPolygon);

            polygonEditor.AddInnerPoint(point);
        }
예제 #6
0
        private GhostTriangle2D Split(Polygon2D first, Polygon2D second, GhostTriangle2D ghostTriangle)
        {
            Triangle2D triangle = ghostTriangle.ToTriangle(first);
            LineSegment2D splitLine = Max(triangle.AB, triangle.BC, triangle.AC);
            int a = first.GetPointIndex(splitLine.FirstPoint);
            int b = first.GetPointIndex(splitLine.LastPoint);
            Point2D p1 = splitLine.MidPoint;
            splitLine = new LineSegment2D(second.GetPoint(a), second.GetPoint(b));
            Point2D p2 = splitLine.MidPoint;

            Polygon2DEditor polygonEditor = new Polygon2DEditor(first);
            polygonEditor.AddInnerPoint(p1);
            polygonEditor = new Polygon2DEditor(second);
            polygonEditor.AddInnerPoint(p2);

            return new GhostTriangle2D(a, b, first.PointCount - 1);
        }
예제 #7
0
 internal static double TriangleQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon)
 {
     return TriangleQuality(ghostTriangle.ToTriangle(polygon));
 }
예제 #8
0
        internal static double ShapeQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon)
        {
            Triangle2D triangle = ghostTriangle.ToTriangle(polygon);

            return ShapeQuality(triangle);
        }
예제 #9
0
        static internal double AreaQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon)
        {
            Triangle2D triangle = ghostTriangle.ToTriangle(polygon);

            return(AreaQuality(triangle));
        }
예제 #10
0
 static internal double TriangleQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon)
 {
     return(TriangleQuality(ghostTriangle.ToTriangle(polygon)));
 }