ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/acismesh/m2d_param_cone.cpp
Revision: 1
Committed: Mon Jun 11 22:53:07 2007 UTC (17 years, 11 months ago)
File size: 3086 byte(s)
Log Message:

File Contents

# Content
1 /*****************************************************************
2
3 m2d_param_cone.c Type:Func
4
5 Parametrisation d'un cone
6
7 Date de creation : Wed Feb 5 10:24:37 1997
8
9 Derniere version : Mon May 12 18:52:36 1997
10
11
12
13
14
15
16
17
18 Vincent FRANCOIS
19
20 *****************************************************************/
21
22
23
24
25
26 /**************************/
27 /* include */
28 #include <stdio.h>
29 #include <string.h>
30 #include <stdlib.h>
31 #include <math.h>
32 #include "const.h"
33 #include "memoire.h"
34 #include "struct.h"
35 #include "prototype.h"
36
37
38 /**************************/
39 /* variables globales */
40 extern struct s_acis *acis;
41 extern struct s_param *para;
42 extern struct s_mesh *mesh;
43
44
45
46 /**************************/
47 /* programme principal */
48
49 void m2d_param_cone(struct s_face *face,struct s_cone *cone)
50 {
51 float vec[4];
52 struct s_loop *loop;
53 struct s_coedge *coedge;
54 struct s_segment *seg;
55 struct s_noeud *no1;
56 int i;
57 int pass=0;
58
59 if (cone->param==NULL)
60 {
61 NEW_ENTITE(cone->param,par_cone,para->);
62 memcpy(cone->param->centre,cone->center,3*sizeof(float));
63 memcpy(vec,cone->major,3*sizeof(float));
64 NORME(vec);
65 cone->param->a=vec[3];
66 cone->param->b=cone->ratio*vec[3];
67 memcpy(cone->param->u,vec,3*sizeof(float));
68 memcpy(vec,cone->normal,3*sizeof(float));
69 NORME(vec);
70 memcpy(cone->param->w,vec,3*sizeof(float));
71 PVEC(cone->param->v,cone->param->w,cone->param->u);
72 cone->param->tg=cone->sinalph/cone->cosalph;
73 }
74 /* min max des parametres */
75 for (loop=face->first_loop;loop!=NULL;loop=loop->next_loop)
76 {
77 coedge=loop->first_coedge;
78 do
79 {
80 for (i=0;i<coedge->edge->nb_segment;i++)
81 {
82 seg=coedge->edge->segment[i];
83 no1=ADRESSE(seg->n1,noeud,mesh->);
84 eval_cone(face,cone->param,&no1->u,&no1->v,INVERSE,&no1->x,&no1->y,&no1->z,0.);
85 if (pass==0)
86 {
87 pass=1;
88 face->uinf=no1->u;
89 face->usup=no1->u;
90 face->vinf=no1->v;
91 face->vsup=no1->v;
92 }
93 if (face->uinf>no1->u) face->uinf=no1->u;
94 if (face->usup<no1->u) face->usup=no1->u;
95 if (face->vinf>no1->v) face->vinf=no1->v;
96 if (face->vsup<no1->v) face->vsup=no1->v;
97 }
98 coedge=coedge->next_coedge;
99 }
100 while (coedge!=loop->first_coedge);
101 }
102 face->rev_u=2*PI;
103 face->rev_v=0.;
104 }
105