Skip to content
Snippets Groups Projects
Commit a545e8f8 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

*** empty log message ***

parent 1b6a6cd4
Branches
Tags
No related merge requests found
......@@ -204,11 +204,12 @@ double dist_droites_gauches(BDS_Point *p1, BDS_Point *p2,
}
bool proj_point_triangle ( double xa, double ya, double za,
const BDS_Vector &n,
BDS_Triangle *t,
double &x, double &y, double &z)
{
const double eps_prec = 1.e-10;
BDS_Vector n = t->N();
// BDS_Vector n = t->N();
double mat[3][3];
double b[3];
double res[2];
......@@ -681,7 +682,7 @@ void BDS_Mesh :: createSearchStructures ( )
printf("creating the ANN search structure\n");
const double LC_SEARCH = LC *3.e-3;
const double LC_SEARCH = LC *1.e-3;
for (std::set<BDS_GeomEntity*,GeomLessThan>::iterator it = geom.begin();
it != geom.end();
......@@ -2079,7 +2080,7 @@ bool project_point_on_a_list_of_triangles ( BDS_Point *p ,
{
{
double xp,yp,zp;
bool ok = proj_point_triangle ( p->X,p->Y,p->Z,*it,xp,yp,zp);
bool ok = proj_point_triangle ( p->X,p->Y,p->Z,p->N(),*it,xp,yp,zp);
if (ok)
{
global_ok = true;
......@@ -2208,14 +2209,14 @@ void BDS_Mesh :: compute_metric_edge_lengths (const BDS_Metric & metric)
0.5*(e->p1->Y+e->p2->Y),
0.5*(e->p1->Z+e->p2->Z));
double radius = 1./curvature;
double target = 3.14159 *radius / 3.0;
double target = 3.14159 *radius / metric.nb_elements_per_radius_of_curvature;
e->target_length = metric.update_target_length (target,e->target_length);
// printf("e1 radius %g target %g length %g mlp %g ml %g\n",radius, target,e->length(),e->length()/target,e->metric_length);
}
else
{
double radius = 0.5*(e->p1->radius_of_curvature+e->p2->radius_of_curvature);
double target = 3.14159 * radius / 3.0;
double target = 3.14159 * radius / metric.nb_elements_per_radius_of_curvature;
e->target_length = metric.update_target_length (target,e->target_length);
}
......@@ -2263,7 +2264,7 @@ int BDS_Mesh :: adapt_mesh ( double l, bool smooth, BDS_Mesh *geom_mesh)
SNAP_SUCCESS = 0;
SNAP_FAILURE = 0;
BDS_Metric metric ( l , LC/200 , LC );
BDS_Metric metric ( l , LC/500 , LC, 3 );
// printf("METRIC %g %g %g\n",LC,metric._min,metric._max);
// add initial set of edges in a list
......
......@@ -29,8 +29,9 @@ class BDS_Metric
{
public:
const double target,_min,_max,treshold;
BDS_Metric ( double _target , double _mmin, double _mmax, double _tres = 0.7)
: target(_target),_min(_mmin),_max(_mmax),treshold(_tres)
const double nb_elements_per_radius_of_curvature;
BDS_Metric ( double _target , double _mmin, double _mmax, double cc, double _tres = 0.7)
: target(_target),_min(_mmin),_max(_mmax), treshold(_tres),nb_elements_per_radius_of_curvature(cc)
{}
inline double update_target_length( double _target, double old_target_length ) const
{
......
// $Id: DiscreteSurface.cpp,v 1.22 2005-08-24 14:32:56 remacle Exp $
// $Id: DiscreteSurface.cpp,v 1.23 2005-08-25 14:56:54 remacle Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -50,11 +50,6 @@ void Mesh_To_BDS(Surface *s, BDS_Mesh *m)
Vertex *v1 = simp->V[0];
Vertex *v2 = simp->V[1];
Vertex *v3 = simp->V[2];
double n[3];
normal3points ( v1->Pos.X , v1->Pos.Y , v1->Pos.Z,
v2->Pos.X , v2->Pos.Y , v2->Pos.Z,
v3->Pos.X , v3->Pos.Y , v3->Pos.Z,
n);
m->add_triangle (v1->Num,v2->Num,v3->Num);
}
List_Delete (triangles);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment