Select Git revision
surfaceFiller.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Paul-Emile Bernard authored
New algo for packingOfParallelograms: the new points insertion depends on the local cross field smoothness
Paul-Emile Bernard authoredNew algo for packingOfParallelograms: the new points insertion depends on the local cross field smoothness
surfaceFiller.cpp 39.86 KiB
// Gmsh - Copyright (C) 1997-2014 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@geuz.org>.
//
// Contributor(s):
// Tristan Carrier Baudoin
#include "GmshConfig.h"
#include "surfaceFiller.h"
#include "Field.h"
#include "GModel.h"
#include "OS.h"
#include <queue>
#include <stack>
/// Here, we aim at producing a set of points that
/// enables to generate a nice quad mesh
#if defined(HAVE_RTREE)
#include "rtree.h"
#endif
#include "MVertex.h"
#include "MElement.h"
//#include "directions3D.h"
#include "BackgroundMesh.h"
#include "intersectCurveSurface.h"
using namespace std;
static const double FACTOR = .71;
static const int NUMDIR = 3;
static const double DIRS [NUMDIR] = {0.0, M_PI/20.,-M_PI/20.};
//PE MODIF
//static const int NUMDIR = 1;
//static const double DIRS [NUMDIR] = {0.0};
// END PE MODIF
/// a rectangle in the tangent plane is transformed
/// into a parallelogram. We define an exclusion zone
/// that is centered around a vertex and that is used
/// in a r-tree structure for generating points with the
/// right spacing in the tangent plane
#if defined(HAVE_RTREE)
struct surfacePointWithExclusionRegion {
MVertex *_v;
SPoint2 _center;
SPoint2 _p[4][NUMDIR];
SPoint2 _q[4];
SMetric3 _meshMetric;
double _distanceSummed;
/*
+ p3
p4 |
+----c-----+ p2
|
+ p1
*/
surfacePointWithExclusionRegion (MVertex *v, SPoint2 p[4][NUMDIR], SPoint2 &_mp, SMetric3 & meshMetric, surfacePointWithExclusionRegion *father = 0){
_v = v;
_meshMetric = meshMetric;
_center = _mp;