Automatically select correct chart in MeshOptimizeSTLSurface::GetNormalVector

This commit is contained in:
Matthias Hochsteger 2019-10-08 12:42:06 +02:00
parent ed5ea4408f
commit 893df3a79f
2 changed files with 15 additions and 7 deletions

View File

@ -1108,9 +1108,16 @@ int MeshOptimizeSTLSurface :: CalcPointGeomInfo(PointGeomInfo& gi, const Point<
}
void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const
{
geom.SelectChartOfTriangle (gi.trignum);
n = geom.GetChartNormalVector();
}
void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const
{
n = geom.GetChartNormalVector();
throw Exception("MeshOptimizeSTLSurface :: GetNormalVector called without PointGeomInfo");
}

View File

@ -76,16 +76,17 @@ public:
MeshOptimizeSTLSurface (STLGeometry & ageom);
///
virtual void SelectSurfaceOfPoint (const Point<3> & p,
const PointGeomInfo & gi);
void SelectSurfaceOfPoint (const Point<3> & p,
const PointGeomInfo & gi) override;
///
virtual void ProjectPoint (INDEX surfind, Point<3> & p) const;
void ProjectPoint (INDEX surfind, Point<3> & p) const override;
///
virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const;
void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const override;
///
virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & p3) const;
int CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & p3) const override;
///
virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const;
void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const override;
void GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const override;
};