diff --git a/External/Triangle.NET/Triangle/Geometry/Contour.cs b/External/Triangle.NET/Triangle/Geometry/Contour.cs index db8fce4..47d71a4 100644 --- a/External/Triangle.NET/Triangle/Geometry/Contour.cs +++ b/External/Triangle.NET/Triangle/Geometry/Contour.cs @@ -130,6 +130,22 @@ namespace TriangleNet.Geometry private static Point FindPointInPolygon(List contour, int limit, double eps) { + if ( contour.Count <= 3 ) + { + var x = 0.0; + var y = 0.0; + + for ( int i = 0; i < contour.Count; i++ ) + { + x += contour[ i ].X; + y += contour[ i ].Y; + } + + var w = contour.Count == 0 ? 0 : ( 1.0 / contour.Count ); + + return new Point( x * w, y * w); + } + var bounds = new Rectangle(); bounds.Expand(contour.Cast()); @@ -204,7 +220,19 @@ namespace TriangleNet.Geometry } } - throw new Exception(); + + var exceptionInfo = "Found no point inside polygon:"; + + var sp = "G"; + var ci = System.Globalization.CultureInfo.InvariantCulture; + + for ( int i = 0; i < Math.Min( 20, length ); i++ ) + { + exceptionInfo += " "; + exceptionInfo += "(" + contour[ i ].X.ToString( sp, ci ) + ", " + contour[ i ].Y.ToString( sp, ci ) + ")"; + } + + throw new Exception( exceptionInfo ); } /// diff --git a/Icons/Rokojori-Action-Library-Logo.svg b/Icons/Rokojori-Action-Library-Logo.svg index 1851829..1d75c38 100644 --- a/Icons/Rokojori-Action-Library-Logo.svg +++ b/Icons/Rokojori-Action-Library-Logo.svg @@ -24,15 +24,15 @@ inkscape:deskcolor="#333333" inkscape:document-units="px" showgrid="false" - inkscape:zoom="0.41781005" - inkscape:cx="543.30909" - inkscape:cy="522.96492" + inkscape:zoom="1.6712402" + inkscape:cx="304.56424" + inkscape:cy="543.00992" inkscape:window-width="1920" inkscape:window-height="1017" inkscape:window-x="-8" inkscape:window-y="-8" inkscape:window-maximized="1" - inkscape:current-layer="svg5" /> + style="display:inline;fill:#ffffff;fill-opacity:1">