1 -- Created on: 1991-08-09
2 -- Created by: Jean Claude VAUTHIER
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 --Modified : RLE Aug 1993 Major modifications.
18 -- 15-Mar-95 xab : added cache mecanism to speed up
20 -- 25-Mar-95 xab : added Lagrange evaluator
21 -- mei : modified 08-Jun-95 : added method MovePoint
22 -- xab : modified 11-Mar-96 : added method MovePointAndTangent
23 -- xab : modified 18-Mar-97 : added method to reparameterise a bspline
24 -- jct : modified 15-Apr-97 : added method to extend a bspline
28 ---Purpose: BSplCLib B-spline curve Library.
30 -- The BSplCLib package is a basic library for BSplines. It
31 -- provides three categories of functions.
33 -- * Management methods to process knots and multiplicities.
35 -- * Multi-Dimensions spline methods. BSpline methods where
36 -- poles have an arbitrary number of dimensions. They divides
39 -- - Global methods modifying the whole set of poles. The
40 -- poles are described by an array of Reals and a
41 -- Dimension. Example : Inserting knots.
43 -- - Local methods computing points and derivatives. The
44 -- poles are described by a pointer on a local array of
45 -- Reals and a Dimension. The local array is modified.
47 -- * 2D and 3D spline curves methods.
49 -- Methods for 2d and 3d BSplines curves rational or not
52 -- Those methods have the following structure :
54 -- - They extract the pole informations in a working array.
56 -- - They process the working array with the
57 -- multi-dimension methods. (for example a 3d rational
58 -- curve is processed as a 4 dimension curve).
60 -- - They get back the result in the original dimension.
62 -- Note that the bspline surface methods found in the
63 -- package BSplSLib uses the same structure and rely on
66 -- In the following list of methods the 2d and 3d curve
67 -- methods will be described with the corresponding
68 -- multi-dimension method.
70 -- The 3d or 2d B-spline curve is defined with :
72 -- . its control points : TColgp_Array1OfPnt(2d) Poles
73 -- . its weights : TColStd_Array1OfReal Weights
74 -- . its knots : TColStd_Array1OfReal Knots
75 -- . its multiplicities : TColStd_Array1OfInteger Mults
76 -- . its degree : Standard_Integer Degree
77 -- . its periodicity : Standard_Boolean Periodic
80 -- The bounds of Poles and Weights should be the same.
81 -- The bounds of Knots and Mults should be the same.
83 -- Weights can be a null reference (BSplCLib::NoWeights())
84 -- the curve is non rational.
86 -- Mults can be a null reference (BSplCLib::NoMults())
87 -- the knots are "flat" knots.
90 -- B-spline curve, Functions, Library
93 -- . A survey of curves and surfaces methods in CADG Wolfgang
95 -- . On de Boor-like algorithms and blossoming Wolfgang BOEHM
97 -- . Blossoming and knot insertion algorithms for B-spline curves
99 -- . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA
100 -- . Curves and Surfaces for Computer Aided Geometric Design,
101 -- a practical guide Gerald Farin
103 uses TColStd, gp, TColgp, math, GeomAbs
108 imported EvaluatorFunction ;
110 enumeration KnotDistribution is NonUniform, Uniform;
111 ---Purpose: This enumeration describes the repartition of the
112 -- knots sequence. If all the knots differ by the
113 -- same positive constant from the preceding knot the
114 -- "KnotDistribution" is <Uniform> else it is
117 enumeration MultDistribution is NonConstant, Constant, QuasiConstant;
118 ---Purpose: This enumeration describes the form of the
119 -- sequence of mutiplicities. MultDistribution is :
121 -- Constant if all the multiplicities have the same
124 -- QuasiConstant if all the internal knots have the
125 -- same multiplicity and if the first and last knot
126 -- have a different multiplicity.
128 -- NonConstant in other cases.
130 -------------------------------------------------------------
131 -------------------------------------------------------------
132 ---------- ----------
133 ---------- Knots and Multiplicities ----------
134 ---------- ----------
135 -------------------------------------------------------------
136 -------------------------------------------------------------
138 Hunt (XX : in Array1OfReal from TColStd;
140 Iloc : in out Integer);
141 ---Purpose: This routine searches the position of the real
142 -- value X in the ordered set of real values XX.
144 -- The elements in the table XX are either
145 -- monotonically increasing or monotonically
148 -- The input value Iloc is used to initialize the
149 -- algorithm : if Iloc is outside of the bounds
150 -- [XX.Lower(), -- XX.Upper()] the bisection algorithm
151 -- is used else the routine searches from a previous
152 -- known position by increasing steps then converges
155 -- This routine is used to locate a knot value in a
158 ---References : Numerical Recipes in C (William H.Press, Brian
159 -- P. Flannery, Saul A. Teukolsky, William T.
162 FirstUKnotIndex (Degree : Integer;
163 Mults : Array1OfInteger from TColStd)
165 ---Purpose: Computes the index of the knots value which gives
166 -- the start point of the curve.
169 LastUKnotIndex (Degree : Integer;
170 Mults : Array1OfInteger from TColStd)
172 ---Purpose: Computes the index of the knots value which gives
173 -- the end point of the curve.
175 FlatIndex (Degree : Integer;
177 Mults : Array1OfInteger from TColStd;
180 ---Purpose: Computes the index of the flats knots sequence
181 -- corresponding to <Index> in the knots sequence
182 -- which multiplicities are <Mults>.
184 LocateParameter (Degree : Integer;
185 Knots : Array1OfReal from TColStd;
186 Mults : Array1OfInteger from TColStd;
188 IsPeriodic : Boolean;
191 KnotIndex : in out Integer;
193 ---Purpose: Locates the parametric value U in the knots
194 -- sequence between the knot K1 and the knot K2.
195 -- The value return in Index verifies.
197 -- Knots(Index) <= U < Knots(Index + 1)
198 -- if U <= Knots (K1) then Index = K1
199 -- if U >= Knots (K2) then Index = K2 - 1
201 -- If Periodic is True U may be modified to fit in
202 -- the range Knots(K1), Knots(K2). In any case the
203 -- correct value is returned in NewU.
205 -- Warnings :Index is used as input data to initialize the
206 -- searching function.
207 -- Warning: Knots have to be "withe repetitions"
209 LocateParameter (Degree : Integer;
210 Knots : Array1OfReal from TColStd;
212 IsPeriodic : Boolean;
215 KnotIndex : in out Integer;
217 ---Purpose: Locates the parametric value U in the knots
218 -- sequence between the knot K1 and the knot K2.
219 -- The value return in Index verifies.
221 -- Knots(Index) <= U < Knots(Index + 1)
222 -- if U <= Knots (K1) then Index = K1
223 -- if U >= Knots (K2) then Index = K2 - 1
225 -- If Periodic is True U may be modified to fit in
226 -- the range Knots(K1), Knots(K2). In any case the
227 -- correct value is returned in NewU.
229 -- Warnings :Index is used as input data to initialize the
230 -- searching function.
231 -- Warning: Knots have to be "flat"
233 LocateParameter (Knots : Array1OfReal from TColStd;
237 Index : in out Integer;
243 LocateParameter (Degree : Integer;
244 Knots : Array1OfReal from TColStd;
245 Mults : Array1OfInteger from TColStd;
248 Index : in out Integer;
252 MaxKnotMult (Mults : Array1OfInteger from TColStd;
255 ---Purpose: Finds the greatest multiplicity in a set of knots
256 -- between K1 and K2. Mults is the multiplicity
257 -- associated with each knot value.
259 MinKnotMult (Mults : Array1OfInteger from TColStd;
262 ---Purpose: Finds the lowest multiplicity in a set of knots
263 -- between K1 and K2. Mults is the multiplicity
264 -- associated with each knot value.
266 NbPoles(Degree : Integer;
268 Mults : Array1OfInteger from TColStd)
270 ---Purpose: Returns the number of poles of the curve. Returns 0 if
271 -- one of the multiplicities is incorrect.
275 -- * Greater than Degree, or Degree+1 at the first and
276 -- last knot of a non periodic curve.
278 -- * The last periodicity on a periodic curve is not
279 -- equal to the first.
281 KnotSequenceLength(Mults : Array1OfInteger from TColStd;
285 ---Purpose: Returns the length of the sequence of knots with
290 -- Sum(Mults(i), i = Mults.Lower(); i <= Mults.Upper());
294 -- Sum(Mults(i); i = Mults.Lower(); i < Mults.Upper())
297 KnotSequence (Knots : Array1OfReal from TColStd;
298 Mults : Array1OfInteger from TColStd;
299 KnotSeq : in out Array1OfReal from TColStd;
300 Periodic : Boolean = Standard_False);
302 KnotSequence (Knots : Array1OfReal from TColStd;
303 Mults : Array1OfInteger from TColStd;
306 KnotSeq : in out Array1OfReal from TColStd);
307 ---Purpose: Computes the sequence of knots KnotSeq with
308 -- repetition of the knots of multiplicity greater
311 -- Length of KnotSeq must be KnotSequenceLength(Mults,Degree,Periodic)
313 KnotsLength( KnotSeq : Array1OfReal from TColStd;
314 Periodic : Boolean = Standard_False)
316 ---Purpose: Returns the length of the sequence of knots (and
317 -- Mults) without repetition.
319 Knots( KnotSeq : Array1OfReal from TColStd;
320 Knots : out Array1OfReal from TColStd;
321 Mults : out Array1OfInteger from TColStd;
322 Periodic : Boolean = Standard_False);
323 ---Purpose: Computes the sequence of knots Knots without
324 -- repetition of the knots of multiplicity greater
327 -- Length of <Knots> and <Mults> must be
328 -- KnotsLength(KnotSequence,Periodic)
330 KnotForm (Knots : Array1OfReal from TColStd;
331 FromK1, ToK2 : Integer)
332 returns KnotDistribution;
333 ---Purpose: Analyses if the knots distribution is "Uniform"
334 -- or "NonUniform" between the knot FromK1 and the
335 -- knot ToK2. There is no repetition of knot in the
336 -- knots'sequence <Knots>.
338 MultForm (Mults : Array1OfInteger from TColStd;
339 FromK1, ToK2 : Integer)
340 returns MultDistribution;
342 -- Analyses the distribution of multiplicities between
343 -- the knot FromK1 and the Knot ToK2.
345 KnotAnalysis (Degree : Integer;
347 CKnots : Array1OfReal from TColStd;
348 CMults : Array1OfInteger from TColStd;
349 KnotForm : out BSplKnotDistribution from GeomAbs;
350 MaxKnotMult: out Integer);
351 ---Purpose: Analyzes the array of knots.
352 -- Returns the form and the maximum knot multiplicity.
354 Reparametrize (U1, U2 : Real;
355 Knots : in out Array1OfReal from TColStd);
357 -- Reparametrizes a B-spline curve to [U1, U2].
358 -- The knot values are recomputed such that Knots (Lower) = U1
359 -- and Knots (Upper) = U2 but the knot form is not modified.
361 -- In the array Knots the values must be in ascending order.
362 -- U1 must not be equal to U2 to avoid division by zero.
365 Reverse (Knots : in out Array1OfReal from TColStd);
366 ---Purpose: Reverses the array knots to become the knots
367 -- sequence of the reversed curve.
369 Reverse (Mults : in out Array1OfInteger from TColStd);
370 ---Purpose: Reverses the array of multiplicities.
372 Reverse (Poles : in out Array1OfPnt from TColgp;
374 ---Purpose: Reverses the array of poles. Last is the index of
375 -- the new first pole. On a non periodic curve last
376 -- is Poles.Upper(). On a periodic curve last is
378 -- (number of flat knots - degree - 1)
382 -- (sum of multiplicities(but for the last) + degree
385 Reverse (Poles : in out Array1OfPnt2d from TColgp;
387 ---Purpose: Reverses the array of poles.
389 Reverse (Weights : in out Array1OfReal from TColStd;
391 ---Purpose: Reverses the array of poles.
393 IsRational(Weights : Array1OfReal from TColStd;
395 Epsilon : Real = 0.0) returns Boolean;
397 -- Returns False if all the weights of the array <Weights>
398 -- between I1 an I2 are identic. Epsilon is used for
399 -- comparing weights. If Epsilon is 0. the Epsilon of the
400 -- first weight is used.
402 MaxDegree returns Integer;
403 ---Purpose: returns the degree maxima for a BSplineCurve.
410 Poles : in out Real);
411 ---Purpose: Perform the Boor algorithm to evaluate a point at
412 -- parameter <U>, with <Degree> and <Dimension>.
414 -- Poles is an array of Reals of size
416 -- <Dimension> * <Degree>+1
418 -- Containing the poles. At the end <Poles> contains
419 -- the current point.
428 ---Purpose: Performs the Boor Algorithm at parameter <U> with
429 -- the given <Degree> and the array of <Knots> on the
430 -- poles <Poles> of dimension <Dimension>. The schema
431 -- is computed until level <Depth> on a basis of
434 -- * Knots is an array of reals of length :
436 -- <Length> + <Degree>
438 -- * Poles is an array of reals of length :
440 -- (2 * <Length> + 1) * <Dimension>
442 -- The poles values must be set in the array at the
455 -- The results are found in the array poles depending
456 -- on the Depth. (See the method GetPole).
458 AntiBoorScheme(U : Real;
465 Tolerance : Real) returns Boolean;
466 ---Purpose: Compute the content of Pole before the BoorScheme.
467 -- This method is used to remove poles.
469 -- U is the poles to remove, Knots should contains the
470 -- knots of the curve after knot removal.
472 -- The first and last poles do not change, the other
473 -- poles are computed by averaging two possible values.
474 -- The distance between the two possible poles is
475 -- computed, if it is higher than <Tolerance> False is
478 Derivative(Degree : Integer;
483 Poles : in out Real);
484 ---Purpose: Computes the poles of the BSpline giving the
485 -- derivatives of order <Order>.
487 -- The formula for the first order is
489 -- Pole(i) = Degree * (Pole(i+1) - Pole(i)) /
490 -- (Knots(i+Degree+1) - Knots(i+1))
492 -- This formula is repeated (Degree is decremented at
500 Poles : in out Real);
501 ---Purpose: Performs the Bohm Algorithm at parameter <U>. This
502 -- algorithm computes the value and all the derivatives
503 -- up to order N (N <= Degree).
505 -- <Poles> is the original array of poles.
507 -- The result in <Poles> is the value and the
508 -- derivatives. Poles[0] is the value, Poles[Degree]
509 -- is the last derivative.
512 NoWeights returns Array1OfReal from TColStd;
513 ---Purpose: Used as argument for a non rational curve.
518 NoMults returns Array1OfInteger from TColStd;
519 ---Purpose: Used as argument for a flatknots evaluation.
524 BuildKnots(Degree, Index : Integer;
526 Knots : Array1OfReal from TColStd;
527 Mults : Array1OfInteger from TColStd;
529 ---Purpose: Stores in LK the usefull knots for the BoorSchem
530 -- on the span Knots(Index) - Knots(Index+1)
532 PoleIndex (Degree, Index : Integer;
534 Mults : Array1OfInteger from TColStd)
536 ---Purpose: Return the index of the first Pole to use on the
537 -- span Mults(Index) - Mults(Index+1). This index
538 -- must be added to Poles.Lower().
540 BuildEval(Degree,Index : Integer;
541 Poles : Array1OfReal from TColStd;
542 Weights : Array1OfReal from TColStd;
545 BuildEval(Degree,Index : Integer;
546 Poles : Array1OfPnt from TColgp;
547 Weights : Array1OfReal from TColStd;
550 BuildEval(Degree,Index : Integer;
551 Poles : Array1OfPnt2d from TColgp;
552 Weights : Array1OfReal from TColStd;
554 ---Purpose: Copy in <LP> the poles and weights for the Eval
555 -- scheme. starting from Poles(Poles.Lower()+Index)
557 BuildBoor(Index,Length,Dimension : Integer;
558 Poles : Array1OfReal from TColStd;
560 ---Purpose: Copy in <LP> poles for <Dimension> Boor scheme.
561 -- Starting from <Index> * <Dimension>, copy
565 BoorIndex(Index, Length, Depth : Integer)
567 ---Purpose: Returns the index in the Boor result array of the
568 -- poles <Index>. If the Boor algorithm was perform
569 -- with <Length> and <Depth>.
571 GetPole(Index,Length,Depth,Dimension : Integer;
572 LocPoles : in out Real;
573 Position : in out Integer;
574 Pole : in out Array1OfReal from TColStd);
575 ---Purpose: Copy the pole at position <Index> in the Boor
576 -- scheme of dimension <Dimension> to <Position> in
577 -- the array <Pole>. <Position> is updated.
581 Periodic : in Boolean;
582 Knots : in Array1OfReal from TColStd;
583 Mults : in Array1OfInteger from TColStd;
584 AddKnots : in Array1OfReal from TColStd;
585 AddMults : in Array1OfInteger from TColStd;
586 NbPoles : out Integer;
587 NbKnots : out Integer;
589 Add : in Boolean = Standard_True)
591 ---Purpose: Returns in <NbPoles, NbKnots> the new number of poles
592 -- and knots if the sequence of knots <AddKnots,
593 -- AddMults> is inserted in the sequence <Knots, Mults>.
595 -- Epsilon is used to compare knots for equality.
597 -- If Add is True the multiplicities on equal knots are
600 -- If Add is False the max value of the multiplicities is
604 -- The knew knots are knot increasing.
605 -- The new knots are not in the range.
609 Periodic : in Boolean;
610 Dimension : in Integer;
611 Poles : in Array1OfReal from TColStd;
612 Knots : in Array1OfReal from TColStd;
613 Mults : in Array1OfInteger from TColStd;
614 AddKnots : in Array1OfReal from TColStd;
615 AddMults : in Array1OfInteger from TColStd;
616 NewPoles : out Array1OfReal from TColStd;
617 NewKnots : out Array1OfReal from TColStd;
618 NewMults : out Array1OfInteger from TColStd;
620 Add : in Boolean = Standard_True);
624 Periodic : in Boolean;
625 Poles : in Array1OfPnt from TColgp;
626 Weights : in Array1OfReal from TColStd;
627 Knots : in Array1OfReal from TColStd;
628 Mults : in Array1OfInteger from TColStd;
629 AddKnots : in Array1OfReal from TColStd;
630 AddMults : in Array1OfInteger from TColStd;
631 NewPoles : out Array1OfPnt from TColgp;
632 NewWeights : out Array1OfReal from TColStd;
633 NewKnots : out Array1OfReal from TColStd;
634 NewMults : out Array1OfInteger from TColStd;
636 Add : in Boolean = Standard_True);
640 Periodic : in Boolean;
641 Poles : in Array1OfPnt2d from TColgp;
642 Weights : in Array1OfReal from TColStd;
643 Knots : in Array1OfReal from TColStd;
644 Mults : in Array1OfInteger from TColStd;
645 AddKnots : in Array1OfReal from TColStd;
646 AddMults : in Array1OfInteger from TColStd;
647 NewPoles : out Array1OfPnt2d from TColgp;
648 NewWeights : out Array1OfReal from TColStd;
649 NewKnots : out Array1OfReal from TColStd;
650 NewMults : out Array1OfInteger from TColStd;
652 Add : in Boolean = Standard_True);
653 ---Purpose: Insert a sequence of knots <AddKnots> with
654 -- multiplicities <AddMults>. <AddKnots> must be a non
655 -- decreasing sequence and verifies :
657 -- Knots(Knots.Lower()) <= AddKnots(AddKnots.Lower())
658 -- Knots(Knots.Upper()) >= AddKnots(AddKnots.Upper())
660 -- The NewPoles and NewWeights arrays must have a length :
661 -- Poles.Length() + Sum(AddMults())
663 -- When a knot to insert is identic to an existing knot the
664 -- multiplicities are added.
666 -- Epsilon is used to test knots for equality.
668 -- When AddMult is negative or null the knot is not inserted.
669 -- No multiplicity will becomes higher than the degree.
671 -- The new Knots and Multiplicities are copied in <NewKnots>
674 -- All the New arrays should be correctly dimensioned.
676 -- When all the new knots are existing knots, i.e. only the
677 -- multiplicities will change it is safe to use the same
678 -- arrays as input and output.
685 Periodic : in Boolean;
686 Poles : in Array1OfPnt from TColgp;
687 Weights : in Array1OfReal from TColStd;
688 Knots : in Array1OfReal from TColStd;
689 Mults : in Array1OfInteger from TColStd;
690 NewPoles : out Array1OfPnt from TColgp;
691 NewWeights : out Array1OfReal from TColStd);
698 Periodic : in Boolean;
699 Poles : in Array1OfPnt2d from TColgp;
700 Weights : in Array1OfReal from TColStd;
701 Knots : in Array1OfReal from TColStd;
702 Mults : in Array1OfInteger from TColStd;
703 NewPoles : out Array1OfPnt2d from TColgp;
704 NewWeights : out Array1OfReal from TColStd);
705 ---Purpose: Insert a new knot U of multiplicity UMult in the
708 -- The location of the new Knot should be given as an input
709 -- data. UIndex locates the new knot U in the knot sequence
710 -- and Knots (UIndex) < U < Knots (UIndex + 1).
712 -- The new control points corresponding to this insertion are
713 -- returned. Knots and Mults are not updated.
716 KnotIndex : in Integer;
719 Periodic : in Boolean;
720 Poles : in Array1OfPnt from TColgp;
721 Weights : in Array1OfReal from TColStd;
722 Knots : in Array1OfReal from TColStd;
723 Mults : in Array1OfInteger from TColStd;
724 NewPoles : out Array1OfPnt from TColgp;
725 NewWeights : out Array1OfReal from TColStd);
728 KnotIndex : in Integer;
731 Periodic : in Boolean;
732 Poles : in Array1OfPnt2d from TColgp;
733 Weights : in Array1OfReal from TColStd;
734 Knots : in Array1OfReal from TColStd;
735 Mults : in Array1OfInteger from TColStd;
736 NewPoles : out Array1OfPnt2d from TColgp;
737 NewWeights : out Array1OfReal from TColStd);
738 ---Purpose: Raise the multiplicity of knot to <UMult>.
740 -- The new control points are returned. Knots and Mults are
747 Periodic : in Boolean;
748 Dimension : in Integer;
749 Poles : in Array1OfReal from TColStd;
750 Knots : in Array1OfReal from TColStd;
751 Mults : in Array1OfInteger from TColStd;
752 NewPoles : out Array1OfReal from TColStd;
753 NewKnots : out Array1OfReal from TColStd;
754 NewMults : out Array1OfInteger from TColStd;
755 Tolerance : Real) returns Boolean;
761 Periodic : in Boolean;
762 Poles : in Array1OfPnt from TColgp;
763 Weights : in Array1OfReal from TColStd;
764 Knots : in Array1OfReal from TColStd;
765 Mults : in Array1OfInteger from TColStd;
766 NewPoles : out Array1OfPnt from TColgp;
767 NewWeights : out Array1OfReal from TColStd;
768 NewKnots : out Array1OfReal from TColStd;
769 NewMults : out Array1OfInteger from TColStd;
770 Tolerance : Real) returns Boolean;
776 Periodic : in Boolean;
777 Poles : in Array1OfPnt2d from TColgp;
778 Weights : in Array1OfReal from TColStd;
779 Knots : in Array1OfReal from TColStd;
780 Mults : in Array1OfInteger from TColStd;
781 NewPoles : out Array1OfPnt2d from TColgp;
782 NewWeights : out Array1OfReal from TColStd;
783 NewKnots : out Array1OfReal from TColStd;
784 NewMults : out Array1OfInteger from TColStd;
785 Tolerance : Real) returns Boolean;
786 ---Purpose: Decrement the multiplicity of <Knots(Index)>
787 -- to <Mult>. If <Mult> is null the knot is
790 -- As there are two ways to compute the new poles
791 -- the midlle will be used as long as the
792 -- distance is lower than Tolerance.
794 -- If a distance is bigger than tolerance the
795 -- methods returns False and the new arrays are
798 -- A low tolerance can be used to test if the
799 -- knot can be removed without modifying the
802 -- A high tolerance can be used to "smooth" the
806 IncreaseDegreeCountKnots (Degree, NewDegree : Integer;
808 Mults : Array1OfInteger from TColStd)
810 ---Purpose: Returns the number of knots of a curve with
811 -- multiplicities <Mults> after elevating the degree from
812 -- <Degree> to <NewDegree>. See the IncreaseDegree method
813 -- for more comments.
815 IncreaseDegree (Degree,
816 NewDegree : in Integer;
817 Periodic : in Boolean;
818 Dimension : in Integer;
819 Poles : in Array1OfReal from TColStd;
820 Knots : in Array1OfReal from TColStd;
821 Mults : in Array1OfInteger from TColStd;
822 NewPoles : in out Array1OfReal from TColStd;
823 NewKnots : in out Array1OfReal from TColStd;
824 NewMults : in out Array1OfInteger from TColStd);
826 IncreaseDegree (Degree,
827 NewDegree : in Integer;
828 Periodic : in Boolean;
829 Poles : in Array1OfPnt from TColgp;
830 Weights : in Array1OfReal from TColStd;
831 Knots : in Array1OfReal from TColStd;
832 Mults : in Array1OfInteger from TColStd;
833 NewPoles : in out Array1OfPnt from TColgp;
834 NewWeights : in out Array1OfReal from TColStd;
835 NewKnots : in out Array1OfReal from TColStd;
836 NewMults : in out Array1OfInteger from TColStd);
838 IncreaseDegree (Degree,
839 NewDegree : in Integer;
840 Periodic : in Boolean;
841 Poles : in Array1OfPnt2d from TColgp;
842 Weights : in Array1OfReal from TColStd;
843 Knots : in Array1OfReal from TColStd;
844 Mults : in Array1OfInteger from TColStd;
845 NewPoles : in out Array1OfPnt2d from TColgp;
846 NewWeights : in out Array1OfReal from TColStd;
847 NewKnots : in out Array1OfReal from TColStd;
848 NewMults : in out Array1OfInteger from TColStd);
851 IncreaseDegree (NewDegree : in Integer;
852 Poles : in Array1OfPnt from TColgp;
853 Weights : in Array1OfReal from TColStd;
854 NewPoles : in out Array1OfPnt from TColgp;
855 NewWeights : in out Array1OfReal from TColStd);
856 ---Warning: To be used for Beziercurves ONLY!!!
858 IncreaseDegree (NewDegree : in Integer;
859 Poles : in Array1OfPnt2d from TColgp;
860 Weights : in Array1OfReal from TColStd;
861 NewPoles : in out Array1OfPnt2d from TColgp;
862 NewWeights : in out Array1OfReal from TColStd);
863 ---Purpose: Increase the degree of a bspline (or bezier) curve
864 -- of dimension <Dimension> form <Degree> to
867 -- The number of poles in the new curve is :
869 -- Poles.Length() + (NewDegree - Degree) * Number of spans
871 -- Where the number of spans is :
873 -- LastUKnotIndex(Mults) - FirstUKnotIndex(Mults) + 1
875 -- for a non-periodic curve
877 -- And Knots.Length() - 1 for a periodic curve.
879 -- The multiplicities of all knots are increased by
880 -- the degree elevation.
882 -- The new knots are usually the same knots with the
883 -- exception of a non-periodic curve with the first
884 -- and last multiplicity not equal to Degree+1 where
885 -- knots are removed form the start and the bottom
886 -- untils the sum of the multiplicities is equal to
887 -- NewDegree+1 at the knots corresponding to the
888 -- first and last parameters of the curve.
890 -- Example : Suppose a curve of degree 3 starting
891 -- with following knots and multiplicities :
896 -- The FirstUKnot is 2. because the sum of
897 -- multiplicities is Degree+1 : 1 + 2 + 1 = 4 = 3 + 1
899 -- i.e. the first parameter of the curve is 2. and
900 -- will still be 2. after degree elevation. Let
901 -- raises this curve to degree 4. The multiplicities
902 -- are increased by 2.
904 -- They become 2 3 2. But we need a sum of
905 -- multiplicities of 5 at knot 2. So the first knot
906 -- is removed and the new knots are :
911 -- The multipicity of the first knot may also be
912 -- reduced if the sum is still to big.
914 -- In the most common situations (periodic curve or
915 -- curve with first and last multiplicities equals to
916 -- Degree+1) the knots are knot changes.
918 -- The method IncreaseDegreeCountKnots can be used to
919 -- compute the new number of knots.\
921 ---Warning: To be used for Beziercurves ONLY!!!
923 PrepareUnperiodize (Degree : in Integer from Standard;
924 Mults : in Array1OfInteger from TColStd;
925 NbKnots : out Integer from Standard;
926 NbPoles : out Integer from Standard);
927 ---Purpose: Set in <NbKnots> and <NbPolesToAdd> the number of Knots and
928 -- Poles of the NotPeriodic Curve identical at the
929 -- periodic curve with a degree <Degree> , a
930 -- knots-distribution with Multiplicities <Mults>.
932 Unperiodize (Degree : in Integer from Standard;
933 Dimension : in Integer from Standard;
934 Mults : in Array1OfInteger from TColStd;
935 Knots : in Array1OfReal from TColStd;
936 Poles : in Array1OfReal from TColStd;
937 NewMults : out Array1OfInteger from TColStd;
938 NewKnots : out Array1OfReal from TColStd;
939 NewPoles : out Array1OfReal from TColStd);
941 Unperiodize (Degree : in Integer from Standard;
942 Mults : in Array1OfInteger from TColStd;
943 Knots : in Array1OfReal from TColStd;
944 Poles : in Array1OfPnt from TColgp;
945 Weights : in Array1OfReal from TColStd;
946 NewMults : out Array1OfInteger from TColStd;
947 NewKnots : out Array1OfReal from TColStd;
948 NewPoles : out Array1OfPnt from TColgp;
949 NewWeights: out Array1OfReal from TColStd);
951 Unperiodize (Degree : in Integer from Standard;
952 Mults : in Array1OfInteger from TColStd;
953 Knots : in Array1OfReal from TColStd;
954 Poles : in Array1OfPnt2d from TColgp;
955 Weights : in Array1OfReal from TColStd;
956 NewMults : out Array1OfInteger from TColStd;
957 NewKnots : out Array1OfReal from TColStd;
958 NewPoles : out Array1OfPnt2d from TColgp;
959 NewWeights: out Array1OfReal from TColStd);
962 PrepareTrimming (Degree : in Integer from Standard;
963 Periodic: in Boolean from Standard;
964 Knots : in Array1OfReal from TColStd;
965 Mults : in Array1OfInteger from TColStd;
966 U1 : in Real from Standard;
967 U2 : in Real from Standard;
968 NbKnots : out Integer from Standard;
969 NbPoles : out Integer from Standard);
970 ---Purpose: Set in <NbKnots> and <NbPoles> the number of Knots and
971 -- Poles of the curve resulting of the trimming of the
972 -- BSplinecurve definded with <degree>, <knots>, <mults>
974 Trimming (Degree : in Integer from Standard;
975 Periodic : in Boolean from Standard;
976 Dimension : in Integer from Standard;
977 Knots : in Array1OfReal from TColStd;
978 Mults : in Array1OfInteger from TColStd;
979 Poles : in Array1OfReal from TColStd;
980 U1 : in Real from Standard;
981 U2 : in Real from Standard;
982 NewKnots : out Array1OfReal from TColStd;
983 NewMults : out Array1OfInteger from TColStd;
984 NewPoles : out Array1OfReal from TColStd);
987 Trimming (Degree : in Integer from Standard;
988 Periodic : in Boolean from Standard;
989 Knots : in Array1OfReal from TColStd;
990 Mults : in Array1OfInteger from TColStd;
991 Poles : in Array1OfPnt from TColgp;
992 Weights : in Array1OfReal from TColStd;
993 U1 : in Real from Standard;
994 U2 : in Real from Standard;
995 NewKnots : out Array1OfReal from TColStd;
996 NewMults : out Array1OfInteger from TColStd;
997 NewPoles : out Array1OfPnt from TColgp;
998 NewWeights : out Array1OfReal from TColStd);
1001 Trimming (Degree : in Integer from Standard;
1002 Periodic : in Boolean from Standard;
1003 Knots : in Array1OfReal from TColStd;
1004 Mults : in Array1OfInteger from TColStd;
1005 Poles : in Array1OfPnt2d from TColgp;
1006 Weights : in Array1OfReal from TColStd;
1007 U1 : in Real from Standard;
1008 U2 : in Real from Standard;
1009 NewKnots : out Array1OfReal from TColStd;
1010 NewMults : out Array1OfInteger from TColStd;
1011 NewPoles : out Array1OfPnt2d from TColgp;
1012 NewWeights : out Array1OfReal from TColStd);
1018 -------------------------------------------------------------
1019 -------------------------------------------------------------
1020 ---------- ----------
1021 ---------- Curve Evaluations ----------
1022 ---------- ----------
1023 -------------------------------------------------------------
1024 -------------------------------------------------------------
1028 Degree : in Integer;
1029 Periodic : in Boolean;
1030 Poles : in Array1OfReal from TColStd;
1031 Weights : in Array1OfReal from TColStd;
1032 Knots : in Array1OfReal from TColStd;
1033 Mults : in Array1OfInteger from TColStd;
1038 Degree : in Integer;
1039 Periodic : in Boolean;
1040 Poles : in Array1OfPnt from TColgp;
1041 Weights : in Array1OfReal from TColStd;
1042 Knots : in Array1OfReal from TColStd;
1043 Mults : in Array1OfInteger from TColStd;
1044 P : out Pnt from gp);
1047 UIndex : in Integer;
1048 Degree : in Integer;
1049 Periodic : in Boolean;
1050 Poles : in Array1OfPnt2d from TColgp;
1051 Weights : in Array1OfReal from TColStd;
1052 Knots : in Array1OfReal from TColStd;
1053 Mults : in Array1OfInteger from TColStd;
1054 P : out Pnt2d from gp);
1057 Poles : in Array1OfPnt from TColgp;
1058 Weights : in Array1OfReal from TColStd;
1059 P : out Pnt from gp);
1060 ---Warning: To be used for Beziercurves ONLY!!!
1063 Poles : in Array1OfPnt2d from TColgp;
1064 Weights : in Array1OfReal from TColStd;
1065 P : out Pnt2d from gp);
1066 ---Warning: To be used for Beziercurves ONLY!!!
1070 Degree : in Integer;
1071 Periodic : in Boolean;
1072 Poles : in Array1OfReal from TColStd;
1073 Weights : in Array1OfReal from TColStd;
1074 Knots : in Array1OfReal from TColStd;
1075 Mults : in Array1OfInteger from TColStd;
1081 Degree : in Integer;
1082 Periodic : in Boolean;
1083 Poles : in Array1OfPnt from TColgp;
1084 Weights : in Array1OfReal from TColStd;
1085 Knots : in Array1OfReal from TColStd;
1086 Mults : in Array1OfInteger from TColStd;
1087 P : out Pnt from gp;
1088 V : out Vec from gp);
1091 UIndex : in Integer;
1092 Degree : in Integer;
1093 Periodic : in Boolean;
1094 Poles : in Array1OfPnt2d from TColgp;
1095 Weights : in Array1OfReal from TColStd;
1096 Knots : in Array1OfReal from TColStd;
1097 Mults : in Array1OfInteger from TColStd;
1098 P : out Pnt2d from gp;
1099 V : out Vec2d from gp);
1102 Poles : in Array1OfPnt from TColgp;
1103 Weights : in Array1OfReal from TColStd;
1104 P : out Pnt from gp;
1105 V : out Vec from gp);
1106 ---Warning: To be used for Beziercurves ONLY!!!
1109 Poles : in Array1OfPnt2d from TColgp;
1110 Weights : in Array1OfReal from TColStd;
1111 P : out Pnt2d from gp;
1112 V : out Vec2d from gp);
1113 ---Warning: To be used for Beziercurves ONLY!!!
1117 Degree : in Integer;
1118 Periodic : in Boolean;
1119 Poles : in Array1OfReal from TColStd;
1120 Weights : in Array1OfReal from TColStd;
1121 Knots : in Array1OfReal from TColStd;
1122 Mults : in Array1OfInteger from TColStd;
1128 Degree : in Integer;
1129 Periodic : in Boolean;
1130 Poles : in Array1OfPnt from TColgp;
1131 Weights : in Array1OfReal from TColStd;
1132 Knots : in Array1OfReal from TColStd;
1133 Mults : in Array1OfInteger from TColStd;
1134 P : out Pnt from gp;
1135 V1,V2 : out Vec from gp);
1138 UIndex : in Integer;
1139 Degree : in Integer;
1140 Periodic : in Boolean;
1141 Poles : in Array1OfPnt2d from TColgp;
1142 Weights : in Array1OfReal from TColStd;
1143 Knots : in Array1OfReal from TColStd;
1144 Mults : in Array1OfInteger from TColStd;
1145 P : out Pnt2d from gp;
1146 V1,V2 : out Vec2d from gp);
1149 Poles : in Array1OfPnt from TColgp;
1150 Weights : in Array1OfReal from TColStd;
1151 P : out Pnt from gp;
1152 V1,V2 : out Vec from gp);
1153 ---Warning: To be used for Beziercurves ONLY!!!
1156 Poles : in Array1OfPnt2d from TColgp;
1157 Weights : in Array1OfReal from TColStd;
1158 P : out Pnt2d from gp;
1159 V1,V2 : out Vec2d from gp);
1160 ---Warning: To be used for Beziercurves ONLY!!!
1164 Degree : in Integer;
1165 Periodic : in Boolean;
1166 Poles : in Array1OfReal from TColStd;
1167 Weights : in Array1OfReal from TColStd;
1168 Knots : in Array1OfReal from TColStd;
1169 Mults : in Array1OfInteger from TColStd;
1171 V1,V2,V3 : out Real);
1175 Degree : in Integer;
1176 Periodic : in Boolean;
1177 Poles : in Array1OfPnt from TColgp;
1178 Weights : in Array1OfReal from TColStd;
1179 Knots : in Array1OfReal from TColStd;
1180 Mults : in Array1OfInteger from TColStd;
1181 P : out Pnt from gp;
1182 V1,V2,V3 : out Vec from gp);
1185 UIndex : in Integer;
1186 Degree : in Integer;
1187 Periodic : in Boolean;
1188 Poles : in Array1OfPnt2d from TColgp;
1189 Weights : in Array1OfReal from TColStd;
1190 Knots : in Array1OfReal from TColStd;
1191 Mults : in Array1OfInteger from TColStd;
1192 P : out Pnt2d from gp;
1193 V1,V2,V3 : out Vec2d from gp);
1196 Poles : in Array1OfPnt from TColgp;
1197 Weights : in Array1OfReal from TColStd;
1198 P : out Pnt from gp;
1199 V1,V2,V3 : out Vec from gp);
1200 ---Warning: To be used for Beziercurves ONLY!!!
1203 Poles : in Array1OfPnt2d from TColgp;
1204 Weights : in Array1OfReal from TColStd;
1205 P : out Pnt2d from gp;
1206 V1,V2,V3 : out Vec2d from gp);
1207 ---Warning: To be used for Beziercurves ONLY!!!
1212 Degree : in Integer;
1213 Periodic : in Boolean;
1214 Poles : in Array1OfReal from TColStd;
1215 Weights : in Array1OfReal from TColStd;
1216 Knots : in Array1OfReal from TColStd;
1217 Mults : in Array1OfInteger from TColStd;
1223 Degree : in Integer;
1224 Periodic : in Boolean;
1225 Poles : in Array1OfPnt from TColgp;
1226 Weights : in Array1OfReal from TColStd;
1227 Knots : in Array1OfReal from TColStd;
1228 Mults : in Array1OfInteger from TColStd;
1229 VN : out Vec from gp);
1233 UIndex : in Integer;
1234 Degree : in Integer;
1235 Periodic : in Boolean;
1236 Poles : in Array1OfPnt2d from TColgp;
1237 Weights : in Array1OfReal from TColStd;
1238 Knots : in Array1OfReal from TColStd;
1239 Mults : in Array1OfInteger from TColStd;
1240 V : out Vec2d from gp);
1244 Poles : in Array1OfPnt from TColgp;
1245 Weights : in Array1OfReal from TColStd;
1246 P : out Pnt from gp;
1247 VN : out Vec from gp);
1248 ---Warning: To be used for Beziercurves ONLY!!!
1252 Poles : in Array1OfPnt2d from TColgp;
1253 Weights : in Array1OfReal from TColStd;
1254 P : out Pnt2d from gp;
1255 VN : out Vec2d from gp);
1256 ---Purpose: The above functions compute values and
1257 -- derivatives in the following situations :
1261 -- * Rational or not Rational.
1263 -- * Knots and multiplicities or "flat knots" without
1266 -- * The <Index> is the the localization of the
1267 -- parameter in the knot sequence. If <Index> is out
1268 -- of range the correct value will be searched.
1271 -- VERY IMPORTANT!!!
1272 -- USE BSplCLib::NoWeights() as Weights argument for non
1273 -- rational curves computations.
1274 ---Warning: To be used for Beziercurves ONLY!!!
1276 EvalBsplineBasis(Side : in Integer ;
1277 DerivativeOrder : in Integer ;
1278 Order : in Integer ;
1279 FlatKnots : Array1OfReal from TColStd ;
1280 Parameter : in Real ;
1281 FirstNonZeroBsplineIndex : in out Integer ;
1282 BsplineBasis : in out Matrix from math ;
1283 isPeriodic : in Boolean = Standard_False)
1286 ---Purpose: This evaluates the Bspline Basis at a
1287 -- given parameter Parameter up to the
1288 -- requested DerivativeOrder and store the
1289 -- result in the array BsplineBasis in the
1290 -- following fashion
1291 -- BSplineBasis(1,1) =
1292 -- value of first non vanishing
1293 -- Bspline function which has Index FirstNonZeroBsplineIndex
1294 -- BsplineBasis(1,2) =
1295 -- value of second non vanishing
1296 -- Bspline function which has Index
1297 -- FirstNonZeroBsplineIndex + 1
1298 -- BsplineBasis(1,n) =
1299 -- value of second non vanishing non vanishing
1300 -- Bspline function which has Index
1301 -- FirstNonZeroBsplineIndex + n (n <= Order)
1302 -- BSplineBasis(2,1) =
1303 -- value of derivative of first non vanishing
1304 -- Bspline function which has Index FirstNonZeroBsplineIndex
1305 -- BSplineBasis(N,1) =
1306 -- value of Nth derivative of first non vanishing
1307 -- Bspline function which has Index FirstNonZeroBsplineIndex
1308 -- if N <= DerivativeOrder + 1
1310 BuildBSpMatrix(Parameters : in Array1OfReal from TColStd;
1311 OrderArray : in Array1OfInteger from TColStd;
1312 FlatKnots : in Array1OfReal from TColStd;
1313 Degree : in Integer;
1314 Matrix : in out Matrix from math;
1315 UpperBandWidth : out Integer ;
1316 LowerBandWidth : out Integer) returns Integer ;
1317 ---Purpose: This Builds a fully blown Matrix of
1321 -- with i and j within 1..Order + NumPoles
1322 -- The integer ni is the ith slot of the
1323 -- array OrderArray, tj is the jth slot of
1324 -- the array Parameters
1326 FactorBandedMatrix(Matrix : in out Matrix from math ;
1327 UpperBandWidth : in Integer ;
1328 LowerBandWidth : in Integer ;
1329 PivotIndexProblem : out Integer) returns Integer ;
1330 ---Purpose: this factors the Banded Matrix in
1331 -- the LU form with a Banded storage of
1332 -- components of the L matrix
1333 -- WARNING : do not use if the Matrix is
1334 -- totally positive (It is the case for
1335 -- Bspline matrices build as above with
1336 -- parameters being the Schoenberg points
1338 SolveBandedSystem (Matrix : in Matrix from math ;
1339 UpperBandWidth : in Integer ;
1340 LowerBandWidth : in Integer ;
1341 ArrayDimension : in Integer ;
1342 Array : in out Real)
1344 ---Purpose: This solves the system Matrix.X = B
1345 -- with when Matrix is factored in LU form
1346 -- The Array is an seen as an
1347 -- Array[1..N][1..ArrayDimension] with N =
1348 -- the rank of the matrix Matrix. The
1349 -- result is stored in Array when each
1350 -- coordinate is solved that is B is the
1351 -- array whose values are
1352 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1354 SolveBandedSystem (Matrix : in Matrix from math ;
1355 UpperBandWidth : in Integer ;
1356 LowerBandWidth : in Integer ;
1357 Array : in out Array1OfPnt2d from TColgp)
1359 ---Purpose: This solves the system Matrix.X = B
1360 -- with when Matrix is factored in LU form
1361 -- The Array has the length of
1362 -- the rank of the matrix Matrix. The
1363 -- result is stored in Array when each
1364 -- coordinate is solved that is B is the
1365 -- array whose values are
1366 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1368 SolveBandedSystem (Matrix : in Matrix from math ;
1369 UpperBandWidth : in Integer ;
1370 LowerBandWidth : in Integer ;
1371 Array : in out Array1OfPnt from TColgp)
1373 ---Purpose: This solves the system Matrix.X = B
1374 -- with when Matrix is factored in LU form
1375 -- The Array has the length of
1376 -- the rank of the matrix Matrix. The
1377 -- result is stored in Array when each
1378 -- coordinate is solved that is B is the
1379 -- array whose values are
1380 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1382 SolveBandedSystem (Matrix : in Matrix from math ;
1383 UpperBandWidth : in Integer ;
1384 LowerBandWidth : in Integer ;
1385 HomogenousFlag : in Boolean ;
1386 ArrayDimension : Integer ;
1387 Array : in out Real ;
1388 Weights : in out Real )
1391 SolveBandedSystem (Matrix : in Matrix from math ;
1392 UpperBandWidth : in Integer ;
1393 LowerBandWidth : in Integer ;
1394 HomogenousFlag : in Boolean ;
1395 Array : in out Array1OfPnt2d from TColgp;
1396 Weights : in out Array1OfReal from TColStd )
1398 ---Purpose: This solves the system Matrix.X = B
1399 -- with when Matrix is factored in LU form
1400 -- The Array is an seen as an
1401 -- Array[1..N][1..ArrayDimension] with N =
1402 -- the rank of the matrix Matrix. The
1403 -- result is stored in Array when each
1404 -- coordinate is solved that is B is the
1405 -- array whose values are B[i] =
1406 -- Array[i][p] for each p in
1407 -- 1..ArrayDimension. If HomogeneousFlag ==
1408 -- 0 the Poles are multiplied by the
1409 -- Weights uppon Entry and once
1410 -- interpolation is carried over the
1411 -- result of the poles are divided by the
1412 -- result of the interpolation of the
1413 -- weights. Otherwise if HomogenousFlag == 1
1414 -- the Poles and Weigths are treated homogenously
1415 -- that is that those are interpolated as they
1416 -- are and result is returned without division
1417 -- by the interpolated weigths.
1419 SolveBandedSystem (Matrix : in Matrix from math ;
1420 UpperBandWidth : in Integer ;
1421 LowerBandWidth : in Integer ;
1422 HomogeneousFlag : in Boolean ;
1423 Array : in out Array1OfPnt from TColgp;
1424 Weights : in out Array1OfReal from TColStd )
1426 ---Purpose: This solves the system Matrix.X = B
1427 -- with when Matrix is factored in LU form
1428 -- The Array is an seen as an
1429 -- Array[1..N][1..ArrayDimension] with N =
1430 -- the rank of the matrix Matrix. The
1431 -- result is stored in Array when each
1432 -- coordinate is solved that is B is the
1433 -- array whose values are
1434 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1435 -- If HomogeneousFlag ==
1436 -- 0 the Poles are multiplied by the
1437 -- Weights uppon Entry and once
1438 -- interpolation is carried over the
1439 -- result of the poles are divided by the
1440 -- result of the interpolation of the
1441 -- weights. Otherwise if HomogenousFlag == 1
1442 -- the Poles and Weigths are treated homogenously
1443 -- that is that those are interpolated as they
1444 -- are and result is returned without division
1445 -- by the interpolated weigths.
1447 MergeBSplineKnots(Tolerance : Real from Standard ;
1448 StartValue : Real from Standard ;
1449 EndValue : Real from Standard ;
1450 Degree1 : Integer from Standard ;
1451 Knots1 : Array1OfReal from TColStd ;
1452 Mults1 : Array1OfInteger from TColStd ;
1453 Degree2 : Integer from Standard ;
1454 Knots2 : Array1OfReal from TColStd ;
1455 Mults2 : Array1OfInteger from TColStd ;
1456 NumPoles : in out Integer ;
1457 NewKnots : in out HArray1OfReal from TColStd ;
1458 NewMults : in out HArray1OfInteger from TColStd) ;
1459 ---Purpose: Merges two knot vector by setting the starting and
1460 -- ending values to StartValue and EndValue
1462 FunctionReparameterise(Function : EvaluatorFunction from BSplCLib ;
1463 BSplineDegree : Integer ;
1464 BSplineFlatKnots : Array1OfReal from TColStd ;
1465 PolesDimension : Integer ;
1466 Poles : in out Real ;
1468 FlatKnots : Array1OfReal from TColStd ;
1469 NewDegree : Integer ;
1470 NewPoles : in out Real ;
1471 Status : in out Integer) ;
1472 ---Purpose: This function will compose a given Vectorial BSpline F(t)
1473 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1474 -- its Poles array which are coded as an array of Real
1475 -- of the form [1..NumPoles][1..PolesDimension] with a
1476 -- function a(t) which is assumed to satisfy the
1479 -- 1. F(a(t)) is a polynomial BSpline
1480 -- that can be expressed exactly as a BSpline of degree
1481 -- NewDegree on the knots FlatKnots
1483 -- 2. a(t) defines a differentiable
1484 -- isomorphism between the range of FlatKnots to the range
1485 -- of BSplineFlatKnots which is the
1486 -- same as the range of F(t)
1489 -- the caller's responsability to insure that conditions
1490 -- 1. and 2. above are satisfied : no check whatsoever
1491 -- is made in this method
1493 -- Status will return 0 if OK else it will return the pivot index
1494 -- of the matrix that was inverted to compute the multiplied
1495 -- BSpline : the method used is interpolation at Schoenenberg
1496 -- points of F(a(t))
1498 FunctionReparameterise(
1499 Function : EvaluatorFunction from BSplCLib ;
1500 BSplineDegree : Integer ;
1501 BSplineFlatKnots : Array1OfReal from TColStd ;
1502 Poles : Array1OfReal from TColStd ;
1504 FlatKnots : Array1OfReal from TColStd ;
1505 NewDegree : Integer ;
1506 NewPoles : in out Array1OfReal from TColStd ;
1507 Status : in out Integer) ;
1508 ---Purpose: This function will compose a given Vectorial BSpline F(t)
1509 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1510 -- its Poles array which are coded as an array of Real
1511 -- of the form [1..NumPoles][1..PolesDimension] with a
1512 -- function a(t) which is assumed to satisfy the
1515 -- 1. F(a(t)) is a polynomial BSpline
1516 -- that can be expressed exactly as a BSpline of degree
1517 -- NewDegree on the knots FlatKnots
1519 -- 2. a(t) defines a differentiable
1520 -- isomorphism between the range of FlatKnots to the range
1521 -- of BSplineFlatKnots which is the
1522 -- same as the range of F(t)
1525 -- the caller's responsability to insure that conditions
1526 -- 1. and 2. above are satisfied : no check whatsoever
1527 -- is made in this method
1529 -- Status will return 0 if OK else it will return the pivot index
1530 -- of the matrix that was inverted to compute the multiplied
1531 -- BSpline : the method used is interpolation at Schoenenberg
1532 -- points of F(a(t))
1534 FunctionReparameterise( Function : EvaluatorFunction from BSplCLib ;
1535 BSplineDegree : Integer ;
1536 BSplineFlatKnots : Array1OfReal from TColStd ;
1537 Poles : Array1OfPnt from TColgp ;
1539 FlatKnots : Array1OfReal from TColStd ;
1540 NewDegree : Integer ;
1541 NewPoles : in out Array1OfPnt from TColgp ;
1542 Status : in out Integer) ;
1543 ---Purpose: this will compose a given Vectorial BSpline F(t)
1544 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1545 -- its Poles array which are coded as an array of Real
1546 -- of the form [1..NumPoles][1..PolesDimension] with a
1547 -- function a(t) which is assumed to satisfy the
1548 -- following : 1. F(a(t)) is a polynomial BSpline
1549 -- that can be expressed exactly as a BSpline of degree
1550 -- NewDegree on the knots FlatKnots
1551 -- 2. a(t) defines a differentiable
1552 -- isomorphism between the range of FlatKnots to the range
1553 -- of BSplineFlatKnots which is the
1554 -- same as the range of F(t)
1556 -- the caller's responsability to insure that conditions
1557 -- 1. and 2. above are satisfied : no check whatsoever
1558 -- is made in this method
1559 -- Status will return 0 if OK else it will return the pivot index
1560 -- of the matrix that was inverted to compute the multiplied
1561 -- BSpline : the method used is interpolation at Schoenenberg
1562 -- points of F(a(t))
1564 FunctionReparameterise(
1565 Function : EvaluatorFunction from BSplCLib ;
1566 BSplineDegree : Integer ;
1567 BSplineFlatKnots : Array1OfReal from TColStd ;
1568 Poles : Array1OfPnt2d from TColgp ;
1570 FlatKnots : Array1OfReal from TColStd ;
1571 NewDegree : Integer ;
1572 NewPoles : in out Array1OfPnt2d from TColgp ;
1573 Status : in out Integer) ;
1574 ---Purpose: this will compose a given Vectorial BSpline F(t)
1575 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1576 -- its Poles array which are coded as an array of Real
1577 -- of the form [1..NumPoles][1..PolesDimension] with a
1578 -- function a(t) which is assumed to satisfy the
1579 -- following : 1. F(a(t)) is a polynomial BSpline
1580 -- that can be expressed exactly as a BSpline of degree
1581 -- NewDegree on the knots FlatKnots
1582 -- 2. a(t) defines a differentiable
1583 -- isomorphism between the range of FlatKnots to the range
1584 -- of BSplineFlatKnots which is the
1585 -- same as the range of F(t)
1587 -- the caller's responsability to insure that conditions
1588 -- 1. and 2. above are satisfied : no check whatsoever
1589 -- is made in this method
1590 -- Status will return 0 if OK else it will return the pivot index
1591 -- of the matrix that was inverted to compute the multiplied
1592 -- BSpline : the method used is interpolation at Schoenenberg
1593 -- points of F(a(t))
1595 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1596 BSplineDegree : Integer ;
1597 BSplineFlatKnots : Array1OfReal from TColStd ;
1598 PolesDimension : Integer ;
1599 Poles : in out Real ;
1600 FlatKnots : Array1OfReal from TColStd ;
1601 NewDegree : Integer ;
1602 NewPoles : in out Real ;
1603 Status : in out Integer) ;
1604 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1605 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1606 -- its Poles array which are coded as an array of Real
1607 -- of the form [1..NumPoles][1..PolesDimension] by a
1608 -- function a(t) which is assumed to satisfy the
1609 -- following : 1. a(t) * F(t) is a polynomial BSpline
1610 -- that can be expressed exactly as a BSpline of degree
1611 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1612 -- is the same as the range of F(t)
1614 -- the caller's responsability to insure that conditions
1615 -- 1. and 2. above are satisfied : no check whatsoever
1616 -- is made in this method
1617 -- Status will return 0 if OK else it will return the pivot index
1618 -- of the matrix that was inverted to compute the multiplied
1619 -- BSpline : the method used is interpolation at Schoenenberg
1620 -- points of a(t)*F(t)
1622 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1623 BSplineDegree : Integer ;
1624 BSplineFlatKnots : Array1OfReal from TColStd ;
1625 Poles : Array1OfReal from TColStd ;
1626 FlatKnots : Array1OfReal from TColStd ;
1627 NewDegree : Integer ;
1628 NewPoles : in out Array1OfReal from TColStd ;
1629 Status : in out Integer) ;
1630 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1631 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1632 -- its Poles array which are coded as an array of Real
1633 -- of the form [1..NumPoles][1..PolesDimension] by a
1634 -- function a(t) which is assumed to satisfy the
1635 -- following : 1. a(t) * F(t) is a polynomial BSpline
1636 -- that can be expressed exactly as a BSpline of degree
1637 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1638 -- is the same as the range of F(t)
1640 -- the caller's responsability to insure that conditions
1641 -- 1. and 2. above are satisfied : no check whatsoever
1642 -- is made in this method
1643 -- Status will return 0 if OK else it will return the pivot index
1644 -- of the matrix that was inverted to compute the multiplied
1645 -- BSpline : the method used is interpolation at Schoenenberg
1646 -- points of a(t)*F(t)
1648 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1649 BSplineDegree : Integer ;
1650 BSplineFlatKnots : Array1OfReal from TColStd ;
1651 Poles : Array1OfPnt2d from TColgp ;
1652 FlatKnots : Array1OfReal from TColStd ;
1653 NewDegree : Integer ;
1654 NewPoles : in out Array1OfPnt2d from TColgp ;
1655 Status : in out Integer) ;
1656 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1657 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1658 -- its Poles array which are coded as an array of Real
1659 -- of the form [1..NumPoles][1..PolesDimension] by a
1660 -- function a(t) which is assumed to satisfy the
1661 -- following : 1. a(t) * F(t) is a polynomial BSpline
1662 -- that can be expressed exactly as a BSpline of degree
1663 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1664 -- is the same as the range of F(t)
1666 -- the caller's responsability to insure that conditions
1667 -- 1. and 2. above are satisfied : no check whatsoever
1668 -- is made in this method
1669 -- Status will return 0 if OK else it will return the pivot index
1670 -- of the matrix that was inverted to compute the multiplied
1671 -- BSpline : the method used is interpolation at Schoenenberg
1672 -- points of a(t)*F(t)
1674 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1675 BSplineDegree : Integer ;
1676 BSplineFlatKnots : Array1OfReal from TColStd ;
1677 Poles : Array1OfPnt from TColgp ;
1678 FlatKnots : Array1OfReal from TColStd ;
1679 NewDegree : Integer ;
1680 NewPoles : in out Array1OfPnt from TColgp ;
1681 Status : in out Integer) ;
1682 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1683 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1684 -- its Poles array which are coded as an array of Real
1685 -- of the form [1..NumPoles][1..PolesDimension] by a
1686 -- function a(t) which is assumed to satisfy the
1687 -- following : 1. a(t) * F(t) is a polynomial BSpline
1688 -- that can be expressed exactly as a BSpline of degree
1689 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1690 -- is the same as the range of F(t)
1692 -- the caller's responsability to insure that conditions
1693 -- 1. and 2. above are satisfied : no check whatsoever
1694 -- is made in this method
1695 -- Status will return 0 if OK else it will return the pivot index
1696 -- of the matrix that was inverted to compute the multiplied
1697 -- BSpline : the method used is interpolation at Schoenenberg
1698 -- points of a(t)*F(t)
1701 PeriodicFlag : Boolean ;
1702 DerivativeRequest : Integer ;
1703 ExtrapMode : in out Integer ;
1705 FlatKnots : Array1OfReal from TColStd ;
1706 ArrayDimension : Integer ;
1707 Poles : in out Real ;
1708 Result : in out Real) ;
1709 ---Purpose: Perform the De Boor algorithm to evaluate a point at
1710 -- parameter <U>, with <Degree> and <Dimension>.
1712 -- Poles is an array of Reals of size
1714 -- <Dimension> * <Degree>+1
1716 -- Containing the poles. At the end <Poles> contains
1717 -- the current point. Poles Contain all the poles of
1718 -- the BsplineCurve, Knots also Contains all the knots
1719 -- of the BsplineCurve. ExtrapMode has two slots [0] =
1720 -- Degree used to extrapolate before the first knot [1]
1721 -- = Degre used to extrapolate after the last knot has
1722 -- to be between 1 and Degree
1725 PeriodicFlag : Boolean ;
1726 DerivativeRequest : Integer ;
1727 ExtrapMode : in out Integer ;
1729 FlatKnots : Array1OfReal from TColStd ;
1730 ArrayDimension : Integer ;
1731 Poles : in out Real ;
1732 Weights : in out Real ;
1733 PolesResult : in out Real ;
1734 WeightsResult : in out Real) ;
1735 ---Purpose: Perform the De Boor algorithm to evaluate a point at
1736 -- parameter <U>, with <Degree> and <Dimension>.
1737 -- Evaluates by multiplying the Poles by the Weights and
1738 -- gives the homogeneous result in PolesResult that is
1739 -- the results of the evaluation of the numerator once it
1740 -- has been multiplied by the weights and in
1741 -- WeightsResult one has the result of the evaluation of
1744 -- Warning: <PolesResult> and <WeightsResult> must be dimensionned
1748 PeriodicFlag : Boolean ;
1749 HomogeneousFlag : Boolean ;
1750 ExtrapMode : in out Integer ;
1752 FlatKnots : Array1OfReal from TColStd ;
1753 Poles : Array1OfPnt from TColgp;
1754 Weights : Array1OfReal from TColStd ;
1755 Point : out Pnt from gp ;
1756 Weight : in out Real) ;
1757 ---Purpose: Perform the evaluation of the Bspline Basis
1758 -- and then multiplies by the weights
1759 -- this just evaluates the current point
1762 PeriodicFlag : Boolean ;
1763 HomogeneousFlag : Boolean ;
1764 ExtrapMode : in out Integer ;
1766 FlatKnots : Array1OfReal from TColStd ;
1767 Poles : Array1OfPnt2d from TColgp;
1768 Weights : Array1OfReal from TColStd ;
1769 Point : out Pnt2d from gp ;
1770 Weight : in out Real) ;
1771 ---Purpose: Perform the evaluation of the Bspline Basis
1772 -- and then multiplies by the weights
1773 -- this just evaluates the current point
1776 TangExtendToConstraint(FlatKnots : Array1OfReal from TColStd ;
1777 C1Coefficient : Real ;
1778 NumPoles : in Integer ;
1779 Poles : in out Real ;
1780 Dimension : Integer ;
1782 ConstraintPoint : Array1OfReal from TColStd ;
1783 Continuity : Integer ;
1785 NbPolesResult : in out Integer ;
1786 NbKnotsRsult : in out Integer ;
1787 KnotsResult : in out Real ;
1788 PolesResult : in out Real) ;
1789 ---Purpose: Extend a BSpline nD using the tangency map
1790 -- <C1Coefficient> is the coefficient of reparametrisation
1791 -- <Continuity> must be equal to 1, 2 or 3.
1792 -- <Degree> must be greater or equal than <Continuity> + 1.
1794 -- Warning: <KnotsResult> and <PolesResult> must be dimensionned
1799 CacheParameter : Real;
1801 Poles : Array1OfPnt from TColgp ;
1802 Weights : Array1OfReal from TColStd ;
1803 Point : out Pnt from gp) ;
1804 ---Purpose: Perform the evaluation of the of the cache
1805 -- the parameter must be normalized between
1806 -- the 0 and 1 for the span.
1807 -- The Cache must be valid when calling this
1808 -- routine. Geom Package will insure that.
1809 -- and then multiplies by the weights
1810 -- this just evaluates the current point
1811 -- the CacheParameter is where the Cache was
1812 -- constructed the SpanLength is to normalize
1813 -- the polynomial in the cache to avoid bad conditioning
1818 CacheParameter : Real;
1820 Poles : Array1OfPnt2d from TColgp;
1821 Weights : Array1OfReal from TColStd ;
1822 Point : out Pnt2d from gp) ;
1823 ---Purpose: Perform the evaluation of the Bspline Basis
1824 -- and then multiplies by the weights
1825 -- this just evaluates the current point
1826 -- the parameter must be normalized between
1827 -- the 0 and 1 for the span.
1828 -- The Cache must be valid when calling this
1829 -- routine. Geom Package will insure that.
1830 -- and then multiplies by the weights
1831 -- ththe CacheParameter is where the Cache was
1832 -- constructed the SpanLength is to normalize
1833 -- the polynomial in the cache to avoid bad conditioning
1834 -- effectsis just evaluates the current point
1837 Poles : Array1OfPnt from TColgp ;
1838 Weights : Array1OfReal from TColStd ;
1839 Point : out Pnt from gp) ;
1840 ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with
1841 -- the method PolesCoefficients.
1842 -- Warning: To be used for Beziercurves ONLY!!!
1846 Poles : Array1OfPnt2d from TColgp ;
1847 Weights : Array1OfReal from TColStd ;
1848 Point : out Pnt2d from gp) ;
1849 ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with
1850 -- the method PolesCoefficients.
1851 -- Warning: To be used for Beziercurves ONLY!!!
1856 CacheParameter: Real;
1858 Poles : Array1OfPnt from TColgp ;
1859 Weights : Array1OfReal from TColStd ;
1860 Point : out Pnt from gp ;
1861 Vec : out Vec from gp) ;
1862 ---Purpose: Perform the evaluation of the of the cache
1863 -- the parameter must be normalized between
1864 -- the 0 and 1 for the span.
1865 -- The Cache must be valid when calling this
1866 -- routine. Geom Package will insure that.
1867 -- and then multiplies by the weights
1868 -- this just evaluates the current point
1869 -- the CacheParameter is where the Cache was
1870 -- constructed the SpanLength is to normalize
1871 -- the polynomial in the cache to avoid bad conditioning
1876 CacheParameter : Real;
1878 Poles : Array1OfPnt2d from TColgp;
1879 Weights : Array1OfReal from TColStd ;
1880 Point : out Pnt2d from gp ;
1881 Vec : out Vec2d from gp) ;
1882 ---Purpose: Perform the evaluation of the Bspline Basis
1883 -- and then multiplies by the weights
1884 -- this just evaluates the current point
1885 -- the parameter must be normalized between
1886 -- the 0 and 1 for the span.
1887 -- The Cache must be valid when calling this
1888 -- routine. Geom Package will insure that.
1889 -- and then multiplies by the weights
1890 -- ththe CacheParameter is where the Cache was
1891 -- constructed the SpanLength is to normalize
1892 -- the polynomial in the cache to avoid bad conditioning
1893 -- effectsis just evaluates the current point
1896 Poles : Array1OfPnt from TColgp ;
1897 Weights : Array1OfReal from TColStd ;
1898 Point : out Pnt from gp;
1899 Vec : out Vec from gp) ;
1900 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1901 -- the method PolesCoefficients.
1902 -- Warning: To be used for Beziercurves ONLY!!!
1906 Poles : Array1OfPnt2d from TColgp ;
1907 Weights : Array1OfReal from TColStd ;
1908 Point : out Pnt2d from gp;
1909 Vec : out Vec2d from gp) ;
1910 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1911 -- the method PolesCoefficients.
1912 -- Warning: To be used for Beziercurves ONLY!!!
1917 CacheParameter : Real;
1919 Poles : Array1OfPnt from TColgp ;
1920 Weights : Array1OfReal from TColStd ;
1921 Point : out Pnt from gp ;
1922 Vec1,Vec2 : out Vec from gp) ;
1923 ---Purpose: Perform the evaluation of the of the cache
1924 -- the parameter must be normalized between
1925 -- the 0 and 1 for the span.
1926 -- The Cache must be valid when calling this
1927 -- routine. Geom Package will insure that.
1928 -- and then multiplies by the weights
1929 -- this just evaluates the current point
1930 -- the CacheParameter is where the Cache was
1931 -- constructed the SpanLength is to normalize
1932 -- the polynomial in the cache to avoid bad conditioning
1937 CacheParameter : Real;
1939 Poles : Array1OfPnt2d from TColgp;
1940 Weights : Array1OfReal from TColStd ;
1941 Point : out Pnt2d from gp ;
1942 Vec1,Vec2 : out Vec2d from gp) ;
1943 ---Purpose: Perform the evaluation of the Bspline Basis
1944 -- and then multiplies by the weights
1945 -- this just evaluates the current point
1946 -- the parameter must be normalized between
1947 -- the 0 and 1 for the span.
1948 -- The Cache must be valid when calling this
1949 -- routine. Geom Package will insure that.
1950 -- and then multiplies by the weights
1951 -- ththe CacheParameter is where the Cache was
1952 -- constructed the SpanLength is to normalize
1953 -- the polynomial in the cache to avoid bad conditioning
1954 -- effectsis just evaluates the current point
1957 Poles : Array1OfPnt from TColgp ;
1958 Weights : Array1OfReal from TColStd ;
1959 Point : out Pnt from gp;
1960 Vec1,Vec2 : out Vec from gp) ;
1961 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1962 -- the method PolesCoefficients.
1963 -- Warning: To be used for Beziercurves ONLY!!!
1967 Poles : Array1OfPnt2d from TColgp ;
1968 Weights : Array1OfReal from TColStd ;
1969 Point : out Pnt2d from gp;
1970 Vec1,Vec2 : out Vec2d from gp) ;
1971 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1972 -- the method PolesCoefficients.
1973 -- Warning: To be used for Beziercurves ONLY!!!
1979 CacheParameter : Real;
1981 Poles : Array1OfPnt from TColgp ;
1982 Weights : Array1OfReal from TColStd ;
1983 Point : out Pnt from gp ;
1984 Vec1,Vec2,Vec3 : out Vec from gp) ;
1985 ---Purpose: Perform the evaluation of the of the cache
1986 -- the parameter must be normalized between
1987 -- the 0 and 1 for the span.
1988 -- The Cache must be valid when calling this
1989 -- routine. Geom Package will insure that.
1990 -- and then multiplies by the weights
1991 -- this just evaluates the current point
1992 -- the CacheParameter is where the Cache was
1993 -- constructed the SpanLength is to normalize
1994 -- the polynomial in the cache to avoid bad conditioning
1999 CacheParameter : Real;
2001 Poles : Array1OfPnt2d from TColgp;
2002 Weights : Array1OfReal from TColStd ;
2003 Point : out Pnt2d from gp ;
2004 Vec1,Vec2,Vec3 : out Vec2d from gp) ;
2005 ---Purpose: Perform the evaluation of the Bspline Basis
2006 -- and then multiplies by the weights
2007 -- this just evaluates the current point
2008 -- the parameter must be normalized between
2009 -- the 0 and 1 for the span.
2010 -- The Cache must be valid when calling this
2011 -- routine. Geom Package will insure that.
2012 -- and then multiplies by the weights
2013 -- ththe CacheParameter is where the Cache was
2014 -- constructed the SpanLength is to normalize
2015 -- the polynomial in the cache to avoid bad conditioning
2016 -- effectsis just evaluates the current point
2019 Poles : Array1OfPnt from TColgp ;
2020 Weights : Array1OfReal from TColStd ;
2021 Point : out Pnt from gp;
2022 Vec1,Vec2,Vec3: out Vec from gp) ;
2023 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
2024 -- the method PolesCoefficients.
2025 -- Warning: To be used for Beziercurves ONLY!!!
2029 Poles : Array1OfPnt2d from TColgp ;
2030 Weights : Array1OfReal from TColStd ;
2031 Point : out Pnt2d from gp;
2032 Vec1,Vec2,Vec3: out Vec2d from gp) ;
2033 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
2034 -- the method PolesCoefficients.
2035 -- Warning: To be used for Beziercurves ONLY!!!
2038 BuildCache(U : Real;
2039 InverseOfSpanDomain : Real;
2040 PeriodicFlag : Boolean ;
2042 FlatKnots : Array1OfReal from TColStd ;
2043 Poles : Array1OfPnt from TColgp;
2044 Weights : Array1OfReal from TColStd ;
2045 CachePoles : in out Array1OfPnt from TColgp;
2046 CacheWeights : in out Array1OfReal from TColStd) ;
2047 ---Purpose: Perform the evaluation of the Taylor expansion
2048 -- of the Bspline normalized between 0 and 1.
2049 -- If rational computes the homogeneous Taylor expension
2050 -- for the numerator and stores it in CachePoles
2052 BuildCache(U : Real;
2053 InverseOfSpanDomain : Real;
2054 PeriodicFlag : Boolean ;
2056 FlatKnots : Array1OfReal from TColStd ;
2057 Poles : Array1OfPnt2d from TColgp;
2058 Weights : Array1OfReal from TColStd ;
2059 CachePoles : in out Array1OfPnt2d from TColgp;
2060 CacheWeights : in out Array1OfReal from TColStd) ;
2061 ---Purpose: Perform the evaluation of the Taylor expansion
2062 -- of the Bspline normalized between 0 and 1.
2063 -- If rational computes the homogeneous Taylor expension
2064 -- for the numerator and stores it in CachePoles
2066 PolesCoefficients(Poles : Array1OfPnt2d from TColgp;
2067 CachePoles : in out Array1OfPnt2d from TColgp);
2068 ---Warning: To be used for Beziercurves ONLY!!!
2071 PolesCoefficients(Poles : Array1OfPnt2d from TColgp;
2072 Weights : Array1OfReal from TColStd ;
2073 CachePoles : in out Array1OfPnt2d from TColgp;
2074 CacheWeights : in out Array1OfReal from TColStd) ;
2075 ---Warning: To be used for Beziercurves ONLY!!!
2077 PolesCoefficients(Poles : Array1OfPnt from TColgp;
2078 CachePoles : in out Array1OfPnt from TColgp);
2079 ---Warning: To be used for Beziercurves ONLY!!!
2082 PolesCoefficients(Poles : Array1OfPnt from TColgp;
2083 Weights : Array1OfReal from TColStd ;
2084 CachePoles : in out Array1OfPnt from TColgp;
2085 CacheWeights : in out Array1OfReal from TColStd) ;
2086 ---Purpose: Encapsulation of BuildCache to perform the
2087 -- evaluation of the Taylor expansion for beziercurves
2089 -- Warning: To be used for Beziercurves ONLY!!!
2091 FlatBezierKnots (Degree: Integer) returns Real;
2092 ---Purpose: Returns pointer to statically allocated array representing
2093 -- flat knots for bezier curve of the specified degree.
2094 -- Raises OutOfRange if Degree > MaxDegree()
2095 ---C++: return const &
2097 BuildSchoenbergPoints(Degree : Integer ;
2098 FlatKnots : Array1OfReal from TColStd ;
2099 Parameters : in out Array1OfReal from TColStd) ;
2100 ---Purpose: builds the Schoenberg points from the flat knot
2101 -- used to interpolate a BSpline since the
2102 -- BSpline matrix is invertible.
2104 Interpolate(Degree : Integer ;
2105 FlatKnots : Array1OfReal from TColStd ;
2106 Parameters : Array1OfReal from TColStd ;
2107 ContactOrderArray : Array1OfInteger from TColStd ;
2108 Poles : in out Array1OfPnt from TColgp ;
2109 InversionProblem : out Integer) ;
2110 ---Purpose: Performs the interpolation of the data given in
2111 -- the Poles array according to the requests in
2112 -- ContactOrderArray that is : if
2113 -- ContactOrderArray(i) has value d it means that
2114 -- Poles(i) containes the dth derivative of the
2115 -- function to be interpolated. The length L of the
2116 -- following arrays must be the same :
2117 -- Parameters, ContactOrderArray, Poles,
2118 -- The length of FlatKnots is Degree + L + 1
2120 -- the method used to do that interpolation is
2121 -- gauss elimination WITHOUT pivoting. Thus if the
2122 -- diagonal is not dominant there is no guarantee
2123 -- that the algorithm will work. Nevertheless for
2124 -- Cubic interpolation or interpolation at Scheonberg
2125 -- points the method will work
2126 -- The InversionProblem will report 0 if there was no
2127 -- problem else it will give the index of the faulty
2130 Interpolate(Degree : Integer ;
2131 FlatKnots : Array1OfReal from TColStd ;
2132 Parameters : Array1OfReal from TColStd ;
2133 ContactOrderArray : Array1OfInteger from TColStd ;
2134 Poles : in out Array1OfPnt2d from TColgp ;
2135 InversionProblem : out Integer) ;
2136 ---Purpose: Performs the interpolation of the data given in
2137 -- the Poles array according to the requests in
2138 -- ContactOrderArray that is : if
2139 -- ContactOrderArray(i) has value d it means that
2140 -- Poles(i) containes the dth derivative of the
2141 -- function to be interpolated. The length L of the
2142 -- following arrays must be the same :
2143 -- Parameters, ContactOrderArray, Poles,
2144 -- The length of FlatKnots is Degree + L + 1
2146 -- the method used to do that interpolation is
2147 -- gauss elimination WITHOUT pivoting. Thus if the
2148 -- diagonal is not dominant there is no guarantee
2149 -- that the algorithm will work. Nevertheless for
2150 -- Cubic interpolation at knots or interpolation at Scheonberg
2151 -- points the method will work.
2152 -- The InversionProblem w
2153 -- ll report 0 if there was no
2154 -- problem else it will give the index of the faulty
2157 Interpolate(Degree : Integer ;
2158 FlatKnots : Array1OfReal from TColStd ;
2159 Parameters : Array1OfReal from TColStd ;
2160 ContactOrderArray : Array1OfInteger from TColStd ;
2161 Poles : in out Array1OfPnt from TColgp ;
2162 Weights : in out Array1OfReal from TColStd ;
2163 InversionProblem : out Integer) ;
2164 ---Purpose: Performs the interpolation of the data given in
2165 -- the Poles array according to the requests in
2166 -- ContactOrderArray that is : if
2167 -- ContactOrderArray(i) has value d it means that
2168 -- Poles(i) containes the dth derivative of the
2169 -- function to be interpolated. The length L of the
2170 -- following arrays must be the same :
2171 -- Parameters, ContactOrderArray, Poles,
2172 -- The length of FlatKnots is Degree + L + 1
2174 -- the method used to do that interpolation is
2175 -- gauss elimination WITHOUT pivoting. Thus if the
2176 -- diagonal is not dominant there is no guarantee
2177 -- that the algorithm will work. Nevertheless for
2178 -- Cubic interpolation at knots or interpolation at Scheonberg
2179 -- points the method will work.
2180 -- The InversionProblem will report 0 if there was no
2181 -- problem else it will give the index of the faulty
2186 Interpolate(Degree : Integer ;
2187 FlatKnots : Array1OfReal from TColStd ;
2188 Parameters : Array1OfReal from TColStd ;
2189 ContactOrderArray : Array1OfInteger from TColStd ;
2190 Poles : in out Array1OfPnt2d from TColgp ;
2191 Weights : in out Array1OfReal from TColStd ;
2192 InversionProblem : out Integer) ;
2193 ---Purpose: Performs the interpolation of the data given in
2194 -- the Poles array according to the requests in
2195 -- ContactOrderArray that is : if
2196 -- ContactOrderArray(i) has value d it means that
2197 -- Poles(i) containes the dth derivative of the
2198 -- function to be interpolated. The length L of the
2199 -- following arrays must be the same :
2200 -- Parameters, ContactOrderArray, Poles,
2201 -- The length of FlatKnots is Degree + L + 1
2203 -- the method used to do that interpolation is
2204 -- gauss elimination WITHOUT pivoting. Thus if the
2205 -- diagonal is not dominant there is no guarantee
2206 -- that the algorithm will work. Nevertheless for
2207 -- Cubic interpolation at knots or interpolation at Scheonberg
2208 -- points the method will work.
2209 -- The InversionProblem w
2210 -- ll report 0 if there was no
2211 -- problem else it will give the i
2213 Interpolate(Degree : Integer ;
2214 FlatKnots : Array1OfReal from TColStd ;
2215 Parameters : Array1OfReal from TColStd ;
2216 ContactOrderArray : Array1OfInteger from TColStd ;
2217 ArrayDimension : Integer ;
2218 Poles : in out Real ;
2219 InversionProblem : out Integer) ;
2220 ---Purpose: Performs the interpolation of the data given in
2221 -- the Poles array according to the requests in
2222 -- ContactOrderArray that is : if
2223 -- ContactOrderArray(i) has value d it means that
2224 -- Poles(i) containes the dth derivative of the
2225 -- function to be interpolated. The length L of the
2226 -- following arrays must be the same :
2227 -- Parameters, ContactOrderArray
2228 -- The length of FlatKnots is Degree + L + 1
2229 -- The PolesArray is an seen as an
2230 -- Array[1..N][1..ArrayDimension] with N = tge length
2231 -- of the parameters array
2233 -- the method used to do that interpolation is
2234 -- gauss elimination WITHOUT pivoting. Thus if the
2235 -- diagonal is not dominant there is no guarantee
2236 -- that the algorithm will work. Nevertheless for
2237 -- Cubic interpolation or interpolation at Scheonberg
2238 -- points the method will work
2239 -- The InversionProblem will report 0 if there was no
2240 -- problem else it will give the index of the faulty
2244 Interpolate(Degree : Integer ;
2245 FlatKnots : Array1OfReal from TColStd ;
2246 Parameters : Array1OfReal from TColStd ;
2247 ContactOrderArray : Array1OfInteger from TColStd ;
2248 ArrayDimension : Integer ;
2249 Poles : in out Real ;
2250 Weights : in out Real ;
2251 InversionProblem : out Integer) ;
2253 MovePoint(U : Real; -- parameter of the point
2254 Displ : Vec2d from gp; -- translation vector of the point
2255 Index1 : Integer; -- first movable pole
2256 Index2 : Integer; -- last movable pole
2259 Poles : Array1OfPnt2d from TColgp;
2260 Weights : Array1OfReal from TColStd;
2261 FlatKnots : Array1OfReal from TColStd;
2262 FirstIndex : in out Integer; -- first pole modified
2263 LastIndex : in out Integer; -- last pole modified
2264 NewPoles : in out Array1OfPnt2d from TColgp); -- new poles
2265 ---Purpose: Find the new poles which allows an old point (with a
2266 -- given u as parameter) to reach a new position
2267 -- Index1 and Index2 indicate the range of poles we can move
2268 -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side
2269 -- don't enter (1,NbPoles) -> error: rigid move
2270 -- (2, NbPoles-1) -> the ends are enforced
2271 -- (3, NbPoles-2) -> the ends and the tangency are enforced
2272 -- if Problem in BSplineBasis calculation, no change for the curve
2273 -- and FirstIndex, LastIndex = 0
2275 MovePoint(U : Real; -- parameter of the point
2276 Displ : Vec from gp; -- translation vector of the point
2277 Index1 : Integer; -- first movable pole
2278 Index2 : Integer; -- last movable pole
2281 Poles : Array1OfPnt from TColgp;
2282 Weights : Array1OfReal from TColStd;
2283 FlatKnots : Array1OfReal from TColStd;
2284 FirstIndex : in out Integer; -- first pole modified
2285 LastIndex : in out Integer; -- last pole modified
2286 NewPoles : in out Array1OfPnt from TColgp); -- new poles
2287 ---Purpose: Find the new poles which allows an old point (with a
2288 -- given u as parameter) to reach a new position
2289 -- Index1 and Index2 indicate the range of poles we can move
2290 -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side
2291 -- don't enter (1,NbPoles) -> error: rigid move
2292 -- (2, NbPoles-1) -> the ends are enforced
2293 -- (3, NbPoles-2) -> the ends and the tangency are enforced
2294 -- if Problem in BSplineBasis calculation, no change for the curve
2295 -- and FirstIndex, LastIndex = 0
2297 MovePointAndTangent(U : Real ;
2298 ArrayDimension : Integer ;
2299 Delta : in out Real ;
2300 DeltaDerivative : in out Real ;
2303 Rational : Boolean ;
2304 StartingCondition : Integer ;
2305 EndingCondition : Integer ;
2306 Poles : in out Real ;
2307 Weights : Array1OfReal from TColStd;
2308 FlatKnots : Array1OfReal from TColStd;
2309 NewPoles : in out Real ;
2310 ErrorStatus : in out Integer) ;
2311 ---Purpose: This is the dimension free version of the utility
2312 -- U is the parameter must be within the first FlatKnots and the
2313 -- last FlatKnots Delta is the amount the curve has to be moved
2314 -- DeltaDerivative is the amount the derivative has to be moved.
2315 -- Delta and DeltaDerivative must be array of dimension
2316 -- ArrayDimension Degree is the degree of the BSpline and the
2317 -- FlatKnots are the knots of the BSpline Starting Condition if =
2318 -- -1 means the starting point of the curve can move
2320 -- starting point of the cuve cannot move but tangen starting
2321 -- point of the curve cannot move
2322 -- = 1 means the starting point and tangents cannot move
2323 -- = 2 means the starting point tangent and curvature cannot move
2325 -- Same holds for EndingCondition
2326 -- Poles are the poles of the curve
2327 -- Weights are the weights of the curve if Rational = Standard_True
2328 -- NewPoles are the poles of the deformed curve
2329 -- ErrorStatus will be 0 if no error happened
2330 -- 1 if there are not enough knots/poles
2331 -- the imposed conditions
2332 -- The way to solve this problem is to add knots to the BSpline
2333 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2334 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2335 -- have at least 2 internal knots.
2337 MovePointAndTangent(U : Real ;
2338 Delta : Vec from gp ;
2339 DeltaDerivative : Vec from gp ;
2342 Rational : Boolean ;
2343 StartingCondition : Integer ;
2344 EndingCondition : Integer ;
2345 Poles : Array1OfPnt from TColgp ;
2346 Weights : Array1OfReal from TColStd;
2347 FlatKnots : Array1OfReal from TColStd;
2348 NewPoles : in out Array1OfPnt from TColgp ;
2349 ErrorStatus : in out Integer) ;
2350 ---Purpose: This is the dimension free version of the utility
2351 -- U is the parameter must be within the first FlatKnots and the
2352 -- last FlatKnots Delta is the amount the curve has to be moved
2353 -- DeltaDerivative is the amount the derivative has to be moved.
2354 -- Delta and DeltaDerivative must be array of dimension
2355 -- ArrayDimension Degree is the degree of the BSpline and the
2356 -- FlatKnots are the knots of the BSpline Starting Condition if =
2357 -- -1 means the starting point of the curve can move
2359 -- starting point of the cuve cannot move but tangen starting
2360 -- point of the curve cannot move
2361 -- = 1 means the starting point and tangents cannot move
2362 -- = 2 means the starting point tangent and curvature cannot move
2364 -- Same holds for EndingCondition
2365 -- Poles are the poles of the curve
2366 -- Weights are the weights of the curve if Rational = Standard_True
2367 -- NewPoles are the poles of the deformed curve
2368 -- ErrorStatus will be 0 if no error happened
2369 -- 1 if there are not enough knots/poles
2370 -- the imposed conditions
2371 -- The way to solve this problem is to add knots to the BSpline
2372 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2373 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2374 -- have at least 2 internal knots.
2376 MovePointAndTangent(U : Real ;
2377 Delta : Vec2d from gp ;
2378 DeltaDerivative : Vec2d from gp ;
2381 Rational : Boolean ;
2382 StartingCondition : Integer ;
2383 EndingCondition : Integer ;
2384 Poles : Array1OfPnt2d from TColgp ;
2385 Weights : Array1OfReal from TColStd ;
2386 FlatKnots : Array1OfReal from TColStd ;
2387 NewPoles : in out Array1OfPnt2d from TColgp ;
2388 ErrorStatus : in out Integer) ;
2389 ---Purpose: This is the dimension free version of the utility
2390 -- U is the parameter must be within the first FlatKnots and the
2391 -- last FlatKnots Delta is the amount the curve has to be moved
2392 -- DeltaDerivative is the amount the derivative has to be moved.
2393 -- Delta and DeltaDerivative must be array of dimension
2394 -- ArrayDimension Degree is the degree of the BSpline and the
2395 -- FlatKnots are the knots of the BSpline Starting Condition if =
2396 -- -1 means the starting point of the curve can move
2398 -- starting point of the cuve cannot move but tangen starting
2399 -- point of the curve cannot move
2400 -- = 1 means the starting point and tangents cannot move
2401 -- = 2 means the starting point tangent and curvature cannot move
2403 -- Same holds for EndingCondition
2404 -- Poles are the poles of the curve
2405 -- Weights are the weights of the curve if Rational = Standard_True
2406 -- NewPoles are the poles of the deformed curve
2407 -- ErrorStatus will be 0 if no error happened
2408 -- 1 if there are not enough knots/poles
2409 -- the imposed conditions
2410 -- The way to solve this problem is to add knots to the BSpline
2411 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2412 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2413 -- have at least 2 internal knots.
2415 Resolution( PolesArray : in out Real ;
2416 ArrayDimension : Integer ;
2417 NumPoles : Integer ;
2418 Weights : in Array1OfReal from TColStd;
2419 FlatKnots : in Array1OfReal from TColStd;
2420 Degree : in Integer;
2421 Tolerance3D : Real from Standard ;
2422 UTolerance : out Real from Standard) ;
2424 -- given a tolerance in 3D space returns a
2425 -- tolerance in U parameter space such that
2426 -- all u1 and u0 in the domain of the curve f(u)
2427 -- | u1 - u0 | < UTolerance and
2428 -- we have |f (u1) - f (u0)| < Tolerance3D
2430 Resolution( Poles : in Array1OfPnt from TColgp ;
2431 Weights : in Array1OfReal from TColStd ;
2432 NumPoles : in Integer from Standard ;
2433 FlatKnots : in Array1OfReal from TColStd ;
2434 Degree : in Integer from Standard ;
2435 Tolerance3D : Real from Standard ;
2436 UTolerance : out Real from Standard) ;
2438 -- given a tolerance in 3D space returns a
2439 -- tolerance in U parameter space such that
2440 -- all u1 and u0 in the domain of the curve f(u)
2441 -- | u1 - u0 | < UTolerance and
2442 -- we have |f (u1) - f (u0)| < Tolerance3D
2444 Resolution( Poles : in Array1OfPnt2d from TColgp ;
2445 Weights : in Array1OfReal from TColStd ;
2446 NumPoles : in Integer from Standard ;
2447 FlatKnots : in Array1OfReal from TColStd ;
2448 Degree : in Integer ;
2449 Tolerance3D : Real from Standard ;
2450 UTolerance : out Real from Standard) ;
2452 -- given a tolerance in 3D space returns a
2453 -- tolerance in U parameter space such that
2454 -- all u1 and u0 in the domain of the curve f(u)
2455 -- | u1 - u0 | < UTolerance and
2456 -- we have |f (u1) - f (u0)| < Tolerance3D