2009-01-13 04:40:13 +05:00
|
|
|
#ifndef FILE_MESHSTLSURF
|
|
|
|
#define FILE_MESHSTLSURF
|
|
|
|
|
|
|
|
/* *************************************************************************/
|
|
|
|
/* File: meshstlsurf.hpp */
|
|
|
|
/* Author: Johannes Gerstmayr, Joachim Schoeberl */
|
|
|
|
/* Date: 01. Aug. 99 */
|
|
|
|
/* *************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
The interface between mesh generation and stl geometry
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
class MeshingSTLSurface : public Meshing2
|
|
|
|
{
|
|
|
|
///
|
|
|
|
STLGeometry & geom;
|
|
|
|
///
|
|
|
|
int transformationtrig;
|
|
|
|
public:
|
|
|
|
///
|
2011-07-25 14:40:23 +06:00
|
|
|
MeshingSTLSurface (STLGeometry & ageom, const MeshingParameters & mp);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
void DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
|
|
|
const PointGeomInfo * geominfo1,
|
|
|
|
const PointGeomInfo * geominfo2) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
void TransformToPlain (const Point<3> & locpoint, const MultiPointGeomInfo & geominfo,
|
|
|
|
Point<2> & plainpoint, double h, int & zone) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
int TransformFromPlain (const Point<2>& plainpoint,
|
|
|
|
Point<3> & locpoint,
|
|
|
|
PointGeomInfo & gi,
|
|
|
|
double h) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
int BelongsToActiveChart (const Point3d & p,
|
|
|
|
const PointGeomInfo & gi) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
int ComputePointGeomInfo (const Point3d & p, PointGeomInfo & gi) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
int ChooseChartPointGeomInfo (const MultiPointGeomInfo & mpgi,
|
|
|
|
PointGeomInfo & pgi) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
int IsLineVertexOnChart (const Point3d & p1, const Point3d & p2,
|
|
|
|
int endpoint, const PointGeomInfo & gi) override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2019-09-30 13:19:35 +05:00
|
|
|
void GetChartBoundary (NgArray<Point<2>> & points,
|
|
|
|
NgArray<Point<3>> & poitns3d,
|
2019-09-29 17:54:24 +05:00
|
|
|
NgArray<INDEX_2> & lines, double h) const override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
///
|
2019-10-01 14:59:17 +05:00
|
|
|
double CalcLocalH (const Point<3> & p, double gh) const override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
///
|
2019-09-29 17:54:24 +05:00
|
|
|
double Area () const override;
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
class MeshOptimizeSTLSurface : public MeshOptimize2d
|
|
|
|
{
|
|
|
|
///
|
|
|
|
STLGeometry & geom;
|
|
|
|
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
MeshOptimizeSTLSurface (STLGeometry & ageom);
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual void SelectSurfaceOfPoint (const Point<3> & p,
|
|
|
|
const PointGeomInfo & gi);
|
|
|
|
///
|
|
|
|
virtual void ProjectPoint (INDEX surfind, Point<3> & p) const;
|
|
|
|
///
|
|
|
|
virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point<3> & p) const;
|
|
|
|
///
|
|
|
|
virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & p3) const;
|
|
|
|
///
|
|
|
|
virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RefinementSTLGeometry : public Refinement
|
|
|
|
{
|
|
|
|
const STLGeometry & geom;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RefinementSTLGeometry (const STLGeometry & ageom);
|
|
|
|
virtual ~RefinementSTLGeometry ();
|
|
|
|
|
|
|
|
virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint,
|
|
|
|
int surfi,
|
|
|
|
const PointGeomInfo & gi1,
|
|
|
|
const PointGeomInfo & gi2,
|
2019-06-03 12:04:33 +05:00
|
|
|
Point<3> & newp, PointGeomInfo & newgi) const override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
virtual void PointBetween (const Point<3> & p1, const Point<3> & p2, double secpoint,
|
|
|
|
int surfi1, int surfi2,
|
|
|
|
const EdgePointGeomInfo & ap1,
|
|
|
|
const EdgePointGeomInfo & ap2,
|
2019-06-03 12:04:33 +05:00
|
|
|
Point<3> & newp, EdgePointGeomInfo & newgi) const override;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2019-06-03 12:04:33 +05:00
|
|
|
virtual void ProjectToSurface (Point<3> & p, int surfi) const override;
|
|
|
|
virtual void ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) const override;
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|