b311480e |
1 | -- Created on: 1991-08-09 |
2 | -- Created by: Jean Claude VAUTHIER |
3 | -- Copyright (c) 1991-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | --Modified : RLE Aug 1993 Major modifications. |
22 | -- 15-Mar-95 xab : added cache mecanism to speed up |
23 | -- evaluation |
24 | -- 25-Mar-95 xab : added Lagrange evaluator |
25 | -- mei : modified 08-Jun-95 : added method MovePoint |
26 | -- xab : modified 11-Mar-96 : added method MovePointAndTangent |
27 | -- xab : modified 18-Mar-97 : added method to reparameterise a bspline |
28 | -- jct : modified 15-Apr-97 : added method to extend a bspline |
29 | |
30 | package BSplCLib |
31 | |
32 | ---Purpose: BSplCLib B-spline curve Library. |
33 | -- |
34 | -- The BSplCLib package is a basic library for BSplines. It |
35 | -- provides three categories of functions. |
36 | -- |
37 | -- * Management methods to process knots and multiplicities. |
38 | -- |
39 | -- * Multi-Dimensions spline methods. BSpline methods where |
40 | -- poles have an arbitrary number of dimensions. They divides |
41 | -- in two groups : |
42 | -- |
43 | -- - Global methods modifying the whole set of poles. The |
44 | -- poles are described by an array of Reals and a |
45 | -- Dimension. Example : Inserting knots. |
46 | -- |
47 | -- - Local methods computing points and derivatives. The |
48 | -- poles are described by a pointer on a local array of |
49 | -- Reals and a Dimension. The local array is modified. |
50 | -- |
51 | -- * 2D and 3D spline curves methods. |
52 | -- |
53 | -- Methods for 2d and 3d BSplines curves rational or not |
54 | -- rational. |
55 | -- |
56 | -- Those methods have the following structure : |
57 | -- |
58 | -- - They extract the pole informations in a working array. |
59 | -- |
60 | -- - They process the working array with the |
61 | -- multi-dimension methods. (for example a 3d rational |
62 | -- curve is processed as a 4 dimension curve). |
63 | -- |
64 | -- - They get back the result in the original dimension. |
65 | -- |
66 | -- Note that the bspline surface methods found in the |
67 | -- package BSplSLib uses the same structure and rely on |
68 | -- BSplCLib. |
69 | -- |
70 | -- In the following list of methods the 2d and 3d curve |
71 | -- methods will be described with the corresponding |
72 | -- multi-dimension method. |
73 | -- |
74 | -- The 3d or 2d B-spline curve is defined with : |
75 | -- |
76 | -- . its control points : TColgp_Array1OfPnt(2d) Poles |
77 | -- . its weights : TColStd_Array1OfReal Weights |
78 | -- . its knots : TColStd_Array1OfReal Knots |
79 | -- . its multiplicities : TColStd_Array1OfInteger Mults |
80 | -- . its degree : Standard_Integer Degree |
81 | -- . its periodicity : Standard_Boolean Periodic |
82 | -- |
83 | -- Warnings : |
84 | -- The bounds of Poles and Weights should be the same. |
85 | -- The bounds of Knots and Mults should be the same. |
86 | -- |
87 | -- Weights can be a null reference (BSplCLib::NoWeights()) |
88 | -- the curve is non rational. |
89 | -- |
90 | -- Mults can be a null reference (BSplCLib::NoMults()) |
91 | -- the knots are "flat" knots. |
92 | -- |
93 | -- KeyWords : |
94 | -- B-spline curve, Functions, Library |
95 | -- |
96 | -- References : |
97 | -- . A survey of curves and surfaces methods in CADG Wolfgang |
98 | -- BOHM CAGD 1 (1984) |
99 | -- . On de Boor-like algorithms and blossoming Wolfgang BOEHM |
100 | -- cagd 5 (1988) |
101 | -- . Blossoming and knot insertion algorithms for B-spline curves |
102 | -- Ronald N. GOLDMAN |
103 | -- . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA |
104 | -- . Curves and Surfaces for Computer Aided Geometric Design, |
105 | -- a practical guide Gerald Farin |
106 | |
107 | uses TColStd, gp, TColgp, math |
108 | |
109 | |
110 | is |
111 | |
112 | imported EvaluatorFunction ; |
113 | ---Purpose: this is a one dimensional function |
114 | -- typedef void (*EvaluatorFunction) ( |
115 | -- Standard_Integer // Derivative Request |
116 | -- Standard_Real * // StartEnd[2] |
117 | -- Standard_Real // Parameter |
118 | -- Standard_Real & // Result |
119 | -- Standard_Integer &) ;// Error Code |
120 | -- serves to multiply a given vectorial BSpline by a function |
121 | |
122 | enumeration KnotDistribution is NonUniform, Uniform; |
123 | ---Purpose: This enumeration describes the repartition of the |
124 | -- knots sequence. If all the knots differ by the |
125 | -- same positive constant from the preceding knot the |
126 | -- "KnotDistribution" is <Uniform> else it is |
127 | -- <NonUniform> |
128 | |
129 | enumeration MultDistribution is NonConstant, Constant, QuasiConstant; |
130 | ---Purpose: This enumeration describes the form of the |
131 | -- sequence of mutiplicities. MultDistribution is : |
132 | -- |
133 | -- Constant if all the multiplicities have the same |
134 | -- value. |
135 | -- |
136 | -- QuasiConstant if all the internal knots have the |
137 | -- same multiplicity and if the first and last knot |
138 | -- have a different multiplicity. |
139 | -- |
140 | -- NonConstant in other cases. |
141 | |
142 | ------------------------------------------------------------- |
143 | ------------------------------------------------------------- |
144 | ---------- ---------- |
145 | ---------- Knots and Multiplicities ---------- |
146 | ---------- ---------- |
147 | ------------------------------------------------------------- |
148 | ------------------------------------------------------------- |
149 | |
150 | Hunt (XX : in Array1OfReal from TColStd; |
151 | X : in Real; |
152 | Iloc : in out Integer); |
153 | ---Purpose: This routine searches the position of the real |
154 | -- value X in the ordered set of real values XX. |
155 | -- |
156 | -- The elements in the table XX are either |
157 | -- monotonically increasing or monotonically |
158 | -- decreasing. |
159 | -- |
160 | -- The input value Iloc is used to initialize the |
161 | -- algorithm : if Iloc is outside of the bounds |
162 | -- [XX.Lower(), -- XX.Upper()] the bisection algorithm |
163 | -- is used else the routine searches from a previous |
164 | -- known position by increasing steps then converges |
165 | -- by bisection. |
166 | -- |
167 | -- This routine is used to locate a knot value in a |
168 | -- set of knots. |
169 | -- |
170 | ---References : Numerical Recipes in C (William H.Press, Brian |
171 | -- P. Flannery, Saul A. Teukolsky, William T. |
172 | -- Vetterling) |
173 | |
174 | FirstUKnotIndex (Degree : Integer; |
175 | Mults : Array1OfInteger from TColStd) |
176 | returns Integer; |
177 | ---Purpose: Computes the index of the knots value which gives |
178 | -- the start point of the curve. |
179 | |
180 | |
181 | LastUKnotIndex (Degree : Integer; |
182 | Mults : Array1OfInteger from TColStd) |
183 | returns Integer; |
184 | ---Purpose: Computes the index of the knots value which gives |
185 | -- the end point of the curve. |
186 | |
187 | FlatIndex (Degree : Integer; |
188 | Index : Integer; |
189 | Mults : Array1OfInteger from TColStd; |
190 | Periodic : Boolean) |
191 | returns Integer; |
192 | ---Purpose: Computes the index of the flats knots sequence |
193 | -- corresponding to <Index> in the knots sequence |
194 | -- which multiplicities are <Mults>. |
195 | |
196 | LocateParameter (Degree : Integer; |
197 | Knots : Array1OfReal from TColStd; |
198 | Mults : Array1OfInteger from TColStd; |
199 | U : Real; |
200 | IsPeriodic : Boolean; |
201 | FromK1 : Integer; |
202 | ToK2 : Integer; |
203 | KnotIndex : in out Integer; |
204 | NewU : in out Real); |
205 | ---Purpose: Locates the parametric value U in the knots |
206 | -- sequence between the knot K1 and the knot K2. |
207 | -- The value return in Index verifies. |
208 | -- |
209 | -- Knots(Index) <= U < Knots(Index + 1) |
210 | -- if U <= Knots (K1) then Index = K1 |
211 | -- if U >= Knots (K2) then Index = K2 - 1 |
212 | -- |
213 | -- If Periodic is True U may be modified to fit in |
214 | -- the range Knots(K1), Knots(K2). In any case the |
215 | -- correct value is returned in NewU. |
216 | -- |
217 | -- Warnings :Index is used as input data to initialize the |
218 | -- searching function. |
219 | -- Warning: Knots have to be "withe repetitions" |
220 | |
221 | LocateParameter (Degree : Integer; |
222 | Knots : Array1OfReal from TColStd; |
223 | U : Real; |
224 | IsPeriodic : Boolean; |
225 | FromK1 : Integer; |
226 | ToK2 : Integer; |
227 | KnotIndex : in out Integer; |
228 | NewU : in out Real); |
229 | ---Purpose: Locates the parametric value U in the knots |
230 | -- sequence between the knot K1 and the knot K2. |
231 | -- The value return in Index verifies. |
232 | -- |
233 | -- Knots(Index) <= U < Knots(Index + 1) |
234 | -- if U <= Knots (K1) then Index = K1 |
235 | -- if U >= Knots (K2) then Index = K2 - 1 |
236 | -- |
237 | -- If Periodic is True U may be modified to fit in |
238 | -- the range Knots(K1), Knots(K2). In any case the |
239 | -- correct value is returned in NewU. |
240 | -- |
241 | -- Warnings :Index is used as input data to initialize the |
242 | -- searching function. |
243 | -- Warning: Knots have to be "flat" |
244 | |
245 | LocateParameter (Knots : Array1OfReal from TColStd; |
246 | U : Real; |
247 | Periodic : Boolean; |
248 | K1,K2 : Integer; |
249 | Index : in out Integer; |
250 | NewU : in out Real; |
251 | Uf,Ue : Real) |
252 | is private; |
253 | ---Level: Internal |
254 | |
255 | LocateParameter (Degree : Integer; |
256 | Knots : Array1OfReal from TColStd; |
257 | Mults : Array1OfInteger from TColStd; |
258 | U : Real; |
259 | Periodic : Boolean; |
260 | Index : in out Integer; |
261 | NewU : in out Real); |
262 | ---Level: Internal |
263 | |
264 | MaxKnotMult (Mults : Array1OfInteger from TColStd; |
265 | K1, K2 : Integer) |
266 | returns Integer; |
267 | ---Purpose: Finds the greatest multiplicity in a set of knots |
268 | -- between K1 and K2. Mults is the multiplicity |
269 | -- associated with each knot value. |
270 | |
271 | MinKnotMult (Mults : Array1OfInteger from TColStd; |
272 | K1, K2 : Integer) |
273 | returns Integer; |
274 | ---Purpose: Finds the lowest multiplicity in a set of knots |
275 | -- between K1 and K2. Mults is the multiplicity |
276 | -- associated with each knot value. |
277 | |
278 | NbPoles(Degree : Integer; |
279 | Periodic : Boolean; |
280 | Mults : Array1OfInteger from TColStd) |
281 | returns Integer; |
282 | ---Purpose: Returns the number of poles of the curve. Returns 0 if |
283 | -- one of the multiplicities is incorrect. |
284 | -- |
285 | -- * Non positive. |
286 | -- |
287 | -- * Greater than Degree, or Degree+1 at the first and |
288 | -- last knot of a non periodic curve. |
289 | -- |
290 | -- * The last periodicity on a periodic curve is not |
291 | -- equal to the first. |
292 | |
293 | KnotSequenceLength(Mults : Array1OfInteger from TColStd; |
294 | Degree : Integer; |
295 | Periodic : Boolean) |
296 | returns Integer; |
297 | ---Purpose: Returns the length of the sequence of knots with |
298 | -- repetition. |
299 | -- |
300 | -- Periodic : |
301 | -- |
302 | -- Sum(Mults(i), i = Mults.Lower(); i <= Mults.Upper()); |
303 | -- |
304 | -- Non Periodic : |
305 | -- |
306 | -- Sum(Mults(i); i = Mults.Lower(); i < Mults.Upper()) |
307 | -- + 2 * Degree |
308 | |
309 | KnotSequence (Knots : Array1OfReal from TColStd; |
310 | Mults : Array1OfInteger from TColStd; |
311 | KnotSeq : in out Array1OfReal from TColStd); |
312 | |
313 | KnotSequence (Knots : Array1OfReal from TColStd; |
314 | Mults : Array1OfInteger from TColStd; |
315 | Degree : Integer; |
316 | Periodic : Boolean; |
317 | KnotSeq : in out Array1OfReal from TColStd); |
318 | ---Purpose: Computes the sequence of knots KnotSeq with |
319 | -- repetition of the knots of multiplicity greater |
320 | -- than 1. |
321 | -- |
322 | -- Length of KnotSeq must be KnotSequenceLength(Mults,Degree,Periodic) |
323 | |
324 | KnotsLength( KnotSeq : Array1OfReal from TColStd; |
325 | Periodic : Boolean = Standard_False) |
326 | returns Integer; |
327 | ---Purpose: Returns the length of the sequence of knots (and |
328 | -- Mults) without repetition. |
329 | |
330 | Knots( KnotSeq : Array1OfReal from TColStd; |
331 | Knots : out Array1OfReal from TColStd; |
332 | Mults : out Array1OfInteger from TColStd; |
333 | Periodic : Boolean = Standard_False); |
334 | ---Purpose: Computes the sequence of knots Knots without |
335 | -- repetition of the knots of multiplicity greater |
336 | -- than 1. |
337 | -- |
338 | -- Length of <Knots> and <Mults> must be |
339 | -- KnotsLength(KnotSequence,Periodic) |
340 | |
341 | KnotForm (Knots : Array1OfReal from TColStd; |
342 | FromK1, ToK2 : Integer) |
343 | returns KnotDistribution; |
344 | ---Purpose: Analyses if the knots distribution is "Uniform" |
345 | -- or "NonUniform" between the knot FromK1 and the |
346 | -- knot ToK2. There is no repetition of knot in the |
347 | -- knots'sequence <Knots>. |
348 | |
349 | MultForm (Mults : Array1OfInteger from TColStd; |
350 | FromK1, ToK2 : Integer) |
351 | returns MultDistribution; |
352 | ---Purpose: |
353 | -- Analyses the distribution of multiplicities between |
354 | -- the knot FromK1 and the Knot ToK2. |
355 | |
356 | Reparametrize (U1, U2 : Real; |
357 | Knots : in out Array1OfReal from TColStd); |
358 | ---Purpose: |
359 | -- Reparametrizes a B-spline curve to [U1, U2]. |
360 | -- The knot values are recomputed such that Knots (Lower) = U1 |
361 | -- and Knots (Upper) = U2 but the knot form is not modified. |
362 | -- Warnings : |
363 | -- In the array Knots the values must be in ascending order. |
364 | -- U1 must not be equal to U2 to avoid division by zero. |
365 | |
366 | |
367 | Reverse (Knots : in out Array1OfReal from TColStd); |
368 | ---Purpose: Reverses the array knots to become the knots |
369 | -- sequence of the reversed curve. |
370 | |
371 | Reverse (Mults : in out Array1OfInteger from TColStd); |
372 | ---Purpose: Reverses the array of multiplicities. |
373 | |
374 | Reverse (Poles : in out Array1OfPnt from TColgp; |
375 | Last : Integer); |
376 | ---Purpose: Reverses the array of poles. Last is the index of |
377 | -- the new first pole. On a non periodic curve last |
378 | -- is Poles.Upper(). On a periodic curve last is |
379 | -- |
380 | -- (number of flat knots - degree - 1) |
381 | -- |
382 | -- or |
383 | -- |
384 | -- (sum of multiplicities(but for the last) + degree |
385 | -- - 1) |
386 | |
387 | Reverse (Poles : in out Array1OfPnt2d from TColgp; |
388 | Last : Integer); |
389 | ---Purpose: Reverses the array of poles. |
390 | |
391 | Reverse (Weights : in out Array1OfReal from TColStd; |
392 | Last : Integer); |
393 | ---Purpose: Reverses the array of poles. |
394 | |
395 | IsRational(Weights : Array1OfReal from TColStd; |
396 | I1,I2 : Integer; |
397 | Epsilon : Real = 0.0) returns Boolean; |
398 | ---Purpose: |
399 | -- Returns False if all the weights of the array <Weights> |
400 | -- between I1 an I2 are identic. Epsilon is used for |
401 | -- comparing weights. If Epsilon is 0. the Epsilon of the |
402 | -- first weight is used. |
403 | |
404 | MaxDegree returns Integer; |
405 | ---Purpose: returns the degree maxima for a BSplineCurve. |
406 | ---C++: inline |
407 | |
408 | Eval(U : Real; |
409 | Degree : Integer; |
410 | Knots : in out Real; |
411 | Dimension : Integer; |
412 | Poles : in out Real); |
413 | ---Purpose: Perform the Boor algorithm to evaluate a point at |
414 | -- parameter <U>, with <Degree> and <Dimension>. |
415 | -- |
416 | -- Poles is an array of Reals of size |
417 | -- |
418 | -- <Dimension> * <Degree>+1 |
419 | -- |
420 | -- Containing the poles. At the end <Poles> contains |
421 | -- the current point. |
422 | |
423 | BoorScheme(U : Real; |
424 | Degree : Integer; |
425 | Knots : in out Real; |
426 | Dimension : Integer; |
427 | Poles : in out Real; |
428 | Depth : Integer; |
429 | Length : Integer); |
430 | ---Purpose: Performs the Boor Algorithm at parameter <U> with |
431 | -- the given <Degree> and the array of <Knots> on the |
432 | -- poles <Poles> of dimension <Dimension>. The schema |
433 | -- is computed until level <Depth> on a basis of |
434 | -- <Length+1> poles. |
435 | -- |
436 | -- * Knots is an array of reals of length : |
437 | -- |
438 | -- <Length> + <Degree> |
439 | -- |
440 | -- * Poles is an array of reals of length : |
441 | -- |
442 | -- (2 * <Length> + 1) * <Dimension> |
443 | -- |
444 | -- The poles values must be set in the array at the |
445 | -- positions. |
446 | -- |
447 | -- 0..Dimension, |
448 | -- |
449 | -- 2 * Dimension .. |
450 | -- 3 * Dimension |
451 | -- |
452 | -- 4 * Dimension .. |
453 | -- 5 * Dimension |
454 | -- |
455 | -- ... |
456 | -- |
457 | -- The results are found in the array poles depending |
458 | -- on the Depth. (See the method GetPole). |
459 | |
460 | AntiBoorScheme(U : Real; |
461 | Degree : Integer; |
462 | Knots : in out Real; |
463 | Dimension : Integer; |
464 | Poles : in out Real; |
465 | Depth : Integer; |
466 | Length : Integer; |
467 | Tolerance : Real) returns Boolean; |
468 | ---Purpose: Compute the content of Pole before the BoorScheme. |
469 | -- This method is used to remove poles. |
470 | -- |
471 | -- U is the poles to remove, Knots should contains the |
472 | -- knots of the curve after knot removal. |
473 | -- |
474 | -- The first and last poles do not change, the other |
475 | -- poles are computed by averaging two possible values. |
476 | -- The distance between the two possible poles is |
477 | -- computed, if it is higher than <Tolerance> False is |
478 | -- returned. |
479 | |
480 | Derivative(Degree : Integer; |
481 | Knots : in out Real; |
482 | Dimension : Integer; |
483 | Length : Integer; |
484 | Order : Integer; |
485 | Poles : in out Real); |
486 | ---Purpose: Computes the poles of the BSpline giving the |
487 | -- derivatives of order <Order>. |
488 | -- |
489 | -- The formula for the first order is |
490 | -- |
491 | -- Pole(i) = Degree * (Pole(i+1) - Pole(i)) / |
492 | -- (Knots(i+Degree+1) - Knots(i+1)) |
493 | -- |
494 | -- This formula is repeated (Degree is decremented at |
495 | -- each step). |
496 | |
497 | Bohm(U : Real; |
498 | Degree : Integer; |
499 | N : Integer; |
500 | Knots : in out Real; |
501 | Dimension : Integer; |
502 | Poles : in out Real); |
503 | ---Purpose: Performs the Bohm Algorithm at parameter <U>. This |
504 | -- algorithm computes the value and all the derivatives |
505 | -- up to order N (N <= Degree). |
506 | -- |
507 | -- <Poles> is the original array of poles. |
508 | -- |
509 | -- The result in <Poles> is the value and the |
510 | -- derivatives. Poles[0] is the value, Poles[Degree] |
511 | -- is the last derivative. |
512 | |
513 | |
514 | NoWeights returns Array1OfReal from TColStd; |
515 | ---Purpose: Used as argument for a non rational curve. |
516 | -- |
517 | ---C++: return & |
518 | ---C++: inline |
519 | |
520 | NoMults returns Array1OfInteger from TColStd; |
521 | ---Purpose: Used as argument for a flatknots evaluation. |
522 | -- |
523 | ---C++: return & |
524 | ---C++: inline |
525 | |
526 | BuildKnots(Degree, Index : Integer; |
527 | Periodic : Boolean; |
528 | Knots : Array1OfReal from TColStd; |
529 | Mults : Array1OfInteger from TColStd; |
530 | LK : in out Real); |
531 | ---Purpose: Stores in LK the usefull knots for the BoorSchem |
532 | -- on the span Knots(Index) - Knots(Index+1) |
533 | |
534 | PoleIndex (Degree, Index : Integer; |
535 | Periodic : Boolean; |
536 | Mults : Array1OfInteger from TColStd) |
537 | returns Integer; |
538 | ---Purpose: Return the index of the first Pole to use on the |
539 | -- span Mults(Index) - Mults(Index+1). This index |
540 | -- must be added to Poles.Lower(). |
541 | |
542 | BuildEval(Degree,Index : Integer; |
543 | Poles : Array1OfReal from TColStd; |
544 | Weights : Array1OfReal from TColStd; |
545 | LP : in out Real); |
546 | |
547 | BuildEval(Degree,Index : Integer; |
548 | Poles : Array1OfPnt from TColgp; |
549 | Weights : Array1OfReal from TColStd; |
550 | LP : in out Real); |
551 | |
552 | BuildEval(Degree,Index : Integer; |
553 | Poles : Array1OfPnt2d from TColgp; |
554 | Weights : Array1OfReal from TColStd; |
555 | LP : in out Real); |
556 | ---Purpose: Copy in <LP> the poles and weights for the Eval |
557 | -- scheme. starting from Poles(Poles.Lower()+Index) |
558 | |
559 | BuildBoor(Index,Length,Dimension : Integer; |
560 | Poles : Array1OfReal from TColStd; |
561 | LP : in out Real); |
562 | ---Purpose: Copy in <LP> poles for <Dimension> Boor scheme. |
563 | -- Starting from <Index> * <Dimension>, copy |
564 | -- <Length+1> poles. |
565 | |
566 | |
567 | BoorIndex(Index, Length, Depth : Integer) |
568 | returns Integer; |
569 | ---Purpose: Returns the index in the Boor result array of the |
570 | -- poles <Index>. If the Boor algorithm was perform |
571 | -- with <Length> and <Depth>. |
572 | |
573 | GetPole(Index,Length,Depth,Dimension : Integer; |
574 | LocPoles : in out Real; |
575 | Position : in out Integer; |
576 | Pole : in out Array1OfReal from TColStd); |
577 | ---Purpose: Copy the pole at position <Index> in the Boor |
578 | -- scheme of dimension <Dimension> to <Position> in |
579 | -- the array <Pole>. <Position> is updated. |
580 | |
581 | PrepareInsertKnots ( |
582 | Degree : in Integer; |
583 | Periodic : in Boolean; |
584 | Knots : in Array1OfReal from TColStd; |
585 | Mults : in Array1OfInteger from TColStd; |
586 | AddKnots : in Array1OfReal from TColStd; |
587 | AddMults : in Array1OfInteger from TColStd; |
588 | NbPoles : out Integer; |
589 | NbKnots : out Integer; |
590 | Epsilon : in Real; |
591 | Add : in Boolean = Standard_True) |
592 | returns Boolean; |
593 | ---Purpose: Returns in <NbPoles, NbKnots> the new number of poles |
594 | -- and knots if the sequence of knots <AddKnots, |
595 | -- AddMults> is inserted in the sequence <Knots, Mults>. |
596 | -- |
597 | -- Epsilon is used to compare knots for equality. |
598 | -- |
599 | -- If Add is True the multiplicities on equal knots are |
600 | -- added. |
601 | -- |
602 | -- If Add is False the max value of the multiplicities is |
603 | -- kept. |
604 | -- |
605 | -- Return False if : |
606 | -- The knew knots are knot increasing. |
607 | -- The new knots are not in the range. |
608 | |
609 | InsertKnots ( |
610 | Degree : in Integer; |
611 | Periodic : in Boolean; |
612 | Dimension : in Integer; |
613 | Poles : in Array1OfReal from TColStd; |
614 | Knots : in Array1OfReal from TColStd; |
615 | Mults : in Array1OfInteger from TColStd; |
616 | AddKnots : in Array1OfReal from TColStd; |
617 | AddMults : in Array1OfInteger from TColStd; |
618 | NewPoles : out Array1OfReal from TColStd; |
619 | NewKnots : out Array1OfReal from TColStd; |
620 | NewMults : out Array1OfInteger from TColStd; |
621 | Epsilon : in Real; |
622 | Add : in Boolean = Standard_True); |
623 | |
624 | InsertKnots ( |
625 | Degree : in Integer; |
626 | Periodic : in Boolean; |
627 | Poles : in Array1OfPnt from TColgp; |
628 | Weights : in Array1OfReal from TColStd; |
629 | Knots : in Array1OfReal from TColStd; |
630 | Mults : in Array1OfInteger from TColStd; |
631 | AddKnots : in Array1OfReal from TColStd; |
632 | AddMults : in Array1OfInteger from TColStd; |
633 | NewPoles : out Array1OfPnt from TColgp; |
634 | NewWeights : out Array1OfReal from TColStd; |
635 | NewKnots : out Array1OfReal from TColStd; |
636 | NewMults : out Array1OfInteger from TColStd; |
637 | Epsilon : in Real; |
638 | Add : in Boolean = Standard_True); |
639 | |
640 | InsertKnots ( |
641 | Degree : in Integer; |
642 | Periodic : in Boolean; |
643 | Poles : in Array1OfPnt2d from TColgp; |
644 | Weights : in Array1OfReal from TColStd; |
645 | Knots : in Array1OfReal from TColStd; |
646 | Mults : in Array1OfInteger from TColStd; |
647 | AddKnots : in Array1OfReal from TColStd; |
648 | AddMults : in Array1OfInteger from TColStd; |
649 | NewPoles : out Array1OfPnt2d from TColgp; |
650 | NewWeights : out Array1OfReal from TColStd; |
651 | NewKnots : out Array1OfReal from TColStd; |
652 | NewMults : out Array1OfInteger from TColStd; |
653 | Epsilon : in Real; |
654 | Add : in Boolean = Standard_True); |
655 | ---Purpose: Insert a sequence of knots <AddKnots> with |
656 | -- multiplicities <AddMults>. <AddKnots> must be a non |
657 | -- decreasing sequence and verifies : |
658 | -- |
659 | -- Knots(Knots.Lower()) <= AddKnots(AddKnots.Lower()) |
660 | -- Knots(Knots.Upper()) >= AddKnots(AddKnots.Upper()) |
661 | -- |
662 | -- The NewPoles and NewWeights arrays must have a length : |
663 | -- Poles.Length() + Sum(AddMults()) |
664 | -- |
665 | -- When a knot to insert is identic to an existing knot the |
666 | -- multiplicities are added. |
667 | -- |
668 | -- Epsilon is used to test knots for equality. |
669 | -- |
670 | -- When AddMult is negative or null the knot is not inserted. |
671 | -- No multiplicity will becomes higher than the degree. |
672 | -- |
673 | -- The new Knots and Multiplicities are copied in <NewKnots> |
674 | -- and <NewMults>. |
675 | -- |
676 | -- All the New arrays should be correctly dimensioned. |
677 | -- |
678 | -- When all the new knots are existing knots, i.e. only the |
679 | -- multiplicities will change it is safe to use the same |
680 | -- arrays as input and output. |
681 | |
682 | InsertKnot ( |
683 | UIndex : in Integer; |
684 | U : in Real; |
685 | UMult : in Integer; |
686 | Degree : in Integer; |
687 | Periodic : in Boolean; |
688 | Poles : in Array1OfPnt from TColgp; |
689 | Weights : in Array1OfReal from TColStd; |
690 | Knots : in Array1OfReal from TColStd; |
691 | Mults : in Array1OfInteger from TColStd; |
692 | NewPoles : out Array1OfPnt from TColgp; |
693 | NewWeights : out Array1OfReal from TColStd); |
694 | |
695 | InsertKnot ( |
696 | UIndex : in Integer; |
697 | U : in Real; |
698 | UMult : in Integer; |
699 | Degree : in Integer; |
700 | Periodic : in Boolean; |
701 | Poles : in Array1OfPnt2d from TColgp; |
702 | Weights : in Array1OfReal from TColStd; |
703 | Knots : in Array1OfReal from TColStd; |
704 | Mults : in Array1OfInteger from TColStd; |
705 | NewPoles : out Array1OfPnt2d from TColgp; |
706 | NewWeights : out Array1OfReal from TColStd); |
707 | ---Purpose: Insert a new knot U of multiplicity UMult in the |
708 | -- knot sequence. |
709 | -- |
710 | -- The location of the new Knot should be given as an input |
711 | -- data. UIndex locates the new knot U in the knot sequence |
712 | -- and Knots (UIndex) < U < Knots (UIndex + 1). |
713 | -- |
714 | -- The new control points corresponding to this insertion are |
715 | -- returned. Knots and Mults are not updated. |
716 | |
717 | RaiseMultiplicity ( |
718 | KnotIndex : in Integer; |
719 | Mult : in Integer; |
720 | Degree : in Integer; |
721 | Periodic : in Boolean; |
722 | Poles : in Array1OfPnt from TColgp; |
723 | Weights : in Array1OfReal from TColStd; |
724 | Knots : in Array1OfReal from TColStd; |
725 | Mults : in Array1OfInteger from TColStd; |
726 | NewPoles : out Array1OfPnt from TColgp; |
727 | NewWeights : out Array1OfReal from TColStd); |
728 | |
729 | RaiseMultiplicity ( |
730 | KnotIndex : in Integer; |
731 | Mult : in Integer; |
732 | Degree : in Integer; |
733 | Periodic : in Boolean; |
734 | Poles : in Array1OfPnt2d from TColgp; |
735 | Weights : in Array1OfReal from TColStd; |
736 | Knots : in Array1OfReal from TColStd; |
737 | Mults : in Array1OfInteger from TColStd; |
738 | NewPoles : out Array1OfPnt2d from TColgp; |
739 | NewWeights : out Array1OfReal from TColStd); |
740 | ---Purpose: Raise the multiplicity of knot to <UMult>. |
741 | -- |
742 | -- The new control points are returned. Knots and Mults are |
743 | -- not updated. |
744 | |
745 | RemoveKnot ( |
746 | Index : in Integer; |
747 | Mult : in Integer; |
748 | Degree : in Integer; |
749 | Periodic : in Boolean; |
750 | Dimension : in Integer; |
751 | Poles : in Array1OfReal from TColStd; |
752 | Knots : in Array1OfReal from TColStd; |
753 | Mults : in Array1OfInteger from TColStd; |
754 | NewPoles : out Array1OfReal from TColStd; |
755 | NewKnots : out Array1OfReal from TColStd; |
756 | NewMults : out Array1OfInteger from TColStd; |
757 | Tolerance : Real) returns Boolean; |
758 | |
759 | RemoveKnot ( |
760 | Index : in Integer; |
761 | Mult : in Integer; |
762 | Degree : in Integer; |
763 | Periodic : in Boolean; |
764 | Poles : in Array1OfPnt from TColgp; |
765 | Weights : in Array1OfReal from TColStd; |
766 | Knots : in Array1OfReal from TColStd; |
767 | Mults : in Array1OfInteger from TColStd; |
768 | NewPoles : out Array1OfPnt from TColgp; |
769 | NewWeights : out Array1OfReal from TColStd; |
770 | NewKnots : out Array1OfReal from TColStd; |
771 | NewMults : out Array1OfInteger from TColStd; |
772 | Tolerance : Real) returns Boolean; |
773 | |
774 | RemoveKnot ( |
775 | Index : in Integer; |
776 | Mult : in Integer; |
777 | Degree : in Integer; |
778 | Periodic : in Boolean; |
779 | Poles : in Array1OfPnt2d from TColgp; |
780 | Weights : in Array1OfReal from TColStd; |
781 | Knots : in Array1OfReal from TColStd; |
782 | Mults : in Array1OfInteger from TColStd; |
783 | NewPoles : out Array1OfPnt2d from TColgp; |
784 | NewWeights : out Array1OfReal from TColStd; |
785 | NewKnots : out Array1OfReal from TColStd; |
786 | NewMults : out Array1OfInteger from TColStd; |
787 | Tolerance : Real) returns Boolean; |
788 | ---Purpose: Decrement the multiplicity of <Knots(Index)> |
789 | -- to <Mult>. If <Mult> is null the knot is |
790 | -- removed. |
791 | -- |
792 | -- As there are two ways to compute the new poles |
793 | -- the midlle will be used as long as the |
794 | -- distance is lower than Tolerance. |
795 | -- |
796 | -- If a distance is bigger than tolerance the |
797 | -- methods returns False and the new arrays are |
798 | -- not modified. |
799 | -- |
800 | -- A low tolerance can be used to test if the |
801 | -- knot can be removed without modifying the |
802 | -- curve. |
803 | -- |
804 | -- A high tolerance can be used to "smooth" the |
805 | -- curve. |
806 | |
807 | |
808 | IncreaseDegreeCountKnots (Degree, NewDegree : Integer; |
809 | Periodic : Boolean; |
810 | Mults : Array1OfInteger from TColStd) |
811 | returns Integer; |
812 | ---Purpose: Returns the number of knots of a curve with |
813 | -- multiplicities <Mults> after elevating the degree from |
814 | -- <Degree> to <NewDegree>. See the IncreaseDegree method |
815 | -- for more comments. |
816 | |
817 | IncreaseDegree (Degree, |
818 | NewDegree : in Integer; |
819 | Periodic : in Boolean; |
820 | Dimension : in Integer; |
821 | Poles : in Array1OfReal from TColStd; |
822 | Knots : in Array1OfReal from TColStd; |
823 | Mults : in Array1OfInteger from TColStd; |
824 | NewPoles : in out Array1OfReal from TColStd; |
825 | NewKnots : in out Array1OfReal from TColStd; |
826 | NewMults : in out Array1OfInteger from TColStd); |
827 | |
828 | IncreaseDegree (Degree, |
829 | NewDegree : in Integer; |
830 | Periodic : in Boolean; |
831 | Poles : in Array1OfPnt from TColgp; |
832 | Weights : in Array1OfReal from TColStd; |
833 | Knots : in Array1OfReal from TColStd; |
834 | Mults : in Array1OfInteger from TColStd; |
835 | NewPoles : in out Array1OfPnt from TColgp; |
836 | NewWeights : in out Array1OfReal from TColStd; |
837 | NewKnots : in out Array1OfReal from TColStd; |
838 | NewMults : in out Array1OfInteger from TColStd); |
839 | |
840 | IncreaseDegree (Degree, |
841 | NewDegree : in Integer; |
842 | Periodic : in Boolean; |
843 | Poles : in Array1OfPnt2d from TColgp; |
844 | Weights : in Array1OfReal from TColStd; |
845 | Knots : in Array1OfReal from TColStd; |
846 | Mults : in Array1OfInteger from TColStd; |
847 | NewPoles : in out Array1OfPnt2d from TColgp; |
848 | NewWeights : in out Array1OfReal from TColStd; |
849 | NewKnots : in out Array1OfReal from TColStd; |
850 | NewMults : in out Array1OfInteger from TColStd); |
851 | |
852 | |
853 | IncreaseDegree (NewDegree : in Integer; |
854 | Poles : in Array1OfPnt from TColgp; |
855 | Weights : in Array1OfReal from TColStd; |
856 | NewPoles : in out Array1OfPnt from TColgp; |
857 | NewWeights : in out Array1OfReal from TColStd); |
858 | ---Warning: To be used for Beziercurves ONLY!!! |
859 | |
860 | IncreaseDegree (NewDegree : in Integer; |
861 | Poles : in Array1OfPnt2d from TColgp; |
862 | Weights : in Array1OfReal from TColStd; |
863 | NewPoles : in out Array1OfPnt2d from TColgp; |
864 | NewWeights : in out Array1OfReal from TColStd); |
865 | ---Purpose: Increase the degree of a bspline (or bezier) curve |
866 | -- of dimension <Dimension> form <Degree> to |
867 | -- <NewDegree>. |
868 | -- |
869 | -- The number of poles in the new curve is : |
870 | -- |
871 | -- Poles.Length() + (NewDegree - Degree) * Number of spans |
872 | -- |
873 | -- Where the number of spans is : |
874 | -- |
875 | -- LastUKnotIndex(Mults) - FirstUKnotIndex(Mults) + 1 |
876 | -- |
877 | -- for a non-periodic curve |
878 | -- |
879 | -- And Knots.Length() - 1 for a periodic curve. |
880 | -- |
881 | -- The multiplicities of all knots are increased by |
882 | -- the degree elevation. |
883 | -- |
884 | -- The new knots are usually the same knots with the |
885 | -- exception of a non-periodic curve with the first |
886 | -- and last multiplicity not equal to Degree+1 where |
887 | -- knots are removed form the start and the bottom |
888 | -- untils the sum of the multiplicities is equal to |
889 | -- NewDegree+1 at the knots corresponding to the |
890 | -- first and last parameters of the curve. |
891 | -- |
892 | -- Example : Suppose a curve of degree 3 starting |
893 | -- with following knots and multiplicities : |
894 | -- |
895 | -- knot : 0. 1. 2. |
896 | -- mult : 1 2 1 |
897 | -- |
898 | -- The FirstUKnot is 2. because the sum of |
899 | -- multiplicities is Degree+1 : 1 + 2 + 1 = 4 = 3 + 1 |
900 | -- |
901 | -- i.e. the first parameter of the curve is 2. and |
902 | -- will still be 2. after degree elevation. Let |
903 | -- raises this curve to degree 4. The multiplicities |
904 | -- are increased by 2. |
905 | -- |
906 | -- They become 2 3 2. But we need a sum of |
907 | -- multiplicities of 5 at knot 2. So the first knot |
908 | -- is removed and the new knots are : |
909 | -- |
910 | -- knot : 1. 2. |
911 | -- mult : 3 2 |
912 | -- |
913 | -- The multipicity of the first knot may also be |
914 | -- reduced if the sum is still to big. |
915 | -- |
916 | -- In the most common situations (periodic curve or |
917 | -- curve with first and last multiplicities equals to |
918 | -- Degree+1) the knots are knot changes. |
919 | -- |
920 | -- The method IncreaseDegreeCountKnots can be used to |
921 | -- compute the new number of knots.\ |
922 | -- |
923 | ---Warning: To be used for Beziercurves ONLY!!! |
924 | |
925 | PrepareUnperiodize (Degree : in Integer from Standard; |
926 | Mults : in Array1OfInteger from TColStd; |
927 | NbKnots : out Integer from Standard; |
928 | NbPoles : out Integer from Standard); |
929 | ---Purpose: Set in <NbKnots> and <NbPolesToAdd> the number of Knots and |
930 | -- Poles of the NotPeriodic Curve identical at the |
931 | -- periodic curve with a degree <Degree> , a |
932 | -- knots-distribution with Multiplicities <Mults>. |
933 | |
934 | Unperiodize (Degree : in Integer from Standard; |
935 | Dimension : in Integer from Standard; |
936 | Mults : in Array1OfInteger from TColStd; |
937 | Knots : in Array1OfReal from TColStd; |
938 | Poles : in Array1OfReal from TColStd; |
939 | NewMults : out Array1OfInteger from TColStd; |
940 | NewKnots : out Array1OfReal from TColStd; |
941 | NewPoles : out Array1OfReal from TColStd); |
942 | |
943 | Unperiodize (Degree : in Integer from Standard; |
944 | Mults : in Array1OfInteger from TColStd; |
945 | Knots : in Array1OfReal from TColStd; |
946 | Poles : in Array1OfPnt from TColgp; |
947 | Weights : in Array1OfReal from TColStd; |
948 | NewMults : out Array1OfInteger from TColStd; |
949 | NewKnots : out Array1OfReal from TColStd; |
950 | NewPoles : out Array1OfPnt from TColgp; |
951 | NewWeights: out Array1OfReal from TColStd); |
952 | |
953 | Unperiodize (Degree : in Integer from Standard; |
954 | Mults : in Array1OfInteger from TColStd; |
955 | Knots : in Array1OfReal from TColStd; |
956 | Poles : in Array1OfPnt2d from TColgp; |
957 | Weights : in Array1OfReal from TColStd; |
958 | NewMults : out Array1OfInteger from TColStd; |
959 | NewKnots : out Array1OfReal from TColStd; |
960 | NewPoles : out Array1OfPnt2d from TColgp; |
961 | NewWeights: out Array1OfReal from TColStd); |
962 | |
963 | |
964 | PrepareTrimming (Degree : in Integer from Standard; |
965 | Periodic: in Boolean from Standard; |
966 | Knots : in Array1OfReal from TColStd; |
967 | Mults : in Array1OfInteger from TColStd; |
968 | U1 : in Real from Standard; |
969 | U2 : in Real from Standard; |
970 | NbKnots : out Integer from Standard; |
971 | NbPoles : out Integer from Standard); |
972 | ---Purpose: Set in <NbKnots> and <NbPoles> the number of Knots and |
973 | -- Poles of the curve resulting of the trimming of the |
974 | -- BSplinecurve definded with <degree>, <knots>, <mults> |
975 | |
976 | Trimming (Degree : in Integer from Standard; |
977 | Periodic : in Boolean from Standard; |
978 | Dimension : in Integer from Standard; |
979 | Knots : in Array1OfReal from TColStd; |
980 | Mults : in Array1OfInteger from TColStd; |
981 | Poles : in Array1OfReal from TColStd; |
982 | U1 : in Real from Standard; |
983 | U2 : in Real from Standard; |
984 | NewKnots : out Array1OfReal from TColStd; |
985 | NewMults : out Array1OfInteger from TColStd; |
986 | NewPoles : out Array1OfReal from TColStd); |
987 | |
988 | |
989 | Trimming (Degree : in Integer from Standard; |
990 | Periodic : in Boolean from Standard; |
991 | Knots : in Array1OfReal from TColStd; |
992 | Mults : in Array1OfInteger from TColStd; |
993 | Poles : in Array1OfPnt from TColgp; |
994 | Weights : in Array1OfReal from TColStd; |
995 | U1 : in Real from Standard; |
996 | U2 : in Real from Standard; |
997 | NewKnots : out Array1OfReal from TColStd; |
998 | NewMults : out Array1OfInteger from TColStd; |
999 | NewPoles : out Array1OfPnt from TColgp; |
1000 | NewWeights : out Array1OfReal from TColStd); |
1001 | |
1002 | |
1003 | Trimming (Degree : in Integer from Standard; |
1004 | Periodic : in Boolean from Standard; |
1005 | Knots : in Array1OfReal from TColStd; |
1006 | Mults : in Array1OfInteger from TColStd; |
1007 | Poles : in Array1OfPnt2d from TColgp; |
1008 | Weights : in Array1OfReal from TColStd; |
1009 | U1 : in Real from Standard; |
1010 | U2 : in Real from Standard; |
1011 | NewKnots : out Array1OfReal from TColStd; |
1012 | NewMults : out Array1OfInteger from TColStd; |
1013 | NewPoles : out Array1OfPnt2d from TColgp; |
1014 | NewWeights : out Array1OfReal from TColStd); |
1015 | |
1016 | |
1017 | |
1018 | |
1019 | |
1020 | ------------------------------------------------------------- |
1021 | ------------------------------------------------------------- |
1022 | ---------- ---------- |
1023 | ---------- Curve Evaluations ---------- |
1024 | ---------- ---------- |
1025 | ------------------------------------------------------------- |
1026 | ------------------------------------------------------------- |
1027 | |
1028 | D0(U : in Real; |
1029 | Index : in Integer; |
1030 | Degree : in Integer; |
1031 | Periodic : in Boolean; |
1032 | Poles : in Array1OfReal from TColStd; |
1033 | Weights : in Array1OfReal from TColStd; |
1034 | Knots : in Array1OfReal from TColStd; |
1035 | Mults : in Array1OfInteger from TColStd; |
1036 | P : out Real); |
1037 | |
1038 | D0(U : in Real; |
1039 | Index : in Integer; |
1040 | Degree : in Integer; |
1041 | Periodic : in Boolean; |
1042 | Poles : in Array1OfPnt from TColgp; |
1043 | Weights : in Array1OfReal from TColStd; |
1044 | Knots : in Array1OfReal from TColStd; |
1045 | Mults : in Array1OfInteger from TColStd; |
1046 | P : out Pnt from gp); |
1047 | |
1048 | D0(U : in Real; |
1049 | UIndex : in Integer; |
1050 | Degree : in Integer; |
1051 | Periodic : in Boolean; |
1052 | Poles : in Array1OfPnt2d from TColgp; |
1053 | Weights : in Array1OfReal from TColStd; |
1054 | Knots : in Array1OfReal from TColStd; |
1055 | Mults : in Array1OfInteger from TColStd; |
1056 | P : out Pnt2d from gp); |
1057 | |
1058 | D0(U : in Real; |
1059 | Poles : in Array1OfPnt from TColgp; |
1060 | Weights : in Array1OfReal from TColStd; |
1061 | P : out Pnt from gp); |
1062 | ---Warning: To be used for Beziercurves ONLY!!! |
1063 | |
1064 | D0(U : in Real; |
1065 | Poles : in Array1OfPnt2d from TColgp; |
1066 | Weights : in Array1OfReal from TColStd; |
1067 | P : out Pnt2d from gp); |
1068 | ---Warning: To be used for Beziercurves ONLY!!! |
1069 | |
1070 | D1(U : in Real; |
1071 | Index : in Integer; |
1072 | Degree : in Integer; |
1073 | Periodic : in Boolean; |
1074 | Poles : in Array1OfReal from TColStd; |
1075 | Weights : in Array1OfReal from TColStd; |
1076 | Knots : in Array1OfReal from TColStd; |
1077 | Mults : in Array1OfInteger from TColStd; |
1078 | P : out Real; |
1079 | V : out Real); |
1080 | |
1081 | D1(U : in Real; |
1082 | Index : in Integer; |
1083 | Degree : in Integer; |
1084 | Periodic : in Boolean; |
1085 | Poles : in Array1OfPnt from TColgp; |
1086 | Weights : in Array1OfReal from TColStd; |
1087 | Knots : in Array1OfReal from TColStd; |
1088 | Mults : in Array1OfInteger from TColStd; |
1089 | P : out Pnt from gp; |
1090 | V : out Vec from gp); |
1091 | |
1092 | D1(U : in Real; |
1093 | UIndex : in Integer; |
1094 | Degree : in Integer; |
1095 | Periodic : in Boolean; |
1096 | Poles : in Array1OfPnt2d from TColgp; |
1097 | Weights : in Array1OfReal from TColStd; |
1098 | Knots : in Array1OfReal from TColStd; |
1099 | Mults : in Array1OfInteger from TColStd; |
1100 | P : out Pnt2d from gp; |
1101 | V : out Vec2d from gp); |
1102 | |
1103 | D1(U : in Real; |
1104 | Poles : in Array1OfPnt from TColgp; |
1105 | Weights : in Array1OfReal from TColStd; |
1106 | P : out Pnt from gp; |
1107 | V : out Vec from gp); |
1108 | ---Warning: To be used for Beziercurves ONLY!!! |
1109 | |
1110 | D1(U : in Real; |
1111 | Poles : in Array1OfPnt2d from TColgp; |
1112 | Weights : in Array1OfReal from TColStd; |
1113 | P : out Pnt2d from gp; |
1114 | V : out Vec2d from gp); |
1115 | ---Warning: To be used for Beziercurves ONLY!!! |
1116 | |
1117 | D2(U : in Real; |
1118 | Index : in Integer; |
1119 | Degree : in Integer; |
1120 | Periodic : in Boolean; |
1121 | Poles : in Array1OfReal from TColStd; |
1122 | Weights : in Array1OfReal from TColStd; |
1123 | Knots : in Array1OfReal from TColStd; |
1124 | Mults : in Array1OfInteger from TColStd; |
1125 | P : out Real; |
1126 | V1,V2 : out Real); |
1127 | |
1128 | D2(U : in Real; |
1129 | Index : in Integer; |
1130 | Degree : in Integer; |
1131 | Periodic : in Boolean; |
1132 | Poles : in Array1OfPnt from TColgp; |
1133 | Weights : in Array1OfReal from TColStd; |
1134 | Knots : in Array1OfReal from TColStd; |
1135 | Mults : in Array1OfInteger from TColStd; |
1136 | P : out Pnt from gp; |
1137 | V1,V2 : out Vec from gp); |
1138 | |
1139 | D2(U : in Real; |
1140 | UIndex : in Integer; |
1141 | Degree : in Integer; |
1142 | Periodic : in Boolean; |
1143 | Poles : in Array1OfPnt2d from TColgp; |
1144 | Weights : in Array1OfReal from TColStd; |
1145 | Knots : in Array1OfReal from TColStd; |
1146 | Mults : in Array1OfInteger from TColStd; |
1147 | P : out Pnt2d from gp; |
1148 | V1,V2 : out Vec2d from gp); |
1149 | |
1150 | D2(U : in Real; |
1151 | Poles : in Array1OfPnt from TColgp; |
1152 | Weights : in Array1OfReal from TColStd; |
1153 | P : out Pnt from gp; |
1154 | V1,V2 : out Vec from gp); |
1155 | ---Warning: To be used for Beziercurves ONLY!!! |
1156 | |
1157 | D2(U : in Real; |
1158 | Poles : in Array1OfPnt2d from TColgp; |
1159 | Weights : in Array1OfReal from TColStd; |
1160 | P : out Pnt2d from gp; |
1161 | V1,V2 : out Vec2d from gp); |
1162 | ---Warning: To be used for Beziercurves ONLY!!! |
1163 | |
1164 | D3(U : in Real; |
1165 | Index : in Integer; |
1166 | Degree : in Integer; |
1167 | Periodic : in Boolean; |
1168 | Poles : in Array1OfReal from TColStd; |
1169 | Weights : in Array1OfReal from TColStd; |
1170 | Knots : in Array1OfReal from TColStd; |
1171 | Mults : in Array1OfInteger from TColStd; |
1172 | P : out Real; |
1173 | V1,V2,V3 : out Real); |
1174 | |
1175 | D3(U : in Real; |
1176 | Index : in Integer; |
1177 | Degree : in Integer; |
1178 | Periodic : in Boolean; |
1179 | Poles : in Array1OfPnt from TColgp; |
1180 | Weights : in Array1OfReal from TColStd; |
1181 | Knots : in Array1OfReal from TColStd; |
1182 | Mults : in Array1OfInteger from TColStd; |
1183 | P : out Pnt from gp; |
1184 | V1,V2,V3 : out Vec from gp); |
1185 | |
1186 | D3(U : in Real; |
1187 | UIndex : in Integer; |
1188 | Degree : in Integer; |
1189 | Periodic : in Boolean; |
1190 | Poles : in Array1OfPnt2d from TColgp; |
1191 | Weights : in Array1OfReal from TColStd; |
1192 | Knots : in Array1OfReal from TColStd; |
1193 | Mults : in Array1OfInteger from TColStd; |
1194 | P : out Pnt2d from gp; |
1195 | V1,V2,V3 : out Vec2d from gp); |
1196 | |
1197 | D3(U : in Real; |
1198 | Poles : in Array1OfPnt from TColgp; |
1199 | Weights : in Array1OfReal from TColStd; |
1200 | P : out Pnt from gp; |
1201 | V1,V2,V3 : out Vec from gp); |
1202 | ---Warning: To be used for Beziercurves ONLY!!! |
1203 | |
1204 | D3(U : in Real; |
1205 | Poles : in Array1OfPnt2d from TColgp; |
1206 | Weights : in Array1OfReal from TColStd; |
1207 | P : out Pnt2d from gp; |
1208 | V1,V2,V3 : out Vec2d from gp); |
1209 | ---Warning: To be used for Beziercurves ONLY!!! |
1210 | |
1211 | DN(U : in Real; |
1212 | N : in Integer; |
1213 | Index : in Integer; |
1214 | Degree : in Integer; |
1215 | Periodic : in Boolean; |
1216 | Poles : in Array1OfReal from TColStd; |
1217 | Weights : in Array1OfReal from TColStd; |
1218 | Knots : in Array1OfReal from TColStd; |
1219 | Mults : in Array1OfInteger from TColStd; |
1220 | VN : out Real); |
1221 | |
1222 | DN(U : in Real; |
1223 | N : in Integer; |
1224 | Index : in Integer; |
1225 | Degree : in Integer; |
1226 | Periodic : in Boolean; |
1227 | Poles : in Array1OfPnt from TColgp; |
1228 | Weights : in Array1OfReal from TColStd; |
1229 | Knots : in Array1OfReal from TColStd; |
1230 | Mults : in Array1OfInteger from TColStd; |
1231 | VN : out Vec from gp); |
1232 | |
1233 | DN(U : in Real; |
1234 | N : in Integer; |
1235 | UIndex : in Integer; |
1236 | Degree : in Integer; |
1237 | Periodic : in Boolean; |
1238 | Poles : in Array1OfPnt2d from TColgp; |
1239 | Weights : in Array1OfReal from TColStd; |
1240 | Knots : in Array1OfReal from TColStd; |
1241 | Mults : in Array1OfInteger from TColStd; |
1242 | V : out Vec2d from gp); |
1243 | |
1244 | DN(U : in Real; |
1245 | N : in Integer; |
1246 | Poles : in Array1OfPnt from TColgp; |
1247 | Weights : in Array1OfReal from TColStd; |
1248 | P : out Pnt from gp; |
1249 | VN : out Vec from gp); |
1250 | ---Warning: To be used for Beziercurves ONLY!!! |
1251 | |
1252 | DN(U : in Real; |
1253 | N : in Integer; |
1254 | Poles : in Array1OfPnt2d from TColgp; |
1255 | Weights : in Array1OfReal from TColStd; |
1256 | P : out Pnt2d from gp; |
1257 | VN : out Vec2d from gp); |
1258 | ---Purpose: The above functions compute values and |
1259 | -- derivatives in the following situations : |
1260 | -- |
1261 | -- * 3D, 2D and 1D |
1262 | -- |
1263 | -- * Rational or not Rational. |
1264 | -- |
1265 | -- * Knots and multiplicities or "flat knots" without |
1266 | -- multiplicities. |
1267 | -- |
1268 | -- * The <Index> is the the localization of the |
1269 | -- parameter in the knot sequence. If <Index> is out |
1270 | -- of range the correct value will be searched. |
1271 | -- |
1272 | -- |
1273 | -- VERY IMPORTANT!!! |
1274 | -- USE BSplCLib::NoWeights() as Weights argument for non |
1275 | -- rational curves computations. |
1276 | ---Warning: To be used for Beziercurves ONLY!!! |
1277 | |
1278 | EvalBsplineBasis(Side : in Integer ; |
1279 | DerivativeOrder : in Integer ; |
1280 | Order : in Integer ; |
1281 | FlatKnots : Array1OfReal from TColStd ; |
1282 | Parameter : in Real ; |
1283 | FirstNonZeroBsplineIndex : in out Integer ; |
1284 | BsplineBasis : in out Matrix from math) |
1285 | |
1286 | returns Integer ; |
1287 | ---Purpose: This evaluates the Bspline Basis at a |
1288 | -- given parameter Parameter up to the |
1289 | -- requested DerivativeOrder and store the |
1290 | -- result in the array BsplineBasis in the |
1291 | -- following fashion |
1292 | -- BSplineBasis(1,1) = |
1293 | -- value of first non vanishing |
1294 | -- Bspline function which has Index FirstNonZeroBsplineIndex |
1295 | -- BsplineBasis(1,2) = |
1296 | -- value of second non vanishing |
1297 | -- Bspline function which has Index |
1298 | -- FirstNonZeroBsplineIndex + 1 |
1299 | -- BsplineBasis(1,n) = |
1300 | -- value of second non vanishing non vanishing |
1301 | -- Bspline function which has Index |
1302 | -- FirstNonZeroBsplineIndex + n (n <= Order) |
1303 | -- BSplineBasis(2,1) = |
1304 | -- value of derivative of first non vanishing |
1305 | -- Bspline function which has Index FirstNonZeroBsplineIndex |
1306 | -- BSplineBasis(N,1) = |
1307 | -- value of Nth derivative of first non vanishing |
1308 | -- Bspline function which has Index FirstNonZeroBsplineIndex |
1309 | -- if N <= DerivativeOrder + 1 |
1310 | |
1311 | BuildBSpMatrix(Parameters : in Array1OfReal from TColStd; |
1312 | OrderArray : in Array1OfInteger from TColStd; |
1313 | FlatKnots : in Array1OfReal from TColStd; |
1314 | Degree : in Integer; |
1315 | Matrix : in out Matrix from math; |
1316 | UpperBandWidth : out Integer ; |
1317 | LowerBandWidth : out Integer) returns Integer ; |
1318 | ---Purpose: This Builds a fully blown Matrix of |
1319 | -- (ni) |
1320 | -- Bi (tj) |
1321 | -- |
1322 | -- with i and j within 1..Order + NumPoles |
1323 | -- The integer ni is the ith slot of the |
1324 | -- array OrderArray, tj is the jth slot of |
1325 | -- the array Parameters |
1326 | |
1327 | FactorBandedMatrix(Matrix : in out Matrix from math ; |
1328 | UpperBandWidth : in Integer ; |
1329 | LowerBandWidth : in Integer ; |
1330 | PivotIndexProblem : out Integer) returns Integer ; |
1331 | ---Purpose: this factors the Banded Matrix in |
1332 | -- the LU form with a Banded storage of |
1333 | -- components of the L matrix |
1334 | -- WARNING : do not use if the Matrix is |
1335 | -- totally positive (It is the case for |
1336 | -- Bspline matrices build as above with |
1337 | -- parameters being the Schoenberg points |
1338 | |
1339 | SolveBandedSystem (Matrix : in Matrix from math ; |
1340 | UpperBandWidth : in Integer ; |
1341 | LowerBandWidth : in Integer ; |
1342 | ArrayDimension : in Integer ; |
1343 | Array : in out Real) |
1344 | returns Integer ; |
1345 | ---Purpose: This solves the system Matrix.X = B |
1346 | -- with when Matrix is factored in LU form |
1347 | -- The Array is an seen as an |
1348 | -- Array[1..N][1..ArrayDimension] with N = |
1349 | -- the rank of the matrix Matrix. The |
1350 | -- result is stored in Array when each |
1351 | -- coordinate is solved that is B is the |
1352 | -- array whose values are |
1353 | -- B[i] = Array[i][p] for each p in 1..ArrayDimension |
1354 | |
1355 | SolveBandedSystem (Matrix : in Matrix from math ; |
1356 | UpperBandWidth : in Integer ; |
1357 | LowerBandWidth : in Integer ; |
1358 | Array : in out Array1OfPnt2d from TColgp) |
1359 | returns Integer ; |
1360 | ---Purpose: This solves the system Matrix.X = B |
1361 | -- with when Matrix is factored in LU form |
1362 | -- The Array has the length of |
1363 | -- the rank of the matrix Matrix. The |
1364 | -- result is stored in Array when each |
1365 | -- coordinate is solved that is B is the |
1366 | -- array whose values are |
1367 | -- B[i] = Array[i][p] for each p in 1..ArrayDimension |
1368 | |
1369 | SolveBandedSystem (Matrix : in Matrix from math ; |
1370 | UpperBandWidth : in Integer ; |
1371 | LowerBandWidth : in Integer ; |
1372 | Array : in out Array1OfPnt from TColgp) |
1373 | returns Integer ; |
1374 | ---Purpose: This solves the system Matrix.X = B |
1375 | -- with when Matrix is factored in LU form |
1376 | -- The Array has the length of |
1377 | -- the rank of the matrix Matrix. The |
1378 | -- result is stored in Array when each |
1379 | -- coordinate is solved that is B is the |
1380 | -- array whose values are |
1381 | -- B[i] = Array[i][p] for each p in 1..ArrayDimension |
1382 | |
1383 | SolveBandedSystem (Matrix : in Matrix from math ; |
1384 | UpperBandWidth : in Integer ; |
1385 | LowerBandWidth : in Integer ; |
1386 | HomogenousFlag : in Boolean ; |
1387 | ArrayDimension : Integer ; |
1388 | Array : in out Real ; |
1389 | Weights : in out Real ) |
1390 | returns Integer ; |
1391 | |
1392 | SolveBandedSystem (Matrix : in Matrix from math ; |
1393 | UpperBandWidth : in Integer ; |
1394 | LowerBandWidth : in Integer ; |
1395 | HomogenousFlag : in Boolean ; |
1396 | Array : in out Array1OfPnt2d from TColgp; |
1397 | Weights : in out Array1OfReal from TColStd ) |
1398 | returns Integer ; |
1399 | ---Purpose: This solves the system Matrix.X = B |
1400 | -- with when Matrix is factored in LU form |
1401 | -- The Array is an seen as an |
1402 | -- Array[1..N][1..ArrayDimension] with N = |
1403 | -- the rank of the matrix Matrix. The |
1404 | -- result is stored in Array when each |
1405 | -- coordinate is solved that is B is the |
1406 | -- array whose values are B[i] = |
1407 | -- Array[i][p] for each p in |
1408 | -- 1..ArrayDimension. If HomogeneousFlag == |
1409 | -- 0 the Poles are multiplied by the |
1410 | -- Weights uppon Entry and once |
1411 | -- interpolation is carried over the |
1412 | -- result of the poles are divided by the |
1413 | -- result of the interpolation of the |
1414 | -- weights. Otherwise if HomogenousFlag == 1 |
1415 | -- the Poles and Weigths are treated homogenously |
1416 | -- that is that those are interpolated as they |
1417 | -- are and result is returned without division |
1418 | -- by the interpolated weigths. |
1419 | |
1420 | SolveBandedSystem (Matrix : in Matrix from math ; |
1421 | UpperBandWidth : in Integer ; |
1422 | LowerBandWidth : in Integer ; |
1423 | HomogeneousFlag : in Boolean ; |
1424 | Array : in out Array1OfPnt from TColgp; |
1425 | Weights : in out Array1OfReal from TColStd ) |
1426 | returns Integer ; |
1427 | ---Purpose: This solves the system Matrix.X = B |
1428 | -- with when Matrix is factored in LU form |
1429 | -- The Array is an seen as an |
1430 | -- Array[1..N][1..ArrayDimension] with N = |
1431 | -- the rank of the matrix Matrix. The |
1432 | -- result is stored in Array when each |
1433 | -- coordinate is solved that is B is the |
1434 | -- array whose values are |
1435 | -- B[i] = Array[i][p] for each p in 1..ArrayDimension |
1436 | -- If HomogeneousFlag == |
1437 | -- 0 the Poles are multiplied by the |
1438 | -- Weights uppon Entry and once |
1439 | -- interpolation is carried over the |
1440 | -- result of the poles are divided by the |
1441 | -- result of the interpolation of the |
1442 | -- weights. Otherwise if HomogenousFlag == 1 |
1443 | -- the Poles and Weigths are treated homogenously |
1444 | -- that is that those are interpolated as they |
1445 | -- are and result is returned without division |
1446 | -- by the interpolated weigths. |
1447 | |
1448 | MergeBSplineKnots(Tolerance : Real from Standard ; |
1449 | StartValue : Real from Standard ; |
1450 | EndValue : Real from Standard ; |
1451 | Degree1 : Integer from Standard ; |
1452 | Knots1 : Array1OfReal from TColStd ; |
1453 | Mults1 : Array1OfInteger from TColStd ; |
1454 | Degree2 : Integer from Standard ; |
1455 | Knots2 : Array1OfReal from TColStd ; |
1456 | Mults2 : Array1OfInteger from TColStd ; |
1457 | NumPoles : in out Integer ; |
1458 | NewKnots : in out HArray1OfReal from TColStd ; |
1459 | NewMults : in out HArray1OfInteger from TColStd) ; |
1460 | ---Purpose: Merges two knot vector by setting the starting and |
1461 | -- ending values to StartValue and EndValue |
1462 | |
1463 | FunctionReparameterise(Function : EvaluatorFunction from BSplCLib ; |
1464 | BSplineDegree : Integer ; |
1465 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1466 | PolesDimension : Integer ; |
1467 | Poles : in out Real ; |
1468 | |
1469 | FlatKnots : Array1OfReal from TColStd ; |
1470 | NewDegree : Integer ; |
1471 | NewPoles : in out Real ; |
1472 | Status : in out Integer) ; |
1473 | ---Purpose: This function will compose a given Vectorial BSpline F(t) |
1474 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1475 | -- its Poles array which are coded as an array of Real |
1476 | -- of the form [1..NumPoles][1..PolesDimension] with a |
1477 | -- function a(t) which is assumed to satisfy the |
1478 | -- following: |
1479 | -- |
1480 | -- 1. F(a(t)) is a polynomial BSpline |
1481 | -- that can be expressed exactly as a BSpline of degree |
1482 | -- NewDegree on the knots FlatKnots |
1483 | -- |
1484 | -- 2. a(t) defines a differentiable |
1485 | -- isomorphism between the range of FlatKnots to the range |
1486 | -- of BSplineFlatKnots which is the |
1487 | -- same as the range of F(t) |
1488 | -- |
1489 | -- Warning: it is |
1490 | -- the caller's responsability to insure that conditions |
1491 | -- 1. and 2. above are satisfied : no check whatsoever |
1492 | -- is made in this method |
1493 | -- |
1494 | -- Status will return 0 if OK else it will return the pivot index |
1495 | -- of the matrix that was inverted to compute the multiplied |
1496 | -- BSpline : the method used is interpolation at Schoenenberg |
1497 | -- points of F(a(t)) |
1498 | |
1499 | FunctionReparameterise( |
1500 | Function : EvaluatorFunction from BSplCLib ; |
1501 | BSplineDegree : Integer ; |
1502 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1503 | Poles : Array1OfReal from TColStd ; |
1504 | |
1505 | FlatKnots : Array1OfReal from TColStd ; |
1506 | NewDegree : Integer ; |
1507 | NewPoles : in out Array1OfReal from TColStd ; |
1508 | Status : in out Integer) ; |
1509 | ---Purpose: This function will compose a given Vectorial BSpline F(t) |
1510 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1511 | -- its Poles array which are coded as an array of Real |
1512 | -- of the form [1..NumPoles][1..PolesDimension] with a |
1513 | -- function a(t) which is assumed to satisfy the |
1514 | -- following: |
1515 | -- |
1516 | -- 1. F(a(t)) is a polynomial BSpline |
1517 | -- that can be expressed exactly as a BSpline of degree |
1518 | -- NewDegree on the knots FlatKnots |
1519 | -- |
1520 | -- 2. a(t) defines a differentiable |
1521 | -- isomorphism between the range of FlatKnots to the range |
1522 | -- of BSplineFlatKnots which is the |
1523 | -- same as the range of F(t) |
1524 | -- |
1525 | -- Warning: it is |
1526 | -- the caller's responsability to insure that conditions |
1527 | -- 1. and 2. above are satisfied : no check whatsoever |
1528 | -- is made in this method |
1529 | -- |
1530 | -- Status will return 0 if OK else it will return the pivot index |
1531 | -- of the matrix that was inverted to compute the multiplied |
1532 | -- BSpline : the method used is interpolation at Schoenenberg |
1533 | -- points of F(a(t)) |
1534 | |
1535 | FunctionReparameterise( Function : EvaluatorFunction from BSplCLib ; |
1536 | BSplineDegree : Integer ; |
1537 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1538 | Poles : Array1OfPnt from TColgp ; |
1539 | |
1540 | FlatKnots : Array1OfReal from TColStd ; |
1541 | NewDegree : Integer ; |
1542 | NewPoles : in out Array1OfPnt from TColgp ; |
1543 | Status : in out Integer) ; |
1544 | ---Purpose: this will compose a given Vectorial BSpline F(t) |
1545 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1546 | -- its Poles array which are coded as an array of Real |
1547 | -- of the form [1..NumPoles][1..PolesDimension] with a |
1548 | -- function a(t) which is assumed to satisfy the |
1549 | -- following : 1. F(a(t)) is a polynomial BSpline |
1550 | -- that can be expressed exactly as a BSpline of degree |
1551 | -- NewDegree on the knots FlatKnots |
1552 | -- 2. a(t) defines a differentiable |
1553 | -- isomorphism between the range of FlatKnots to the range |
1554 | -- of BSplineFlatKnots which is the |
1555 | -- same as the range of F(t) |
1556 | -- Warning: it is |
1557 | -- the caller's responsability to insure that conditions |
1558 | -- 1. and 2. above are satisfied : no check whatsoever |
1559 | -- is made in this method |
1560 | -- Status will return 0 if OK else it will return the pivot index |
1561 | -- of the matrix that was inverted to compute the multiplied |
1562 | -- BSpline : the method used is interpolation at Schoenenberg |
1563 | -- points of F(a(t)) |
1564 | |
1565 | FunctionReparameterise( |
1566 | Function : EvaluatorFunction from BSplCLib ; |
1567 | BSplineDegree : Integer ; |
1568 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1569 | Poles : Array1OfPnt2d from TColgp ; |
1570 | |
1571 | FlatKnots : Array1OfReal from TColStd ; |
1572 | NewDegree : Integer ; |
1573 | NewPoles : in out Array1OfPnt2d from TColgp ; |
1574 | Status : in out Integer) ; |
1575 | ---Purpose: this will compose a given Vectorial BSpline F(t) |
1576 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1577 | -- its Poles array which are coded as an array of Real |
1578 | -- of the form [1..NumPoles][1..PolesDimension] with a |
1579 | -- function a(t) which is assumed to satisfy the |
1580 | -- following : 1. F(a(t)) is a polynomial BSpline |
1581 | -- that can be expressed exactly as a BSpline of degree |
1582 | -- NewDegree on the knots FlatKnots |
1583 | -- 2. a(t) defines a differentiable |
1584 | -- isomorphism between the range of FlatKnots to the range |
1585 | -- of BSplineFlatKnots which is the |
1586 | -- same as the range of F(t) |
1587 | -- Warning: it is |
1588 | -- the caller's responsability to insure that conditions |
1589 | -- 1. and 2. above are satisfied : no check whatsoever |
1590 | -- is made in this method |
1591 | -- Status will return 0 if OK else it will return the pivot index |
1592 | -- of the matrix that was inverted to compute the multiplied |
1593 | -- BSpline : the method used is interpolation at Schoenenberg |
1594 | -- points of F(a(t)) |
1595 | |
1596 | FunctionMultiply(Function : EvaluatorFunction from BSplCLib ; |
1597 | BSplineDegree : Integer ; |
1598 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1599 | PolesDimension : Integer ; |
1600 | Poles : in out Real ; |
1601 | FlatKnots : Array1OfReal from TColStd ; |
1602 | NewDegree : Integer ; |
1603 | NewPoles : in out Real ; |
1604 | Status : in out Integer) ; |
1605 | ---Purpose: this will multiply a given Vectorial BSpline F(t) |
1606 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1607 | -- its Poles array which are coded as an array of Real |
1608 | -- of the form [1..NumPoles][1..PolesDimension] by a |
1609 | -- function a(t) which is assumed to satisfy the |
1610 | -- following : 1. a(t) * F(t) is a polynomial BSpline |
1611 | -- that can be expressed exactly as a BSpline of degree |
1612 | -- NewDegree on the knots FlatKnots 2. the range of a(t) |
1613 | -- is the same as the range of F(t) |
1614 | -- Warning: it is |
1615 | -- the caller's responsability to insure that conditions |
1616 | -- 1. and 2. above are satisfied : no check whatsoever |
1617 | -- is made in this method |
1618 | -- Status will return 0 if OK else it will return the pivot index |
1619 | -- of the matrix that was inverted to compute the multiplied |
1620 | -- BSpline : the method used is interpolation at Schoenenberg |
1621 | -- points of a(t)*F(t) |
1622 | |
1623 | FunctionMultiply(Function : EvaluatorFunction from BSplCLib ; |
1624 | BSplineDegree : Integer ; |
1625 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1626 | Poles : Array1OfReal from TColStd ; |
1627 | FlatKnots : Array1OfReal from TColStd ; |
1628 | NewDegree : Integer ; |
1629 | NewPoles : in out Array1OfReal from TColStd ; |
1630 | Status : in out Integer) ; |
1631 | ---Purpose: this will multiply a given Vectorial BSpline F(t) |
1632 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1633 | -- its Poles array which are coded as an array of Real |
1634 | -- of the form [1..NumPoles][1..PolesDimension] by a |
1635 | -- function a(t) which is assumed to satisfy the |
1636 | -- following : 1. a(t) * F(t) is a polynomial BSpline |
1637 | -- that can be expressed exactly as a BSpline of degree |
1638 | -- NewDegree on the knots FlatKnots 2. the range of a(t) |
1639 | -- is the same as the range of F(t) |
1640 | -- Warning: it is |
1641 | -- the caller's responsability to insure that conditions |
1642 | -- 1. and 2. above are satisfied : no check whatsoever |
1643 | -- is made in this method |
1644 | -- Status will return 0 if OK else it will return the pivot index |
1645 | -- of the matrix that was inverted to compute the multiplied |
1646 | -- BSpline : the method used is interpolation at Schoenenberg |
1647 | -- points of a(t)*F(t) |
1648 | |
1649 | FunctionMultiply(Function : EvaluatorFunction from BSplCLib ; |
1650 | BSplineDegree : Integer ; |
1651 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1652 | Poles : Array1OfPnt2d from TColgp ; |
1653 | FlatKnots : Array1OfReal from TColStd ; |
1654 | NewDegree : Integer ; |
1655 | NewPoles : in out Array1OfPnt2d from TColgp ; |
1656 | Status : in out Integer) ; |
1657 | ---Purpose: this will multiply a given Vectorial BSpline F(t) |
1658 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1659 | -- its Poles array which are coded as an array of Real |
1660 | -- of the form [1..NumPoles][1..PolesDimension] by a |
1661 | -- function a(t) which is assumed to satisfy the |
1662 | -- following : 1. a(t) * F(t) is a polynomial BSpline |
1663 | -- that can be expressed exactly as a BSpline of degree |
1664 | -- NewDegree on the knots FlatKnots 2. the range of a(t) |
1665 | -- is the same as the range of F(t) |
1666 | -- Warning: it is |
1667 | -- the caller's responsability to insure that conditions |
1668 | -- 1. and 2. above are satisfied : no check whatsoever |
1669 | -- is made in this method |
1670 | -- Status will return 0 if OK else it will return the pivot index |
1671 | -- of the matrix that was inverted to compute the multiplied |
1672 | -- BSpline : the method used is interpolation at Schoenenberg |
1673 | -- points of a(t)*F(t) |
1674 | |
1675 | FunctionMultiply(Function : EvaluatorFunction from BSplCLib ; |
1676 | BSplineDegree : Integer ; |
1677 | BSplineFlatKnots : Array1OfReal from TColStd ; |
1678 | Poles : Array1OfPnt from TColgp ; |
1679 | FlatKnots : Array1OfReal from TColStd ; |
1680 | NewDegree : Integer ; |
1681 | NewPoles : in out Array1OfPnt from TColgp ; |
1682 | Status : in out Integer) ; |
1683 | ---Purpose: this will multiply a given Vectorial BSpline F(t) |
1684 | -- defined by its BSplineDegree and BSplineFlatKnotsl, |
1685 | -- its Poles array which are coded as an array of Real |
1686 | -- of the form [1..NumPoles][1..PolesDimension] by a |
1687 | -- function a(t) which is assumed to satisfy the |
1688 | -- following : 1. a(t) * F(t) is a polynomial BSpline |
1689 | -- that can be expressed exactly as a BSpline of degree |
1690 | -- NewDegree on the knots FlatKnots 2. the range of a(t) |
1691 | -- is the same as the range of F(t) |
1692 | -- Warning: it is |
1693 | -- the caller's responsability to insure that conditions |
1694 | -- 1. and 2. above are satisfied : no check whatsoever |
1695 | -- is made in this method |
1696 | -- Status will return 0 if OK else it will return the pivot index |
1697 | -- of the matrix that was inverted to compute the multiplied |
1698 | -- BSpline : the method used is interpolation at Schoenenberg |
1699 | -- points of a(t)*F(t) |
1700 | |
1701 | Eval(U : Real; |
1702 | PeriodicFlag : Boolean ; |
1703 | DerivativeRequest : Integer ; |
1704 | ExtrapMode : in out Integer ; |
1705 | Degree : Integer; |
1706 | FlatKnots : Array1OfReal from TColStd ; |
1707 | ArrayDimension : Integer ; |
1708 | Poles : in out Real ; |
1709 | Result : in out Real) ; |
1710 | ---Purpose: Perform the De Boor algorithm to evaluate a point at |
1711 | -- parameter <U>, with <Degree> and <Dimension>. |
1712 | -- |
1713 | -- Poles is an array of Reals of size |
1714 | -- |
1715 | -- <Dimension> * <Degree>+1 |
1716 | -- |
1717 | -- Containing the poles. At the end <Poles> contains |
1718 | -- the current point. Poles Contain all the poles of |
1719 | -- the BsplineCurve, Knots also Contains all the knots |
1720 | -- of the BsplineCurve. ExtrapMode has two slots [0] = |
1721 | -- Degree used to extrapolate before the first knot [1] |
1722 | -- = Degre used to extrapolate after the last knot has |
1723 | -- to be between 1 and Degree |
1724 | |
1725 | Eval(U : Real; |
1726 | PeriodicFlag : Boolean ; |
1727 | DerivativeRequest : Integer ; |
1728 | ExtrapMode : in out Integer ; |
1729 | Degree : Integer; |
1730 | FlatKnots : Array1OfReal from TColStd ; |
1731 | ArrayDimension : Integer ; |
1732 | Poles : in out Real ; |
1733 | Weights : in out Real ; |
1734 | PolesResult : in out Real ; |
1735 | WeightsResult : in out Real) ; |
1736 | ---Purpose: Perform the De Boor algorithm to evaluate a point at |
1737 | -- parameter <U>, with <Degree> and <Dimension>. |
1738 | -- Evaluates by multiplying the Poles by the Weights and |
1739 | -- gives the homogeneous result in PolesResult that is |
1740 | -- the results of the evaluation of the numerator once it |
1741 | -- has been multiplied by the weights and in |
1742 | -- WeightsResult one has the result of the evaluation of |
1743 | -- the denominator |
1744 | -- |
1745 | -- Warning: <PolesResult> and <WeightsResult> must be dimensionned |
1746 | -- properly. |
1747 | |
1748 | Eval(U : Real; |
1749 | PeriodicFlag : Boolean ; |
1750 | HomogeneousFlag : Boolean ; |
1751 | ExtrapMode : in out Integer ; |
1752 | Degree : Integer; |
1753 | FlatKnots : Array1OfReal from TColStd ; |
1754 | Poles : Array1OfPnt from TColgp; |
1755 | Weights : Array1OfReal from TColStd ; |
1756 | Point : out Pnt from gp ; |
1757 | Weight : in out Real) ; |
1758 | ---Purpose: Perform the evaluation of the Bspline Basis |
1759 | -- and then multiplies by the weights |
1760 | -- this just evaluates the current point |
1761 | |
1762 | Eval(U : Real; |
1763 | PeriodicFlag : Boolean ; |
1764 | HomogeneousFlag : Boolean ; |
1765 | ExtrapMode : in out Integer ; |
1766 | Degree : Integer; |
1767 | FlatKnots : Array1OfReal from TColStd ; |
1768 | Poles : Array1OfPnt2d from TColgp; |
1769 | Weights : Array1OfReal from TColStd ; |
1770 | Point : out Pnt2d from gp ; |
1771 | Weight : in out Real) ; |
1772 | ---Purpose: Perform the evaluation of the Bspline Basis |
1773 | -- and then multiplies by the weights |
1774 | -- this just evaluates the current point |
1775 | -- |
1776 | |
1777 | TangExtendToConstraint(FlatKnots : Array1OfReal from TColStd ; |
1778 | C1Coefficient : Real ; |
1779 | NumPoles : in Integer ; |
1780 | Poles : in out Real ; |
1781 | Dimension : Integer ; |
1782 | Degree : Integer ; |
1783 | ConstraintPoint : Array1OfReal from TColStd ; |
1784 | Continuity : Integer ; |
1785 | After : Boolean ; |
1786 | NbPolesResult : in out Integer ; |
1787 | NbKnotsRsult : in out Integer ; |
1788 | KnotsResult : in out Real ; |
1789 | PolesResult : in out Real) ; |
1790 | ---Purpose: Extend a BSpline nD using the tangency map |
1791 | -- <C1Coefficient> is the coefficient of reparametrisation |
1792 | -- <Continuity> must be equal to 1, 2 or 3. |
1793 | -- <Degree> must be greater or equal than <Continuity> + 1. |
1794 | -- |
1795 | -- Warning: <KnotsResult> and <PolesResult> must be dimensionned |
1796 | -- properly. |
1797 | |
1798 | CacheD0(U : Real; |
1799 | Degree : Integer; |
1800 | CacheParameter : Real; |
1801 | SpanLenght : Real; |
1802 | Poles : Array1OfPnt from TColgp ; |
1803 | Weights : Array1OfReal from TColStd ; |
1804 | Point : out Pnt from gp) ; |
1805 | ---Purpose: Perform the evaluation of the of the cache |
1806 | -- the parameter must be normalized between |
1807 | -- the 0 and 1 for the span. |
1808 | -- The Cache must be valid when calling this |
1809 | -- routine. Geom Package will insure that. |
1810 | -- and then multiplies by the weights |
1811 | -- this just evaluates the current point |
1812 | -- the CacheParameter is where the Cache was |
1813 | -- constructed the SpanLength is to normalize |
1814 | -- the polynomial in the cache to avoid bad conditioning |
1815 | -- effects |
1816 | |
1817 | CacheD0(U : Real; |
1818 | Degree : Integer; |
1819 | CacheParameter : Real; |
1820 | SpanLenght : Real; |
1821 | Poles : Array1OfPnt2d from TColgp; |
1822 | Weights : Array1OfReal from TColStd ; |
1823 | Point : out Pnt2d from gp) ; |
1824 | ---Purpose: Perform the evaluation of the Bspline Basis |
1825 | -- and then multiplies by the weights |
1826 | -- this just evaluates the current point |
1827 | -- the parameter must be normalized between |
1828 | -- the 0 and 1 for the span. |
1829 | -- The Cache must be valid when calling this |
1830 | -- routine. Geom Package will insure that. |
1831 | -- and then multiplies by the weights |
1832 | -- ththe CacheParameter is where the Cache was |
1833 | -- constructed the SpanLength is to normalize |
1834 | -- the polynomial in the cache to avoid bad conditioning |
1835 | -- effectsis just evaluates the current point |
1836 | |
1837 | CoefsD0(U : Real; |
1838 | Poles : Array1OfPnt from TColgp ; |
1839 | Weights : Array1OfReal from TColStd ; |
1840 | Point : out Pnt from gp) ; |
1841 | ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with |
1842 | -- the method PolesCoefficients. |
1843 | -- Warning: To be used for Beziercurves ONLY!!! |
1844 | ---C++: inline |
1845 | |
1846 | CoefsD0(U : Real; |
1847 | Poles : Array1OfPnt2d from TColgp ; |
1848 | Weights : Array1OfReal from TColStd ; |
1849 | Point : out Pnt2d from gp) ; |
1850 | ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with |
1851 | -- the method PolesCoefficients. |
1852 | -- Warning: To be used for Beziercurves ONLY!!! |
1853 | ---C++: inline |
1854 | |
1855 | CacheD1(U : Real; |
1856 | Degree : Integer; |
1857 | CacheParameter: Real; |
1858 | SpanLenght : Real; |
1859 | Poles : Array1OfPnt from TColgp ; |
1860 | Weights : Array1OfReal from TColStd ; |
1861 | Point : out Pnt from gp ; |
1862 | Vec : out Vec from gp) ; |
1863 | ---Purpose: Perform the evaluation of the of the cache |
1864 | -- the parameter must be normalized between |
1865 | -- the 0 and 1 for the span. |
1866 | -- The Cache must be valid when calling this |
1867 | -- routine. Geom Package will insure that. |
1868 | -- and then multiplies by the weights |
1869 | -- this just evaluates the current point |
1870 | -- the CacheParameter is where the Cache was |
1871 | -- constructed the SpanLength is to normalize |
1872 | -- the polynomial in the cache to avoid bad conditioning |
1873 | -- effects |
1874 | |
1875 | CacheD1(U : Real; |
1876 | Degree : Integer; |
1877 | CacheParameter : Real; |
1878 | SpanLenght : Real; |
1879 | Poles : Array1OfPnt2d from TColgp; |
1880 | Weights : Array1OfReal from TColStd ; |
1881 | Point : out Pnt2d from gp ; |
1882 | Vec : out Vec2d from gp) ; |
1883 | ---Purpose: Perform the evaluation of the Bspline Basis |
1884 | -- and then multiplies by the weights |
1885 | -- this just evaluates the current point |
1886 | -- the parameter must be normalized between |
1887 | -- the 0 and 1 for the span. |
1888 | -- The Cache must be valid when calling this |
1889 | -- routine. Geom Package will insure that. |
1890 | -- and then multiplies by the weights |
1891 | -- ththe CacheParameter is where the Cache was |
1892 | -- constructed the SpanLength is to normalize |
1893 | -- the polynomial in the cache to avoid bad conditioning |
1894 | -- effectsis just evaluates the current point |
1895 | |
1896 | CoefsD1(U : Real; |
1897 | Poles : Array1OfPnt from TColgp ; |
1898 | Weights : Array1OfReal from TColStd ; |
1899 | Point : out Pnt from gp; |
1900 | Vec : out Vec from gp) ; |
1901 | ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with |
1902 | -- the method PolesCoefficients. |
1903 | -- Warning: To be used for Beziercurves ONLY!!! |
1904 | ---C++: inline |
1905 | |
1906 | CoefsD1(U : Real; |
1907 | Poles : Array1OfPnt2d from TColgp ; |
1908 | Weights : Array1OfReal from TColStd ; |
1909 | Point : out Pnt2d from gp; |
1910 | Vec : out Vec2d from gp) ; |
1911 | ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with |
1912 | -- the method PolesCoefficients. |
1913 | -- Warning: To be used for Beziercurves ONLY!!! |
1914 | ---C++: inline |
1915 | |
1916 | CacheD2(U : Real; |
1917 | Degree : Integer; |
1918 | CacheParameter : Real; |
1919 | SpanLenght : Real; |
1920 | Poles : Array1OfPnt from TColgp ; |
1921 | Weights : Array1OfReal from TColStd ; |
1922 | Point : out Pnt from gp ; |
1923 | Vec1,Vec2 : out Vec from gp) ; |
1924 | ---Purpose: Perform the evaluation of the of the cache |
1925 | -- the parameter must be normalized between |
1926 | -- the 0 and 1 for the span. |
1927 | -- The Cache must be valid when calling this |
1928 | -- routine. Geom Package will insure that. |
1929 | -- and then multiplies by the weights |
1930 | -- this just evaluates the current point |
1931 | -- the CacheParameter is where the Cache was |
1932 | -- constructed the SpanLength is to normalize |
1933 | -- the polynomial in the cache to avoid bad conditioning |
1934 | -- effects |
1935 | |
1936 | CacheD2(U : Real; |
1937 | Degree : Integer; |
1938 | CacheParameter : Real; |
1939 | SpanLenght : Real; |
1940 | Poles : Array1OfPnt2d from TColgp; |
1941 | Weights : Array1OfReal from TColStd ; |
1942 | Point : out Pnt2d from gp ; |
1943 | Vec1,Vec2 : out Vec2d from gp) ; |
1944 | ---Purpose: Perform the evaluation of the Bspline Basis |
1945 | -- and then multiplies by the weights |
1946 | -- this just evaluates the current point |
1947 | -- the parameter must be normalized between |
1948 | -- the 0 and 1 for the span. |
1949 | -- The Cache must be valid when calling this |
1950 | -- routine. Geom Package will insure that. |
1951 | -- and then multiplies by the weights |
1952 | -- ththe CacheParameter is where the Cache was |
1953 | -- constructed the SpanLength is to normalize |
1954 | -- the polynomial in the cache to avoid bad conditioning |
1955 | -- effectsis just evaluates the current point |
1956 | |
1957 | CoefsD2(U : Real; |
1958 | Poles : Array1OfPnt from TColgp ; |
1959 | Weights : Array1OfReal from TColStd ; |
1960 | Point : out Pnt from gp; |
1961 | Vec1,Vec2 : out Vec from gp) ; |
1962 | ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with |
1963 | -- the method PolesCoefficients. |
1964 | -- Warning: To be used for Beziercurves ONLY!!! |
1965 | ---C++: inline |
1966 | |
1967 | CoefsD2(U : Real; |
1968 | Poles : Array1OfPnt2d from TColgp ; |
1969 | Weights : Array1OfReal from TColStd ; |
1970 | Point : out Pnt2d from gp; |
1971 | Vec1,Vec2 : out Vec2d from gp) ; |
1972 | ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with |
1973 | -- the method PolesCoefficients. |
1974 | -- Warning: To be used for Beziercurves ONLY!!! |
1975 | ---C++: inline |
1976 | |
1977 | |
1978 | CacheD3(U : Real; |
1979 | Degree : Integer; |
1980 | CacheParameter : Real; |
1981 | SpanLenght : Real; |
1982 | Poles : Array1OfPnt from TColgp ; |
1983 | Weights : Array1OfReal from TColStd ; |
1984 | Point : out Pnt from gp ; |
1985 | Vec1,Vec2,Vec3 : out Vec from gp) ; |
1986 | ---Purpose: Perform the evaluation of the of the cache |
1987 | -- the parameter must be normalized between |
1988 | -- the 0 and 1 for the span. |
1989 | -- The Cache must be valid when calling this |
1990 | -- routine. Geom Package will insure that. |
1991 | -- and then multiplies by the weights |
1992 | -- this just evaluates the current point |
1993 | -- the CacheParameter is where the Cache was |
1994 | -- constructed the SpanLength is to normalize |
1995 | -- the polynomial in the cache to avoid bad conditioning |
1996 | -- effects |
1997 | |
1998 | CacheD3(U : Real; |
1999 | Degree : Integer; |
2000 | CacheParameter : Real; |
2001 | SpanLenght : Real; |
2002 | Poles : Array1OfPnt2d from TColgp; |
2003 | Weights : Array1OfReal from TColStd ; |
2004 | Point : out Pnt2d from gp ; |
2005 | Vec1,Vec2,Vec3 : out Vec2d from gp) ; |
2006 | ---Purpose: Perform the evaluation of the Bspline Basis |
2007 | -- and then multiplies by the weights |
2008 | -- this just evaluates the current point |
2009 | -- the parameter must be normalized between |
2010 | -- the 0 and 1 for the span. |
2011 | -- The Cache must be valid when calling this |
2012 | -- routine. Geom Package will insure that. |
2013 | -- and then multiplies by the weights |
2014 | -- ththe CacheParameter is where the Cache was |
2015 | -- constructed the SpanLength is to normalize |
2016 | -- the polynomial in the cache to avoid bad conditioning |
2017 | -- effectsis just evaluates the current point |
2018 | |
2019 | CoefsD3(U : Real; |
2020 | Poles : Array1OfPnt from TColgp ; |
2021 | Weights : Array1OfReal from TColStd ; |
2022 | Point : out Pnt from gp; |
2023 | Vec1,Vec2,Vec3: out Vec from gp) ; |
2024 | ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with |
2025 | -- the method PolesCoefficients. |
2026 | -- Warning: To be used for Beziercurves ONLY!!! |
2027 | ---C++: inline |
2028 | |
2029 | CoefsD3(U : Real; |
2030 | Poles : Array1OfPnt2d from TColgp ; |
2031 | Weights : Array1OfReal from TColStd ; |
2032 | Point : out Pnt2d from gp; |
2033 | Vec1,Vec2,Vec3: out Vec2d from gp) ; |
2034 | ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with |
2035 | -- the method PolesCoefficients. |
2036 | -- Warning: To be used for Beziercurves ONLY!!! |
2037 | ---C++: inline |
2038 | |
2039 | BuildCache(U : Real; |
2040 | InverseOfSpanDomain : Real; |
2041 | PeriodicFlag : Boolean ; |
2042 | Degree : Integer; |
2043 | FlatKnots : Array1OfReal from TColStd ; |
2044 | Poles : Array1OfPnt from TColgp; |
2045 | Weights : Array1OfReal from TColStd ; |
2046 | CachePoles : in out Array1OfPnt from TColgp; |
2047 | CacheWeights : in out Array1OfReal from TColStd) ; |
2048 | ---Purpose: Perform the evaluation of the Taylor expansion |
2049 | -- of the Bspline normalized between 0 and 1. |
2050 | -- If rational computes the homogeneous Taylor expension |
2051 | -- for the numerator and stores it in CachePoles |
2052 | |
2053 | BuildCache(U : Real; |
2054 | InverseOfSpanDomain : Real; |
2055 | PeriodicFlag : Boolean ; |
2056 | Degree : Integer; |
2057 | FlatKnots : Array1OfReal from TColStd ; |
2058 | Poles : Array1OfPnt2d from TColgp; |
2059 | Weights : Array1OfReal from TColStd ; |
2060 | CachePoles : in out Array1OfPnt2d from TColgp; |
2061 | CacheWeights : in out Array1OfReal from TColStd) ; |
2062 | ---Purpose: Perform the evaluation of the Taylor expansion |
2063 | -- of the Bspline normalized between 0 and 1. |
2064 | -- If rational computes the homogeneous Taylor expension |
2065 | -- for the numerator and stores it in CachePoles |
2066 | |
2067 | PolesCoefficients(Poles : Array1OfPnt2d from TColgp; |
2068 | CachePoles : in out Array1OfPnt2d from TColgp); |
2069 | ---Warning: To be used for Beziercurves ONLY!!! |
2070 | ---C++: inline |
2071 | |
2072 | PolesCoefficients(Poles : Array1OfPnt2d from TColgp; |
2073 | Weights : Array1OfReal from TColStd ; |
2074 | CachePoles : in out Array1OfPnt2d from TColgp; |
2075 | CacheWeights : in out Array1OfReal from TColStd) ; |
2076 | ---Warning: To be used for Beziercurves ONLY!!! |
2077 | |
2078 | PolesCoefficients(Poles : Array1OfPnt from TColgp; |
2079 | CachePoles : in out Array1OfPnt from TColgp); |
2080 | ---Warning: To be used for Beziercurves ONLY!!! |
2081 | ---C++: inline |
2082 | |
2083 | PolesCoefficients(Poles : Array1OfPnt from TColgp; |
2084 | Weights : Array1OfReal from TColStd ; |
2085 | CachePoles : in out Array1OfPnt from TColgp; |
2086 | CacheWeights : in out Array1OfReal from TColStd) ; |
2087 | ---Purpose: Encapsulation of BuildCache to perform the |
2088 | -- evaluation of the Taylor expansion for beziercurves |
2089 | -- at parameter 0. |
2090 | -- Warning: To be used for Beziercurves ONLY!!! |
2091 | |
2092 | FlatBezierKnots (Degree: Integer) returns Real; |
2093 | ---Purpose: Returns pointer to statically allocated array representing |
2094 | -- flat knots for bezier curve of the specified degree. |
2095 | -- Raises OutOfRange if Degree > MaxDegree() |
2096 | ---C++: return const & |
2097 | |
2098 | BuildSchoenbergPoints(Degree : Integer ; |
2099 | FlatKnots : Array1OfReal from TColStd ; |
2100 | Parameters : in out Array1OfReal from TColStd) ; |
2101 | ---Purpose: builds the Schoenberg points from the flat knot |
2102 | -- used to interpolate a BSpline since the |
2103 | -- BSpline matrix is invertible. |
2104 | |
2105 | Interpolate(Degree : Integer ; |
2106 | FlatKnots : Array1OfReal from TColStd ; |
2107 | Parameters : Array1OfReal from TColStd ; |
2108 | ContactOrderArray : Array1OfInteger from TColStd ; |
2109 | Poles : in out Array1OfPnt from TColgp ; |
2110 | InversionProblem : out Integer) ; |
2111 | ---Purpose: Performs the interpolation of the data given in |
2112 | -- the Poles array according to the requests in |
2113 | -- ContactOrderArray that is : if |
2114 | -- ContactOrderArray(i) has value d it means that |
2115 | -- Poles(i) containes the dth derivative of the |
2116 | -- function to be interpolated. The length L of the |
2117 | -- following arrays must be the same : |
2118 | -- Parameters, ContactOrderArray, Poles, |
2119 | -- The length of FlatKnots is Degree + L + 1 |
2120 | -- Warning: |
2121 | -- the method used to do that interpolation is |
2122 | -- gauss elimination WITHOUT pivoting. Thus if the |
2123 | -- diagonal is not dominant there is no guarantee |
2124 | -- that the algorithm will work. Nevertheless for |
2125 | -- Cubic interpolation or interpolation at Scheonberg |
2126 | -- points the method will work |
2127 | -- The InversionProblem will report 0 if there was no |
2128 | -- problem else it will give the index of the faulty |
2129 | -- pivot |
2130 | |
2131 | Interpolate(Degree : Integer ; |
2132 | FlatKnots : Array1OfReal from TColStd ; |
2133 | Parameters : Array1OfReal from TColStd ; |
2134 | ContactOrderArray : Array1OfInteger from TColStd ; |
2135 | Poles : in out Array1OfPnt2d from TColgp ; |
2136 | InversionProblem : out Integer) ; |
2137 | ---Purpose: Performs the interpolation of the data given in |
2138 | -- the Poles array according to the requests in |
2139 | -- ContactOrderArray that is : if |
2140 | -- ContactOrderArray(i) has value d it means that |
2141 | -- Poles(i) containes the dth derivative of the |
2142 | -- function to be interpolated. The length L of the |
2143 | -- following arrays must be the same : |
2144 | -- Parameters, ContactOrderArray, Poles, |
2145 | -- The length of FlatKnots is Degree + L + 1 |
2146 | -- Warning: |
2147 | -- the method used to do that interpolation is |
2148 | -- gauss elimination WITHOUT pivoting. Thus if the |
2149 | -- diagonal is not dominant there is no guarantee |
2150 | -- that the algorithm will work. Nevertheless for |
2151 | -- Cubic interpolation at knots or interpolation at Scheonberg |
2152 | -- points the method will work. |
2153 | -- The InversionProblem w |
2154 | -- ll report 0 if there was no |
2155 | -- problem else it will give the index of the faulty |
2156 | -- pivot |
2157 | |
2158 | Interpolate(Degree : Integer ; |
2159 | FlatKnots : Array1OfReal from TColStd ; |
2160 | Parameters : Array1OfReal from TColStd ; |
2161 | ContactOrderArray : Array1OfInteger from TColStd ; |
2162 | Poles : in out Array1OfPnt from TColgp ; |
2163 | Weights : in out Array1OfReal from TColStd ; |
2164 | InversionProblem : out Integer) ; |
2165 | ---Purpose: Performs the interpolation of the data given in |
2166 | -- the Poles array according to the requests in |
2167 | -- ContactOrderArray that is : if |
2168 | -- ContactOrderArray(i) has value d it means that |
2169 | -- Poles(i) containes the dth derivative of the |
2170 | -- function to be interpolated. The length L of the |
2171 | -- following arrays must be the same : |
2172 | -- Parameters, ContactOrderArray, Poles, |
2173 | -- The length of FlatKnots is Degree + L + 1 |
2174 | -- Warning: |
2175 | -- the method used to do that interpolation is |
2176 | -- gauss elimination WITHOUT pivoting. Thus if the |
2177 | -- diagonal is not dominant there is no guarantee |
2178 | -- that the algorithm will work. Nevertheless for |
2179 | -- Cubic interpolation at knots or interpolation at Scheonberg |
2180 | -- points the method will work. |
2181 | -- The InversionProblem will report 0 if there was no |
2182 | -- problem else it will give the index of the faulty |
2183 | -- pivot |
2184 | -- |
2185 | -- |
2186 | |
2187 | Interpolate(Degree : Integer ; |
2188 | FlatKnots : Array1OfReal from TColStd ; |
2189 | Parameters : Array1OfReal from TColStd ; |
2190 | ContactOrderArray : Array1OfInteger from TColStd ; |
2191 | Poles : in out Array1OfPnt2d from TColgp ; |
2192 | Weights : in out Array1OfReal from TColStd ; |
2193 | InversionProblem : out Integer) ; |
2194 | ---Purpose: Performs the interpolation of the data given in |
2195 | -- the Poles array according to the requests in |
2196 | -- ContactOrderArray that is : if |
2197 | -- ContactOrderArray(i) has value d it means that |
2198 | -- Poles(i) containes the dth derivative of the |
2199 | -- function to be interpolated. The length L of the |
2200 | -- following arrays must be the same : |
2201 | -- Parameters, ContactOrderArray, Poles, |
2202 | -- The length of FlatKnots is Degree + L + 1 |
2203 | -- Warning: |
2204 | -- the method used to do that interpolation is |
2205 | -- gauss elimination WITHOUT pivoting. Thus if the |
2206 | -- diagonal is not dominant there is no guarantee |
2207 | -- that the algorithm will work. Nevertheless for |
2208 | -- Cubic interpolation at knots or interpolation at Scheonberg |
2209 | -- points the method will work. |
2210 | -- The InversionProblem w |
2211 | -- ll report 0 if there was no |
2212 | -- problem else it will give the i |
2213 | |
2214 | Interpolate(Degree : Integer ; |
2215 | FlatKnots : Array1OfReal from TColStd ; |
2216 | Parameters : Array1OfReal from TColStd ; |
2217 | ContactOrderArray : Array1OfInteger from TColStd ; |
2218 | ArrayDimension : Integer ; |
2219 | Poles : in out Real ; |
2220 | InversionProblem : out Integer) ; |
2221 | ---Purpose: Performs the interpolation of the data given in |
2222 | -- the Poles array according to the requests in |
2223 | -- ContactOrderArray that is : if |
2224 | -- ContactOrderArray(i) has value d it means that |
2225 | -- Poles(i) containes the dth derivative of the |
2226 | -- function to be interpolated. The length L of the |
2227 | -- following arrays must be the same : |
2228 | -- Parameters, ContactOrderArray |
2229 | -- The length of FlatKnots is Degree + L + 1 |
2230 | -- The PolesArray is an seen as an |
2231 | -- Array[1..N][1..ArrayDimension] with N = tge length |
2232 | -- of the parameters array |
2233 | -- Warning: |
2234 | -- the method used to do that interpolation is |
2235 | -- gauss elimination WITHOUT pivoting. Thus if the |
2236 | -- diagonal is not dominant there is no guarantee |
2237 | -- that the algorithm will work. Nevertheless for |
2238 | -- Cubic interpolation or interpolation at Scheonberg |
2239 | -- points the method will work |
2240 | -- The InversionProblem will report 0 if there was no |
2241 | -- problem else it will give the index of the faulty |
2242 | -- pivot |
2243 | -- |
2244 | |
2245 | Interpolate(Degree : Integer ; |
2246 | FlatKnots : Array1OfReal from TColStd ; |
2247 | Parameters : Array1OfReal from TColStd ; |
2248 | ContactOrderArray : Array1OfInteger from TColStd ; |
2249 | ArrayDimension : Integer ; |
2250 | Poles : in out Real ; |
2251 | Weights : in out Real ; |
2252 | InversionProblem : out Integer) ; |
2253 | |
2254 | MovePoint(U : Real; -- parameter of the point |
2255 | Displ : Vec2d from gp; -- translation vector of the point |
2256 | Index1 : Integer; -- first movable pole |
2257 | Index2 : Integer; -- last movable pole |
2258 | Degree : Integer; |
2259 | Rational : Boolean; |
2260 | Poles : Array1OfPnt2d from TColgp; |
2261 | Weights : Array1OfReal from TColStd; |
2262 | FlatKnots : Array1OfReal from TColStd; |
2263 | FirstIndex : in out Integer; -- first pole modified |
2264 | LastIndex : in out Integer; -- last pole modified |
2265 | NewPoles : in out Array1OfPnt2d from TColgp); -- new poles |
2266 | ---Purpose: Find the new poles which allows an old point (with a |
2267 | -- given u as parameter) to reach a new position |
2268 | -- Index1 and Index2 indicate the range of poles we can move |
2269 | -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side |
2270 | -- don't enter (1,NbPoles) -> error: rigid move |
2271 | -- (2, NbPoles-1) -> the ends are enforced |
2272 | -- (3, NbPoles-2) -> the ends and the tangency are enforced |
2273 | -- if Problem in BSplineBasis calculation, no change for the curve |
2274 | -- and FirstIndex, LastIndex = 0 |
2275 | |
2276 | MovePoint(U : Real; -- parameter of the point |
2277 | Displ : Vec from gp; -- translation vector of the point |
2278 | Index1 : Integer; -- first movable pole |
2279 | Index2 : Integer; -- last movable pole |
2280 | Degree : Integer; |
2281 | Rational : Boolean; |
2282 | Poles : Array1OfPnt from TColgp; |
2283 | Weights : Array1OfReal from TColStd; |
2284 | FlatKnots : Array1OfReal from TColStd; |
2285 | FirstIndex : in out Integer; -- first pole modified |
2286 | LastIndex : in out Integer; -- last pole modified |
2287 | NewPoles : in out Array1OfPnt from TColgp); -- new poles |
2288 | ---Purpose: Find the new poles which allows an old point (with a |
2289 | -- given u as parameter) to reach a new position |
2290 | -- Index1 and Index2 indicate the range of poles we can move |
2291 | -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side |
2292 | -- don't enter (1,NbPoles) -> error: rigid move |
2293 | -- (2, NbPoles-1) -> the ends are enforced |
2294 | -- (3, NbPoles-2) -> the ends and the tangency are enforced |
2295 | -- if Problem in BSplineBasis calculation, no change for the curve |
2296 | -- and FirstIndex, LastIndex = 0 |
2297 | |
2298 | MovePointAndTangent(U : Real ; |
2299 | ArrayDimension : Integer ; |
2300 | Delta : in out Real ; |
2301 | DeltaDerivative : in out Real ; |
2302 | Tolerance : Real ; |
2303 | Degree : Integer ; |
2304 | Rational : Boolean ; |
2305 | StartingCondition : Integer ; |
2306 | EndingCondition : Integer ; |
2307 | Poles : in out Real ; |
2308 | Weights : Array1OfReal from TColStd; |
2309 | FlatKnots : Array1OfReal from TColStd; |
2310 | NewPoles : in out Real ; |
2311 | ErrorStatus : in out Integer) ; |
2312 | ---Purpose: This is the dimension free version of the utility |
2313 | -- U is the parameter must be within the first FlatKnots and the |
2314 | -- last FlatKnots Delta is the amount the curve has to be moved |
2315 | -- DeltaDerivative is the amount the derivative has to be moved. |
2316 | -- Delta and DeltaDerivative must be array of dimension |
2317 | -- ArrayDimension Degree is the degree of the BSpline and the |
2318 | -- FlatKnots are the knots of the BSpline Starting Condition if = |
2319 | -- -1 means the starting point of the curve can move |
2320 | -- = 0 means the |
2321 | -- starting point of the cuve cannot move but tangen starting |
2322 | -- point of the curve cannot move |
2323 | -- = 1 means the starting point and tangents cannot move |
2324 | -- = 2 means the starting point tangent and curvature cannot move |
2325 | -- = ... |
2326 | -- Same holds for EndingCondition |
2327 | -- Poles are the poles of the curve |
2328 | -- Weights are the weights of the curve if Rational = Standard_True |
2329 | -- NewPoles are the poles of the deformed curve |
2330 | -- ErrorStatus will be 0 if no error happened |
2331 | -- 1 if there are not enough knots/poles |
2332 | -- the imposed conditions |
2333 | -- The way to solve this problem is to add knots to the BSpline |
2334 | -- If StartCondition = 1 and EndCondition = 1 then you need at least |
2335 | -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need |
2336 | -- have at least 2 internal knots. |
2337 | |
2338 | MovePointAndTangent(U : Real ; |
2339 | Delta : Vec from gp ; |
2340 | DeltaDerivative : Vec from gp ; |
2341 | Tolerance : Real ; |
2342 | Degree : Integer ; |
2343 | Rational : Boolean ; |
2344 | StartingCondition : Integer ; |
2345 | EndingCondition : Integer ; |
2346 | Poles : Array1OfPnt from TColgp ; |
2347 | Weights : Array1OfReal from TColStd; |
2348 | FlatKnots : Array1OfReal from TColStd; |
2349 | NewPoles : in out Array1OfPnt from TColgp ; |
2350 | ErrorStatus : in out Integer) ; |
2351 | ---Purpose: This is the dimension free version of the utility |
2352 | -- U is the parameter must be within the first FlatKnots and the |
2353 | -- last FlatKnots Delta is the amount the curve has to be moved |
2354 | -- DeltaDerivative is the amount the derivative has to be moved. |
2355 | -- Delta and DeltaDerivative must be array of dimension |
2356 | -- ArrayDimension Degree is the degree of the BSpline and the |
2357 | -- FlatKnots are the knots of the BSpline Starting Condition if = |
2358 | -- -1 means the starting point of the curve can move |
2359 | -- = 0 means the |
2360 | -- starting point of the cuve cannot move but tangen starting |
2361 | -- point of the curve cannot move |
2362 | -- = 1 means the starting point and tangents cannot move |
2363 | -- = 2 means the starting point tangent and curvature cannot move |
2364 | -- = ... |
2365 | -- Same holds for EndingCondition |
2366 | -- Poles are the poles of the curve |
2367 | -- Weights are the weights of the curve if Rational = Standard_True |
2368 | -- NewPoles are the poles of the deformed curve |
2369 | -- ErrorStatus will be 0 if no error happened |
2370 | -- 1 if there are not enough knots/poles |
2371 | -- the imposed conditions |
2372 | -- The way to solve this problem is to add knots to the BSpline |
2373 | -- If StartCondition = 1 and EndCondition = 1 then you need at least |
2374 | -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need |
2375 | -- have at least 2 internal knots. |
2376 | |
2377 | MovePointAndTangent(U : Real ; |
2378 | Delta : Vec2d from gp ; |
2379 | DeltaDerivative : Vec2d from gp ; |
2380 | Tolerance : Real ; |
2381 | Degree : Integer ; |
2382 | Rational : Boolean ; |
2383 | StartingCondition : Integer ; |
2384 | EndingCondition : Integer ; |
2385 | Poles : Array1OfPnt2d from TColgp ; |
2386 | Weights : Array1OfReal from TColStd ; |
2387 | FlatKnots : Array1OfReal from TColStd ; |
2388 | NewPoles : in out Array1OfPnt2d from TColgp ; |
2389 | ErrorStatus : in out Integer) ; |
2390 | ---Purpose: This is the dimension free version of the utility |
2391 | -- U is the parameter must be within the first FlatKnots and the |
2392 | -- last FlatKnots Delta is the amount the curve has to be moved |
2393 | -- DeltaDerivative is the amount the derivative has to be moved. |
2394 | -- Delta and DeltaDerivative must be array of dimension |
2395 | -- ArrayDimension Degree is the degree of the BSpline and the |
2396 | -- FlatKnots are the knots of the BSpline Starting Condition if = |
2397 | -- -1 means the starting point of the curve can move |
2398 | -- = 0 means the |
2399 | -- starting point of the cuve cannot move but tangen starting |
2400 | -- point of the curve cannot move |
2401 | -- = 1 means the starting point and tangents cannot move |
2402 | -- = 2 means the starting point tangent and curvature cannot move |
2403 | -- = ... |
2404 | -- Same holds for EndingCondition |
2405 | -- Poles are the poles of the curve |
2406 | -- Weights are the weights of the curve if Rational = Standard_True |
2407 | -- NewPoles are the poles of the deformed curve |
2408 | -- ErrorStatus will be 0 if no error happened |
2409 | -- 1 if there are not enough knots/poles |
2410 | -- the imposed conditions |
2411 | -- The way to solve this problem is to add knots to the BSpline |
2412 | -- If StartCondition = 1 and EndCondition = 1 then you need at least |
2413 | -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need |
2414 | -- have at least 2 internal knots. |
2415 | |
2416 | Resolution( PolesArray : in out Real ; |
2417 | ArrayDimension : Integer ; |
2418 | NumPoles : Integer ; |
2419 | Weights : in Array1OfReal from TColStd; |
2420 | FlatKnots : in Array1OfReal from TColStd; |
2421 | Degree : in Integer; |
2422 | Tolerance3D : Real from Standard ; |
2423 | UTolerance : out Real from Standard) ; |
2424 | ---Purpose: |
2425 | -- given a tolerance in 3D space returns a |
2426 | -- tolerance in U parameter space such that |
2427 | -- all u1 and u0 in the domain of the curve f(u) |
2428 | -- | u1 - u0 | < UTolerance and |
2429 | -- we have |f (u1) - f (u0)| < Tolerance3D |
2430 | |
2431 | Resolution( Poles : in Array1OfPnt from TColgp ; |
2432 | Weights : in Array1OfReal from TColStd ; |
2433 | NumPoles : in Integer from Standard ; |
2434 | FlatKnots : in Array1OfReal from TColStd ; |
2435 | Degree : in Integer from Standard ; |
2436 | Tolerance3D : Real from Standard ; |
2437 | UTolerance : out Real from Standard) ; |
2438 | ---Purpose: |
2439 | -- given a tolerance in 3D space returns a |
2440 | -- tolerance in U parameter space such that |
2441 | -- all u1 and u0 in the domain of the curve f(u) |
2442 | -- | u1 - u0 | < UTolerance and |
2443 | -- we have |f (u1) - f (u0)| < Tolerance3D |
2444 | |
2445 | Resolution( Poles : in Array1OfPnt2d from TColgp ; |
2446 | Weights : in Array1OfReal from TColStd ; |
2447 | NumPoles : in Integer from Standard ; |
2448 | FlatKnots : in Array1OfReal from TColStd ; |
2449 | Degree : in Integer ; |
2450 | Tolerance3D : Real from Standard ; |
2451 | UTolerance : out Real from Standard) ; |
2452 | ---Purpose: |
2453 | -- given a tolerance in 3D space returns a |
2454 | -- tolerance in U parameter space such that |
2455 | -- all u1 and u0 in the domain of the curve f(u) |
2456 | -- | u1 - u0 | < UTolerance and |
2457 | -- we have |f (u1) - f (u0)| < Tolerance3D |
2458 | |
2459 | end BSplCLib; |
2460 | |