diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 72dc70f1d8..306eab441a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -269,6 +269,10 @@ namespace OpenSim.Region.Physics.Meshing primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides); + if (primMesh.errorMessage != null) + if (primMesh.errorMessage.Length > 0) + m_log.Error("[ERROR] " + primMesh.errorMessage); + primMesh.topShearX = pathShearX; primMesh.topShearY = pathShearY; primMesh.pathCutBegin = pathBegin; diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 86c9c080e9..962041bc44 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -29,8 +29,6 @@ using System; using System.Collections.Generic; using System.Text; using System.IO; -using log4net; -using System.Reflection; namespace PrimMesher { @@ -578,9 +576,10 @@ namespace PrimMesher /// internal class Profile { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private const float twoPi = 2.0f * (float)Math.PI; + internal string errorMessage = null; + internal List coords; internal List faces; internal List vertexNormals; @@ -646,8 +645,10 @@ namespace PrimMesher try { angles.makeAngles(sides, startAngle, stopAngle); } catch (Exception ex) { - m_log.Error("makeAngles failed: Exception: " + ex.ToString()); - m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + + errorMessage = "makeAngles failed: Exception: " + ex.ToString() + + "\nsides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString(); + return; } @@ -666,8 +667,9 @@ namespace PrimMesher try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); } catch (Exception ex) { - m_log.Error("makeAngles failed: Exception: " + ex.ToString()); - m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + errorMessage = "makeAngles failed: Exception: " + ex.ToString() + + "\nsides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString(); + return; } } @@ -1127,6 +1129,7 @@ namespace PrimMesher public class PrimMesh { + public string errorMessage = ""; private const float twoPi = 2.0f * (float)Math.PI; public List coords; @@ -1314,6 +1317,8 @@ namespace PrimMesher hollow *= 1.414f; Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, true, calcVertexNormals); + this.errorMessage = profile.errorMessage; + this.numPrimFaces = profile.numPrimFaces; int cut1Vert = -1; @@ -1694,6 +1699,8 @@ namespace PrimMesher needEndFaces = true; Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, needEndFaces, calcVertexNormals); + this.errorMessage = profile.errorMessage; + this.numPrimFaces = profile.numPrimFaces; int cut1Vert = -1;