From ba19fad8202f98b0dbc6a695ae46171239dae094 Mon Sep 17 00:00:00 2001 From: Vincent at Mars Date: Sun, 6 Dec 2020 19:21:32 +0800 Subject: [PATCH] fixed bug for getNormal method in PlanktonVertexList --- src/Plankton/PlanktonVertexList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plankton/PlanktonVertexList.cs b/src/Plankton/PlanktonVertexList.cs index cb056be..3d9c52e 100644 --- a/src/Plankton/PlanktonVertexList.cs +++ b/src/Plankton/PlanktonVertexList.cs @@ -395,8 +395,8 @@ public PlanktonXYZ GetNormal(int index) if (this.IsBoundary(index) == false) { normal += PlanktonXYZ.CrossProduct( - this[n-1].ToXYZ() - vertex, - this[0].ToXYZ() - vertex); + this[ring[n-1]].ToXYZ() - vertex, + this[ring[0]].ToXYZ() - vertex); } return normal * (-1.0f / normal.Length); // return unit vector