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

*** empty log message ***

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