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); }
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)); }
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); }
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)); }
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); }
internal static double TriangleQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon) { return TriangleQuality(ghostTriangle.ToTriangle(polygon)); }
internal static double ShapeQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon) { Triangle2D triangle = ghostTriangle.ToTriangle(polygon); return ShapeQuality(triangle); }
static internal double AreaQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon) { Triangle2D triangle = ghostTriangle.ToTriangle(polygon); return(AreaQuality(triangle)); }
static internal double TriangleQuality(GhostTriangle2D ghostTriangle, Polygon2D polygon) { return(TriangleQuality(ghostTriangle.ToTriangle(polygon))); }