1 |
|
1 |
/*****************************************************************
|
2 |
|
|
|
3 |
|
|
eval_dis_face_face.cpp Type:Func
|
4 |
|
|
|
5 |
|
|
Calcul la distance entre 2 faces
|
6 |
|
|
|
7 |
|
|
Date de creation : 2-2-1999 10 :11 :13
|
8 |
|
|
Derniere version : 2-2-1999 10 :11 :13
|
9 |
|
|
|
10 |
|
|
Vincent FRANCOIS
|
11 |
|
|
|
12 |
|
|
*****************************************************************/
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
/**************************/
|
19 |
|
|
/* include */
|
20 |
|
|
#include <stdio.h>
|
21 |
|
|
#include <string.h>
|
22 |
|
|
#include <math.h>
|
23 |
|
|
#include "struct.h"
|
24 |
|
|
#include "const.h"
|
25 |
|
|
#include "prototype.h"
|
26 |
|
|
|
27 |
|
|
/**************************/
|
28 |
|
|
/* variables globales */
|
29 |
|
|
extern struct s_acis *acis;
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
/**************************/
|
34 |
|
|
/* programme principal */
|
35 |
|
|
|
36 |
|
|
float eval_dis_face_face(struct s_face *face1,float u1,float v1,struct s_face *face2,float u2,float v2,int type)
|
37 |
|
|
{
|
38 |
|
|
float res;
|
39 |
|
|
float xx1[4],xx2[4];
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
if (type==FONCTION)
|
43 |
|
|
{
|
44 |
|
|
eval_face(face1,&u1,&v1,FONCTION,&xx1[0],&xx1[1],&xx1[2],0.,0.);
|
45 |
|
|
eval_face(face2,&u2,&v2,FONCTION,&xx2[0],&xx2[1],&xx2[2],0.,0.);
|
46 |
|
|
res=(xx1[0]-xx2[0])*(xx1[0]-xx2[0])+(xx1[1]-xx2[1])*(xx1[1]-xx2[1])+(xx1[2]-xx2[2])*(xx1[2]-xx2[2]);
|
47 |
|
|
}
|
48 |
|
|
return(res);
|
49 |
|
|
}
|