Skip to content
Snippets Groups Projects
Commit de64fdb9 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 160f70d3
Branches
Tags
No related merge requests found
...@@ -265,15 +265,17 @@ end: ...@@ -265,15 +265,17 @@ end:
//check coherence for plane surfaces //check coherence for plane surfaces
if(geomType() == GEntity::Plane) { if(geomType() == GEntity::Plane) {
SBoundingBox3d bb = bounds();
double lc = norm(SVector3(bb.max(), bb.min()));
std::list<GVertex*> verts = vertices(); std::list<GVertex*> verts = vertices();
std::list<GVertex*>::const_iterator itv = verts.begin(); std::list<GVertex*>::const_iterator itv = verts.begin();
for(; itv != verts.end(); itv++){ for(; itv != verts.end(); itv++){
const GVertex *v = *itv; const GVertex *v = *itv;
double d = meanPlane.a * v->x() + meanPlane.b * v->y() + double d = meanPlane.a * v->x() + meanPlane.b * v->y() +
meanPlane.c * v->z() - meanPlane.d; meanPlane.c * v->z() - meanPlane.d;
if(fabs(d) > 1.e-3) { if(fabs(d) > lc * 1.e-3) {
Msg(GERROR1, "Plane surface %d (%gx+%gy+%gz+%g=0) is not plane!", Msg(GERROR1, "Plane surface %d (%gx+%gy+%gz+%g=0) is not plane!",
v->tag(), meanPlane.a, meanPlane.b, meanPlane.c, meanPlane.d); tag(), meanPlane.a, meanPlane.b, meanPlane.c, meanPlane.d);
Msg(GERROR3, "Control point %d = (%g,%g,%g), val=%g", Msg(GERROR3, "Control point %d = (%g,%g,%g), val=%g",
v->tag(), v->x(), v->y(), v->z(), d); v->tag(), v->x(), v->y(), v->z(), d);
return; return;
......
...@@ -34,29 +34,13 @@ Range<double> gmshEdge::parBounds(int i) const ...@@ -34,29 +34,13 @@ Range<double> gmshEdge::parBounds(int i) const
SBoundingBox3d gmshEdge::bounds() const SBoundingBox3d gmshEdge::bounds() const
{ {
double xmin = 0., ymin = 0., zmin = 0.; SBoundingBox3d bbox;
double xmax = 0., ymax = 0., zmax = 0.; const int N = 10;
for (int i = 0; i < 20; i++){ for (int i = 0; i < N; i++){
double u = c->ubeg + (i/19.) * (c->uend - c->ubeg); double u = c->ubeg + (double)i/(double)(N - 1) * (c->uend - c->ubeg);
Vertex a = InterpolateCurve(c, u, 0); Vertex a = InterpolateCurve(c, u, 0);
if (!i){ bbox += SPoint3(a.Pos.X, a.Pos.Y, a.Pos.Z);
xmin = xmax = a.Pos.X; }
ymin = ymax = a.Pos.Y;
zmin = zmax = a.Pos.Z;
}
else{
if(a.Pos.X < xmin) xmin = a.Pos.X;
if(a.Pos.Y < ymin) ymin = a.Pos.Z;
if(a.Pos.Z < zmin) zmin = a.Pos.Y;
if(a.Pos.X > xmax) xmax = a.Pos.X;
if(a.Pos.Y > ymax) ymax = a.Pos.Z;
if(a.Pos.Z > zmax) zmax = a.Pos.Y;
}
}
SPoint3 bmin(xmin, ymin, zmin);
SPoint3 bmax(xmax, ymax, zmax);
SBoundingBox3d bbox(bmin);
bbox += bmax;
return bbox; return bbox;
} }
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include "Numeric.h" #include "Numeric.h"
#include "BDS.h" #include "BDS.h"
extern Context_T CTX;
int Orientation (std::vector<MVertex*> &cu) int Orientation (std::vector<MVertex*> &cu)
{ {
int N, i, a, b, c; int N, i, a, b, c;
...@@ -65,8 +67,6 @@ int Orientation (std::vector<MVertex*> &cu) ...@@ -65,8 +67,6 @@ int Orientation (std::vector<MVertex*> &cu)
extern Context_T CTX;
class fromCartesianToParametric class fromCartesianToParametric
{ {
GFace *gf; GFace *gf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment