Fix index out of range exception in NewLocation code
git-svn-id: https://triangle.svn.codeplex.com/svn@73245 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5
This commit is contained in:
@@ -25,6 +25,12 @@ namespace TriangleNet
|
|||||||
Mesh mesh;
|
Mesh mesh;
|
||||||
Behavior behavior;
|
Behavior behavior;
|
||||||
|
|
||||||
|
// Work arrays for wegde intersection
|
||||||
|
double[] petalx = new double[20];
|
||||||
|
double[] petaly = new double[20];
|
||||||
|
double[] petalr = new double[20];
|
||||||
|
double[] wedges = new double[500];
|
||||||
|
|
||||||
public NewLocation(Mesh mesh)
|
public NewLocation(Mesh mesh)
|
||||||
{
|
{
|
||||||
this.mesh = mesh;
|
this.mesh = mesh;
|
||||||
@@ -2500,11 +2506,20 @@ namespace TriangleNet
|
|||||||
|
|
||||||
//double p[5];
|
//double p[5];
|
||||||
|
|
||||||
double[] petalx = new double[2 * numpoints];
|
// Resize work arrays
|
||||||
double[] petaly = new double[2 * numpoints];
|
if (2 * numpoints > petalx.Length)
|
||||||
double[] petalr = new double[2 * numpoints];
|
{
|
||||||
|
petalx = new double[2 * numpoints];
|
||||||
|
petaly = new double[2 * numpoints];
|
||||||
|
petalr = new double[2 * numpoints];
|
||||||
|
wedges = new double[2 * numpoints * 16 + 36];
|
||||||
|
|
||||||
|
if (Behavior.Verbose)
|
||||||
|
{
|
||||||
|
Log.SimpleLog.Instance.Info("NewLocation: resized work arrays (" + 2 * numpoints + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
double[] wedges = new double[2000];
|
|
||||||
double xmid, ymid, dist, x3, y3;
|
double xmid, ymid, dist, x3, y3;
|
||||||
double x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, tempx, tempy;
|
double x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, tempx, tempy;
|
||||||
double ux, uy;
|
double ux, uy;
|
||||||
@@ -2758,11 +2773,20 @@ namespace TriangleNet
|
|||||||
|
|
||||||
//double p[5];
|
//double p[5];
|
||||||
|
|
||||||
double[] petalx = new double[2 * numpoints];
|
// Resize work arrays
|
||||||
double[] petaly = new double[2 * numpoints];
|
if (2 * numpoints > petalx.Length)
|
||||||
double[] petalr = new double[2 * numpoints];
|
{
|
||||||
|
petalx = new double[2 * numpoints];
|
||||||
|
petaly = new double[2 * numpoints];
|
||||||
|
petalr = new double[2 * numpoints];
|
||||||
|
wedges = new double[2 * numpoints * 20 + 40];
|
||||||
|
|
||||||
|
if (Behavior.Verbose)
|
||||||
|
{
|
||||||
|
Log.SimpleLog.Instance.Info("NewLocation: resized work arrays (" + 2 * numpoints + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
double[] wedges = new double[2000];
|
|
||||||
double xmid, ymid, dist, x3, y3;
|
double xmid, ymid, dist, x3, y3;
|
||||||
double x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, tempx, tempy, x_5, y_5, x_6, y_6;
|
double x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, tempx, tempy, x_5, y_5, x_6, y_6;
|
||||||
double ux, uy;
|
double ux, uy;
|
||||||
|
|||||||
Reference in New Issue
Block a user