1 |
francois |
283 |
//--------------------------------------------------------------------------- |
2 |
|
|
//------------------------------------------------------------ |
3 |
|
|
// Le projet MAGIC est un projet de recherche du d�partement |
4 |
|
|
// de g�nie m�canique de l'Universit� du Qu�bec � |
5 |
|
|
// Trois Rivi�res |
6 |
|
|
// Les librairies ne peuvent �tre utilis�es sans l'accord |
7 |
|
|
// des auteurs (contact : francois@uqtr.ca) |
8 |
|
|
//------------------------------------------------------------ |
9 |
|
|
//------------------------------------------------------------ |
10 |
|
|
// |
11 |
|
|
// OCC_Courbe.cpp |
12 |
|
|
// |
13 |
|
|
//------------------------------------------------------------ |
14 |
|
|
//------------------------------------------------------------ |
15 |
|
|
// COPYRIGHT 2000 |
16 |
|
|
// Version du 02/03/2006 � 11H22 |
17 |
|
|
//------------------------------------------------------------ |
18 |
|
|
//------------------------------------------------------------ |
19 |
|
|
|
20 |
|
|
#pragma hdrstop |
21 |
|
|
#include "gestionversion.h" |
22 |
|
|
|
23 |
|
|
#ifdef BREP_OCC |
24 |
|
|
|
25 |
|
|
#include "occ_courbe.h" |
26 |
|
|
#include "Geom_Line.hxx" |
27 |
|
|
#include "gp_Lin.hxx" |
28 |
|
|
#include "Geom_Circle.hxx" |
29 |
|
|
#include "gp_Circ.hxx" |
30 |
|
|
#include "Geom_Ellipse.hxx" |
31 |
|
|
#include "gp_Elips.hxx" |
32 |
|
|
#include "Geom_Hyperbola.hxx" |
33 |
|
|
#include "gp_Hypr.hxx" |
34 |
|
|
#include "Geom_Parabola.hxx" |
35 |
|
|
#include "gp_Parab.hxx" |
36 |
|
|
#include "Geom_BezierCurve.hxx" |
37 |
|
|
#include "Geom_BSplineCurve.hxx" |
38 |
|
|
#include "GCPnts_AbscissaPoint.hxx" |
39 |
|
|
#include "GeomAdaptor_Curve.hxx" |
40 |
|
|
#include "GeomAbs_CurveType.hxx" |
41 |
|
|
#include "GeomAPI.hxx" |
42 |
|
|
#include "Handle_Geom2d_Curve.hxx" |
43 |
|
|
#include "gp_Pln.hxx" |
44 |
|
|
#include "GeomAPI_ProjectPointOnCurve.hxx" |
45 |
|
|
#include "ShapeAnalysis_Curve.hxx" |
46 |
|
|
#include "occ_fonction1.h" |
47 |
|
|
#include "BRep_Tool.hxx" |
48 |
|
|
#include "GeomConvert.hxx" |
49 |
|
|
#include <Geom_TrimmedCurve.hxx> |
50 |
|
|
#include "constantegeo.h" |
51 |
|
|
#include "ot_mathematique.h" |
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
#pragma package(smart_init) |
56 |
|
|
OCC_COURBE::OCC_COURBE(unsigned long num,TopoDS_Edge crb,OCC_FONCTION1& fonc):MG_COURBE(num),edge(crb),fonction1(fonc) |
57 |
|
|
{ |
58 |
|
|
double first, last; |
59 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
60 |
|
|
t_min=courbe->FirstParameter(); |
61 |
|
|
t_max=courbe->LastParameter(); |
62 |
|
|
} |
63 |
|
|
OCC_COURBE::OCC_COURBE(TopoDS_Edge crb, OCC_FONCTION1& fonc):MG_COURBE(),edge(crb), fonction1(fonc) |
64 |
|
|
{ |
65 |
|
|
double first, last; |
66 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
67 |
|
|
t_min=courbe->FirstParameter(); |
68 |
|
|
t_max=courbe->LastParameter(); |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
OCC_COURBE::OCC_COURBE(OCC_COURBE& mdd):MG_COURBE(mdd),edge(mdd.edge), fonction1(mdd.fonction1) |
72 |
|
|
{ |
73 |
|
|
double first, last; |
74 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
75 |
|
|
t_min=mdd.t_min; |
76 |
|
|
t_max=mdd.t_max; |
77 |
|
|
} |
78 |
|
|
OCC_COURBE::~OCC_COURBE() |
79 |
|
|
{ |
80 |
|
|
} |
81 |
|
|
void OCC_COURBE::evaluer(double t, double *xyz) |
82 |
|
|
{ |
83 |
|
|
double first, last; |
84 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
85 |
|
|
gp_Pnt P; |
86 |
|
|
courbe->D0(t,P); |
87 |
|
|
|
88 |
|
|
xyz[0]=P.X(); |
89 |
|
|
xyz[1]=P.Y(); |
90 |
|
|
xyz[2]=P.Z(); |
91 |
|
|
} |
92 |
|
|
void OCC_COURBE::deriver(double t,double *xyz) |
93 |
|
|
{ |
94 |
|
|
double first, last; |
95 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
96 |
|
|
gp_Pnt P; |
97 |
|
|
gp_Vec V; |
98 |
|
|
courbe->D1(t, P, V); |
99 |
|
|
xyz[0]=V.X(); |
100 |
|
|
xyz[1]=V.Y(); |
101 |
|
|
xyz[2]=V.Z(); |
102 |
|
|
} |
103 |
|
|
void OCC_COURBE::deriver_seconde(double t,double *ddxyz,double *dxyz,double *xyz) |
104 |
|
|
{ |
105 |
|
|
double first, last; |
106 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
107 |
|
|
gp_Vec V1; |
108 |
|
|
gp_Vec V2; |
109 |
|
|
gp_Pnt P; |
110 |
|
|
|
111 |
|
|
courbe->D2(t,P,V1,V2); |
112 |
|
|
|
113 |
|
|
dxyz[0]=V1.X(); |
114 |
|
|
dxyz[1]=V1.Y(); |
115 |
|
|
dxyz[2]=V1.Z(); |
116 |
|
|
|
117 |
|
|
ddxyz[0]=V2.X(); |
118 |
|
|
ddxyz[1]=V2.Y(); |
119 |
|
|
ddxyz[2]=V2.Z(); |
120 |
|
|
|
121 |
|
|
xyz[0]=P.X(); |
122 |
|
|
xyz[1]=P.Y(); |
123 |
|
|
xyz[2]=P.Z(); |
124 |
|
|
} |
125 |
|
|
void OCC_COURBE::inverser(double& t,double *xyz,double precision) |
126 |
|
|
{ |
127 |
|
|
|
128 |
|
|
double first, last; |
129 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
130 |
|
|
//ShapeAnalysis_Curve SAC; |
131 |
|
|
double tmin=courbe->FirstParameter(); |
132 |
|
|
double tmax=courbe->LastParameter(); |
133 |
|
|
double xyz1[3],xyz2[3]; |
134 |
|
|
evaluer(tmin,xyz1); |
135 |
|
|
evaluer(tmax,xyz2); |
136 |
|
|
double max=fabs(xyz1[0]); |
137 |
|
|
if (max<fabs(xyz1[1])) max=fabs(xyz1[1]); |
138 |
|
|
if (max<fabs(xyz1[2])) max=fabs(xyz1[2]); |
139 |
|
|
if (max<fabs(xyz2[0])) max=fabs(xyz2[0]); |
140 |
|
|
if (max<fabs(xyz2[1])) max=fabs(xyz2[1]); |
141 |
|
|
if (max<fabs(xyz2[2])) max=fabs(xyz2[2]); |
142 |
|
|
double eps=precision*max; |
143 |
|
|
OT_VECTEUR_3D vec1(xyz,xyz1); |
144 |
|
|
OT_VECTEUR_3D vec2(xyz,xyz2); |
145 |
|
|
if (vec1.get_longueur()<eps) { |
146 |
|
|
t=tmin; |
147 |
|
|
return; |
148 |
|
|
} |
149 |
|
|
if (vec2.get_longueur()<eps) { |
150 |
|
|
t=tmax; |
151 |
|
|
return; |
152 |
|
|
} |
153 |
|
|
double u=xyz[0]; |
154 |
|
|
double v=xyz[1]; |
155 |
|
|
double w=xyz[2]; |
156 |
|
|
gp_Pnt P(u,v,w); |
157 |
|
|
//gp_Pnt proj; |
158 |
|
|
//Standard_Real param; |
159 |
|
|
|
160 |
|
|
//t=SAC.Project(courbe, P, precision, proj, param, Standard_True);*/ |
161 |
|
|
|
162 |
|
|
GeomAPI_ProjectPointOnCurve PPC(P,courbe); |
163 |
|
|
//PPC.Perform(P); |
164 |
|
|
try |
165 |
|
|
{ |
166 |
|
|
t=PPC.LowerDistanceParameter(); |
167 |
|
|
} |
168 |
|
|
catch (...) |
169 |
|
|
{ |
170 |
|
|
t=-1e308; |
171 |
|
|
} |
172 |
|
|
|
173 |
|
|
} |
174 |
|
|
int OCC_COURBE::est_periodique(void) |
175 |
|
|
{ |
176 |
|
|
double first, last; |
177 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
178 |
|
|
return courbe->IsPeriodic(); |
179 |
|
|
} |
180 |
|
|
double OCC_COURBE::get_periode(void) |
181 |
|
|
{ |
182 |
|
|
double first, last; |
183 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
184 |
|
|
if (courbe->IsPeriodic()==0) return 0.; |
185 |
|
|
return courbe->Period(); |
186 |
|
|
} |
187 |
|
|
double OCC_COURBE::get_longueur(double t1,double t2,double precis) |
188 |
|
|
{ |
189 |
|
|
double first, last; |
190 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
191 |
|
|
double longueur; |
192 |
|
|
GeomAdaptor_Curve cc(courbe); |
193 |
|
|
longueur= GCPnts_AbscissaPoint::Length(cc,t1,t2,precis); |
194 |
|
|
|
195 |
|
|
return longueur; |
196 |
|
|
} |
197 |
|
|
void OCC_COURBE::enregistrer(std::ostream& o) |
198 |
|
|
{ |
199 |
|
|
o <<"%"<<get_id()<<"=COURBE_OCC("<<fonction1.GetID(edge)<< ");" << std::endl; |
200 |
|
|
} |
201 |
|
|
|
202 |
|
|
int OCC_COURBE::get_type_geometrique(TPL_LISTE_ENTITE<double> ¶m) |
203 |
|
|
{ |
204 |
|
|
|
205 |
|
|
double first, last; |
206 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
207 |
|
|
Handle(Standard_Type) type=courbe->DynamicType(); |
208 |
|
|
//***droite |
209 |
|
|
if (type==STANDARD_TYPE(Geom_Line)) |
210 |
|
|
{ |
211 |
|
|
Handle(Geom_Line) droite=Handle(Geom_Line)::DownCast(courbe); |
212 |
|
|
gp_Lin lin=droite->Lin(); |
213 |
|
|
|
214 |
|
|
double origine[3]; |
215 |
|
|
gp_Pnt centre=lin.Location(); |
216 |
|
|
origine[0]=centre.X(); |
217 |
|
|
origine[1]=centre.Y(); |
218 |
|
|
origine[2]=centre.Z(); |
219 |
|
|
double direction[3]; |
220 |
|
|
gp_Dir dir=lin.Direction(); |
221 |
|
|
direction[0]=dir.X(); |
222 |
|
|
direction[1]=dir.Y(); |
223 |
|
|
direction[2]=dir.Z(); |
224 |
|
|
|
225 |
|
|
param.ajouter(origine[0]); |
226 |
|
|
param.ajouter(origine[1]); |
227 |
|
|
param.ajouter(origine[2]); |
228 |
|
|
param.ajouter(direction[0]); |
229 |
|
|
param.ajouter(direction[1]); |
230 |
|
|
param.ajouter(direction[2]); |
231 |
|
|
|
232 |
|
|
return MGCo_LINE; |
233 |
|
|
|
234 |
|
|
} |
235 |
|
|
//***circle |
236 |
|
|
if (type==STANDARD_TYPE(Geom_Circle)) |
237 |
|
|
{ |
238 |
|
|
Handle(Geom_Circle) circle=Handle_Geom_Circle::DownCast(courbe); |
239 |
|
|
gp_Circ Circ=circle->Circ(); |
240 |
|
|
|
241 |
|
|
double origine[3]; |
242 |
|
|
gp_Pnt centre=Circ.Location(); |
243 |
|
|
origine[0]=centre.X(); |
244 |
|
|
origine[1]=centre.Y(); |
245 |
|
|
origine[2]=centre.Z(); |
246 |
|
|
|
247 |
|
|
double direction[3]; |
248 |
|
|
gp_Ax1 axe=Circ.Axis(); |
249 |
|
|
gp_Dir dir=axe.Direction(); |
250 |
|
|
direction[0]=dir.X(); |
251 |
|
|
direction[1]=dir.Y(); |
252 |
|
|
direction[2]=dir.Z(); |
253 |
|
|
double rayon; |
254 |
|
|
rayon=Circ.Radius(); |
255 |
|
|
|
256 |
|
|
param.ajouter(origine[0]); |
257 |
|
|
param.ajouter(origine[1]); |
258 |
|
|
param.ajouter(origine[2]); |
259 |
|
|
param.ajouter(direction[0]); |
260 |
|
|
param.ajouter(direction[1]); |
261 |
|
|
param.ajouter(direction[2]); |
262 |
|
|
param.ajouter(rayon); |
263 |
|
|
|
264 |
|
|
return MGCo_CIRCLE; |
265 |
|
|
|
266 |
|
|
} |
267 |
|
|
//*****ellipse |
268 |
|
|
if (type==STANDARD_TYPE(Geom_Ellipse)) |
269 |
|
|
{ |
270 |
|
|
Handle(Geom_Ellipse) ellipse=Handle_Geom_Ellipse::DownCast(courbe); |
271 |
|
|
gp_Elips Elips=ellipse->Elips(); |
272 |
|
|
|
273 |
|
|
double origine[3]; |
274 |
|
|
gp_Pnt centre=Elips.Location(); |
275 |
|
|
origine[0]=centre.X(); |
276 |
|
|
origine[1]=centre.Y(); |
277 |
|
|
origine[2]=centre.Z(); |
278 |
|
|
|
279 |
|
|
double Grayon; |
280 |
|
|
Grayon=Elips.MajorRadius(); |
281 |
|
|
double Xdirectrise[3]; |
282 |
|
|
gp_Ax1 Xaxe=Elips.Directrix1(); |
283 |
|
|
gp_Dir dir=Xaxe.Direction(); |
284 |
|
|
Xdirectrise[0]=dir.X(); |
285 |
|
|
Xdirectrise[1]=dir.Y(); |
286 |
|
|
Xdirectrise[2]=dir.Z(); |
287 |
|
|
double Prayon; |
288 |
|
|
Prayon=Elips.MinorRadius(); |
289 |
|
|
double Ydirectrise[3]; |
290 |
|
|
gp_Ax1 Yaxe=Elips.Directrix2(); |
291 |
|
|
gp_Dir dir1=Yaxe.Direction(); |
292 |
|
|
Ydirectrise[0]=dir1.X(); |
293 |
|
|
Ydirectrise[1]=dir1.Y(); |
294 |
|
|
Ydirectrise[2]=dir1.Z(); |
295 |
|
|
|
296 |
|
|
param.ajouter(origine[0]); |
297 |
|
|
param.ajouter(origine[1]); |
298 |
|
|
param.ajouter(origine[2]); |
299 |
|
|
param.ajouter(Grayon); |
300 |
|
|
param.ajouter(Xdirectrise[0]); |
301 |
|
|
param.ajouter(Xdirectrise[1]); |
302 |
|
|
param.ajouter(Xdirectrise[2]); |
303 |
|
|
param.ajouter(Prayon); |
304 |
|
|
param.ajouter(Ydirectrise[0]); |
305 |
|
|
param.ajouter(Ydirectrise[1]); |
306 |
|
|
param.ajouter(Ydirectrise[2]); |
307 |
|
|
|
308 |
|
|
|
309 |
|
|
return MGCo_ELLIPSE; |
310 |
|
|
} |
311 |
|
|
/* //*****hyperbole |
312 |
|
|
if(type==STANDARD_TYPE(Geom_Hyperbola)) |
313 |
|
|
{ |
314 |
|
|
Handle(Geom_Hyperbola) hyperbole=Handle_Geom_Hyperbola::DownCast(courbe); |
315 |
|
|
gp_Hypr Hyper=hyperbole->Hypr(); |
316 |
|
|
double origine[3]; |
317 |
|
|
gp_Pnt centre=Hyper.Location(); |
318 |
|
|
origine[0]=centre.X(); |
319 |
|
|
origine[1]=centre.Y(); |
320 |
|
|
origine[2]=centre.Z(); |
321 |
|
|
|
322 |
|
|
double Grayon; |
323 |
|
|
Grayon=Hyper.MajorRadius(); |
324 |
|
|
double Xdirectrise[3]; |
325 |
|
|
gp_Ax1 Xaxe=Hyper.Directrix1(); |
326 |
|
|
gp_Dir Xdir=Xaxe.Direction(); |
327 |
|
|
Xdirectrise[0]=Xdir.X(); |
328 |
|
|
Xdirectrise[1]=Xdir.Y(); |
329 |
|
|
Xdirectrise[2]=Xdir.Z(); |
330 |
|
|
double Prayon; |
331 |
|
|
Prayon=Hyper.MinorRadius(); |
332 |
|
|
double Ydirectrise[3]; |
333 |
|
|
gp_Ax1 Yaxe=Hyper.Directrix1(); |
334 |
|
|
gp_Dir Ydir=Yaxe.Direction(); |
335 |
|
|
Ydirectrise[0]=Ydir.X(); |
336 |
|
|
Ydirectrise[1]=Ydir.Y(); |
337 |
|
|
Ydirectrise[2]=Ydir.Z(); |
338 |
|
|
|
339 |
|
|
|
340 |
|
|
param.ajouter(origine[0]); |
341 |
|
|
param.ajouter(origine[1]); |
342 |
|
|
param.ajouter(origine[2]); |
343 |
|
|
param.ajouter(Grayon); |
344 |
|
|
param.ajouter(Xdirectrise[0]); |
345 |
|
|
param.ajouter(Xdirectrise[1]); |
346 |
|
|
param.ajouter(Xdirectrise[2]); |
347 |
|
|
param.ajouter(Prayon); |
348 |
|
|
param.ajouter(Ydirectrise[0]); |
349 |
|
|
param.ajouter(Ydirectrise[1]); |
350 |
|
|
param.ajouter(Ydirectrise[2]); |
351 |
|
|
|
352 |
|
|
|
353 |
|
|
return hyperbole->IsKind(STANDARD_TYPE(Geom_Hyperbola)); |
354 |
|
|
} |
355 |
|
|
//*****parabole |
356 |
|
|
if(type==STANDARD_TYPE(Geom_Parabola)) |
357 |
|
|
{ |
358 |
|
|
Handle(Geom_Parabola) parabole=Handle_Geom_Parabola::DownCast(courbe); |
359 |
|
|
gp_Parab Parab=parabole->Parab(); |
360 |
|
|
|
361 |
|
|
double origine[3]; |
362 |
|
|
gp_Pnt centre=Parab.Location(); |
363 |
|
|
origine[0]=centre.X(); |
364 |
|
|
origine[1]=centre.Y(); |
365 |
|
|
origine[2]=centre.Z(); |
366 |
|
|
|
367 |
|
|
double focale; |
368 |
|
|
focale=Parab.Focal(); |
369 |
|
|
double directrice[3]; |
370 |
|
|
gp_Ax1 dire=Parab.Directrix(); |
371 |
|
|
gp_Dir dir=dire.Direction(); |
372 |
|
|
directrice[0]=dir.X(); |
373 |
|
|
directrice[1]=dir.Y(); |
374 |
|
|
directrice[2]=dir.Z(); |
375 |
|
|
|
376 |
|
|
param.ajouter(origine[0]); |
377 |
|
|
param.ajouter(origine[1]); |
378 |
|
|
param.ajouter(origine[2]); |
379 |
|
|
param.ajouter(focale); |
380 |
|
|
param.ajouter(directrice[0]); |
381 |
|
|
param.ajouter(directrice[1]); |
382 |
|
|
param.ajouter(directrice[2]); |
383 |
|
|
|
384 |
|
|
return parabole->IsKind(STANDARD_TYPE(Geom_Parabola)); |
385 |
|
|
} */ |
386 |
|
|
//*****Bspline |
387 |
|
|
if (type==STANDARD_TYPE(Geom_BSplineCurve)) |
388 |
|
|
{ |
389 |
|
|
Handle(Geom_BSplineCurve) bspline=Handle_Geom_BSplineCurve::DownCast(courbe); |
390 |
|
|
|
391 |
|
|
//nombre des noeuds |
392 |
|
|
int nb_knot=bspline->NbKnots(); |
393 |
|
|
//valeur de noeud |
394 |
|
|
for (int i=1; i<=nb_knot; i++) |
395 |
|
|
{ |
396 |
|
|
double valeur=bspline->Knot(i); |
397 |
|
|
param.ajouter(valeur); |
398 |
|
|
} |
399 |
|
|
//point de controle et poids |
400 |
|
|
gp_Pnt pctr; |
401 |
|
|
double poids; |
402 |
|
|
for (int u=1; u<=bspline->NbPoles(); u++) |
403 |
|
|
{ |
404 |
|
|
pctr=bspline->Pole(u); |
405 |
|
|
param.ajouter(pctr.X()); |
406 |
|
|
param.ajouter(pctr.Y()); |
407 |
|
|
param.ajouter(pctr.Z()); |
408 |
|
|
poids=bspline->Weight(u); |
409 |
|
|
param.ajouter(poids); |
410 |
|
|
} |
411 |
|
|
|
412 |
|
|
double Degree=bspline->Degree(); |
413 |
|
|
param.ajouter(Degree); |
414 |
|
|
|
415 |
|
|
|
416 |
|
|
return MGCo_BSPLINE; |
417 |
|
|
} |
418 |
|
|
|
419 |
|
|
} |
420 |
|
|
|
421 |
|
|
void OCC_COURBE::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> ¶m) |
422 |
|
|
{ |
423 |
|
|
//Conversion of the complete geometry of a shape into |
424 |
|
|
//NURBS geometry |
425 |
|
|
double first, last; |
426 |
|
|
Handle(Geom_Curve) courbe=BRep_Tool::Curve(edge, first, last); |
427 |
|
|
Handle(Geom_TrimmedCurve) curv=new Geom_TrimmedCurve(courbe, first, last); |
428 |
|
|
Handle(Geom_BSplineCurve) bspline=GeomConvert::CurveToBSplineCurve(curv) ; |
429 |
|
|
|
430 |
|
|
// The first parameter indicate the code access |
431 |
|
|
param.ajouter(1); |
432 |
|
|
//The follewing two parameters of the list indicate the orders of the net points |
433 |
|
|
param.ajouter(bspline->Degree()+1); |
434 |
|
|
param.ajouter(0); |
435 |
|
|
|
436 |
|
|
//The follewing two parameters indicate the number of rows and colons of the control points |
437 |
|
|
//respectively to the two parameters directions |
438 |
|
|
param.ajouter(bspline->NbPoles()); |
439 |
|
|
param.ajouter(0); |
440 |
|
|
|
441 |
|
|
//this present the knot vector |
442 |
|
|
|
443 |
|
|
for (unsigned int i=1;i<=bspline->NbKnots();i++) |
444 |
|
|
{ |
445 |
|
|
param.ajouter(bspline->Knot(i)); |
446 |
|
|
} |
447 |
|
|
|
448 |
|
|
// in the following we construct the control point vector |
449 |
|
|
for (unsigned int j=1;j<=bspline->NbPoles();j++) |
450 |
|
|
{ |
451 |
|
|
double w=bspline->Weight(j); |
452 |
|
|
gp_Pnt point=bspline->Pole(j); |
453 |
|
|
double x=point.X(); |
454 |
|
|
double y=point.Y(); |
455 |
|
|
double z=point.Z(); |
456 |
|
|
param.ajouter(x); |
457 |
|
|
param.ajouter(y); |
458 |
|
|
param.ajouter(z); |
459 |
|
|
param.ajouter(w); |
460 |
|
|
} |
461 |
|
|
indx_premier_ptctr=5+bspline->NbKnots(); |
462 |
|
|
|
463 |
|
|
|
464 |
|
|
} |
465 |
|
|
#endif |