From 4d98a6eb8ca28a413fc32c9e3ab989e8ccf873e9 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 3 Oct 2019 11:26:08 +0200 Subject: [PATCH] STLGeometry::GetNormal only valid with PointGeomInfo --- libsrc/stlgeom/stlgeom.cpp | 7 ++++++- libsrc/stlgeom/stlgeom.hpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libsrc/stlgeom/stlgeom.cpp b/libsrc/stlgeom/stlgeom.cpp index 21dbf076..0036bbb8 100644 --- a/libsrc/stlgeom/stlgeom.cpp +++ b/libsrc/stlgeom/stlgeom.cpp @@ -102,7 +102,12 @@ int STLGeometry :: GenerateMesh (shared_ptr & mesh, MeshingParameters & mp Vec<3> STLGeometry :: GetNormal(INDEX surfind, const Point<3> & p) const { - return GetChartNormalVector(); + throw Exception("STLGeometry::GetNormal without PointGeomInfo called"); +} + +Vec<3> STLGeometry :: GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & gi) const +{ + return GetChart(GetChartNr(gi.trignum)).GetNormal(); } bool STLGeometry :: CalcPointGeomInfo(int /*surfind*/, PointGeomInfo& gi, const Point<3> & p3) const diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 25994ce2..e29e4824 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -196,6 +196,7 @@ namespace netgen void ProjectPoint(INDEX surfind, Point<3> & p) const override; bool ProjectPointGI (int surfind, Point<3> & p, PointGeomInfo & gi) const override; Vec<3> GetNormal(int surfind, const Point<3> & p) const override; + Vec<3> GetNormal(int surfind, const Point<3> & p, const PointGeomInfo & gi) const override; void PointBetween(const Point<3> & p1, const Point<3> & p2, double secpoint, int surfi, const PointGeomInfo & gi1,