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 transient class Cache;
110 imported EvaluatorFunction ;
112 enumeration KnotDistribution is NonUniform, Uniform;
113 ---Purpose: This enumeration describes the repartition of the
114 -- knots sequence. If all the knots differ by the
115 -- same positive constant from the preceding knot the
116 -- "KnotDistribution" is <Uniform> else it is
119 enumeration MultDistribution is NonConstant, Constant, QuasiConstant;
120 ---Purpose: This enumeration describes the form of the
121 -- sequence of mutiplicities. MultDistribution is :
123 -- Constant if all the multiplicities have the same
126 -- QuasiConstant if all the internal knots have the
127 -- same multiplicity and if the first and last knot
128 -- have a different multiplicity.
130 -- NonConstant in other cases.
132 -------------------------------------------------------------
133 -------------------------------------------------------------
134 ---------- ----------
135 ---------- Knots and Multiplicities ----------
136 ---------- ----------
137 -------------------------------------------------------------
138 -------------------------------------------------------------
140 Hunt (XX : in Array1OfReal from TColStd;
142 Iloc : in out Integer);
143 ---Purpose: This routine searches the position of the real
144 -- value X in the ordered set of real values XX.
146 -- The elements in the table XX are either
147 -- monotonically increasing or monotonically
150 -- The input value Iloc is used to initialize the
151 -- algorithm : if Iloc is outside of the bounds
152 -- [XX.Lower(), -- XX.Upper()] the bisection algorithm
153 -- is used else the routine searches from a previous
154 -- known position by increasing steps then converges
157 -- This routine is used to locate a knot value in a
160 ---References : Numerical Recipes in C (William H.Press, Brian
161 -- P. Flannery, Saul A. Teukolsky, William T.
164 FirstUKnotIndex (Degree : Integer;
165 Mults : Array1OfInteger from TColStd)
167 ---Purpose: Computes the index of the knots value which gives
168 -- the start point of the curve.
171 LastUKnotIndex (Degree : Integer;
172 Mults : Array1OfInteger from TColStd)
174 ---Purpose: Computes the index of the knots value which gives
175 -- the end point of the curve.
177 FlatIndex (Degree : Integer;
179 Mults : Array1OfInteger from TColStd;
182 ---Purpose: Computes the index of the flats knots sequence
183 -- corresponding to <Index> in the knots sequence
184 -- which multiplicities are <Mults>.
186 LocateParameter (Degree : Integer;
187 Knots : Array1OfReal from TColStd;
188 Mults : Array1OfInteger from TColStd;
190 IsPeriodic : Boolean;
193 KnotIndex : in out Integer;
195 ---Purpose: Locates the parametric value U in the knots
196 -- sequence between the knot K1 and the knot K2.
197 -- The value return in Index verifies.
199 -- Knots(Index) <= U < Knots(Index + 1)
200 -- if U <= Knots (K1) then Index = K1
201 -- if U >= Knots (K2) then Index = K2 - 1
203 -- If Periodic is True U may be modified to fit in
204 -- the range Knots(K1), Knots(K2). In any case the
205 -- correct value is returned in NewU.
207 -- Warnings :Index is used as input data to initialize the
208 -- searching function.
209 -- Warning: Knots have to be "withe repetitions"
211 LocateParameter (Degree : Integer;
212 Knots : Array1OfReal from TColStd;
214 IsPeriodic : Boolean;
217 KnotIndex : in out Integer;
219 ---Purpose: Locates the parametric value U in the knots
220 -- sequence between the knot K1 and the knot K2.
221 -- The value return in Index verifies.
223 -- Knots(Index) <= U < Knots(Index + 1)
224 -- if U <= Knots (K1) then Index = K1
225 -- if U >= Knots (K2) then Index = K2 - 1
227 -- If Periodic is True U may be modified to fit in
228 -- the range Knots(K1), Knots(K2). In any case the
229 -- correct value is returned in NewU.
231 -- Warnings :Index is used as input data to initialize the
232 -- searching function.
233 -- Warning: Knots have to be "flat"
235 LocateParameter (Knots : Array1OfReal from TColStd;
239 Index : in out Integer;
245 LocateParameter (Degree : Integer;
246 Knots : Array1OfReal from TColStd;
247 Mults : Array1OfInteger from TColStd;
250 Index : in out Integer;
254 MaxKnotMult (Mults : Array1OfInteger from TColStd;
257 ---Purpose: Finds the greatest multiplicity in a set of knots
258 -- between K1 and K2. Mults is the multiplicity
259 -- associated with each knot value.
261 MinKnotMult (Mults : Array1OfInteger from TColStd;
264 ---Purpose: Finds the lowest multiplicity in a set of knots
265 -- between K1 and K2. Mults is the multiplicity
266 -- associated with each knot value.
268 NbPoles(Degree : Integer;
270 Mults : Array1OfInteger from TColStd)
272 ---Purpose: Returns the number of poles of the curve. Returns 0 if
273 -- one of the multiplicities is incorrect.
277 -- * Greater than Degree, or Degree+1 at the first and
278 -- last knot of a non periodic curve.
280 -- * The last periodicity on a periodic curve is not
281 -- equal to the first.
283 KnotSequenceLength(Mults : Array1OfInteger from TColStd;
287 ---Purpose: Returns the length of the sequence of knots with
292 -- Sum(Mults(i), i = Mults.Lower(); i <= Mults.Upper());
296 -- Sum(Mults(i); i = Mults.Lower(); i < Mults.Upper())
299 KnotSequence (Knots : Array1OfReal from TColStd;
300 Mults : Array1OfInteger from TColStd;
301 KnotSeq : in out Array1OfReal from TColStd;
302 Periodic : Boolean = Standard_False);
304 KnotSequence (Knots : Array1OfReal from TColStd;
305 Mults : Array1OfInteger from TColStd;
308 KnotSeq : in out Array1OfReal from TColStd);
309 ---Purpose: Computes the sequence of knots KnotSeq with
310 -- repetition of the knots of multiplicity greater
313 -- Length of KnotSeq must be KnotSequenceLength(Mults,Degree,Periodic)
315 KnotsLength( KnotSeq : Array1OfReal from TColStd;
316 Periodic : Boolean = Standard_False)
318 ---Purpose: Returns the length of the sequence of knots (and
319 -- Mults) without repetition.
321 Knots( KnotSeq : Array1OfReal from TColStd;
322 Knots : out Array1OfReal from TColStd;
323 Mults : out Array1OfInteger from TColStd;
324 Periodic : Boolean = Standard_False);
325 ---Purpose: Computes the sequence of knots Knots without
326 -- repetition of the knots of multiplicity greater
329 -- Length of <Knots> and <Mults> must be
330 -- KnotsLength(KnotSequence,Periodic)
332 KnotForm (Knots : Array1OfReal from TColStd;
333 FromK1, ToK2 : Integer)
334 returns KnotDistribution;
335 ---Purpose: Analyses if the knots distribution is "Uniform"
336 -- or "NonUniform" between the knot FromK1 and the
337 -- knot ToK2. There is no repetition of knot in the
338 -- knots'sequence <Knots>.
340 MultForm (Mults : Array1OfInteger from TColStd;
341 FromK1, ToK2 : Integer)
342 returns MultDistribution;
344 -- Analyses the distribution of multiplicities between
345 -- the knot FromK1 and the Knot ToK2.
347 KnotAnalysis (Degree : Integer;
349 CKnots : Array1OfReal from TColStd;
350 CMults : Array1OfInteger from TColStd;
351 KnotForm : out BSplKnotDistribution from GeomAbs;
352 MaxKnotMult: out Integer);
353 ---Purpose: Analyzes the array of knots.
354 -- Returns the form and the maximum knot multiplicity.
356 Reparametrize (U1, U2 : Real;
357 Knots : in out Array1OfReal from TColStd);
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.
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.
367 Reverse (Knots : in out Array1OfReal from TColStd);
368 ---Purpose: Reverses the array knots to become the knots
369 -- sequence of the reversed curve.
371 Reverse (Mults : in out Array1OfInteger from TColStd);
372 ---Purpose: Reverses the array of multiplicities.
374 Reverse (Poles : in out Array1OfPnt from TColgp;
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
380 -- (number of flat knots - degree - 1)
384 -- (sum of multiplicities(but for the last) + degree
387 Reverse (Poles : in out Array1OfPnt2d from TColgp;
389 ---Purpose: Reverses the array of poles.
391 Reverse (Weights : in out Array1OfReal from TColStd;
393 ---Purpose: Reverses the array of poles.
395 IsRational(Weights : Array1OfReal from TColStd;
397 Epsilon : Real = 0.0) returns Boolean;
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.
404 MaxDegree returns Integer;
405 ---Purpose: returns the degree maxima for a BSplineCurve.
412 Poles : in out Real);
413 ---Purpose: Perform the Boor algorithm to evaluate a point at
414 -- parameter <U>, with <Degree> and <Dimension>.
416 -- Poles is an array of Reals of size
418 -- <Dimension> * <Degree>+1
420 -- Containing the poles. At the end <Poles> contains
421 -- the current point.
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
436 -- * Knots is an array of reals of length :
438 -- <Length> + <Degree>
440 -- * Poles is an array of reals of length :
442 -- (2 * <Length> + 1) * <Dimension>
444 -- The poles values must be set in the array at the
457 -- The results are found in the array poles depending
458 -- on the Depth. (See the method GetPole).
460 AntiBoorScheme(U : Real;
467 Tolerance : Real) returns Boolean;
468 ---Purpose: Compute the content of Pole before the BoorScheme.
469 -- This method is used to remove poles.
471 -- U is the poles to remove, Knots should contains the
472 -- knots of the curve after knot removal.
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
480 Derivative(Degree : Integer;
485 Poles : in out Real);
486 ---Purpose: Computes the poles of the BSpline giving the
487 -- derivatives of order <Order>.
489 -- The formula for the first order is
491 -- Pole(i) = Degree * (Pole(i+1) - Pole(i)) /
492 -- (Knots(i+Degree+1) - Knots(i+1))
494 -- This formula is repeated (Degree is decremented at
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).
507 -- <Poles> is the original array of poles.
509 -- The result in <Poles> is the value and the
510 -- derivatives. Poles[0] is the value, Poles[Degree]
511 -- is the last derivative.
514 NoWeights returns Array1OfReal from TColStd;
515 ---Purpose: Used as argument for a non rational curve.
520 NoMults returns Array1OfInteger from TColStd;
521 ---Purpose: Used as argument for a flatknots evaluation.
526 BuildKnots(Degree, Index : Integer;
528 Knots : Array1OfReal from TColStd;
529 Mults : Array1OfInteger from TColStd;
531 ---Purpose: Stores in LK the usefull knots for the BoorSchem
532 -- on the span Knots(Index) - Knots(Index+1)
534 PoleIndex (Degree, Index : Integer;
536 Mults : Array1OfInteger from TColStd)
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().
542 BuildEval(Degree,Index : Integer;
543 Poles : Array1OfReal from TColStd;
544 Weights : Array1OfReal from TColStd;
547 BuildEval(Degree,Index : Integer;
548 Poles : Array1OfPnt from TColgp;
549 Weights : Array1OfReal from TColStd;
552 BuildEval(Degree,Index : Integer;
553 Poles : Array1OfPnt2d from TColgp;
554 Weights : Array1OfReal from TColStd;
556 ---Purpose: Copy in <LP> the poles and weights for the Eval
557 -- scheme. starting from Poles(Poles.Lower()+Index)
559 BuildBoor(Index,Length,Dimension : Integer;
560 Poles : Array1OfReal from TColStd;
562 ---Purpose: Copy in <LP> poles for <Dimension> Boor scheme.
563 -- Starting from <Index> * <Dimension>, copy
567 BoorIndex(Index, Length, Depth : 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>.
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.
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;
591 Add : in Boolean = Standard_True)
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>.
597 -- Epsilon is used to compare knots for equality.
599 -- If Add is True the multiplicities on equal knots are
602 -- If Add is False the max value of the multiplicities is
606 -- The knew knots are knot increasing.
607 -- The new knots are not in the range.
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;
622 Add : in Boolean = Standard_True);
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;
638 Add : in Boolean = Standard_True);
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;
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 :
659 -- Knots(Knots.Lower()) <= AddKnots(AddKnots.Lower())
660 -- Knots(Knots.Upper()) >= AddKnots(AddKnots.Upper())
662 -- The NewPoles and NewWeights arrays must have a length :
663 -- Poles.Length() + Sum(AddMults())
665 -- When a knot to insert is identic to an existing knot the
666 -- multiplicities are added.
668 -- Epsilon is used to test knots for equality.
670 -- When AddMult is negative or null the knot is not inserted.
671 -- No multiplicity will becomes higher than the degree.
673 -- The new Knots and Multiplicities are copied in <NewKnots>
676 -- All the New arrays should be correctly dimensioned.
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.
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);
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
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).
714 -- The new control points corresponding to this insertion are
715 -- returned. Knots and Mults are not updated.
718 KnotIndex : 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);
730 KnotIndex : 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>.
742 -- The new control points are returned. Knots and Mults are
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;
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;
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
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.
796 -- If a distance is bigger than tolerance the
797 -- methods returns False and the new arrays are
800 -- A low tolerance can be used to test if the
801 -- knot can be removed without modifying the
804 -- A high tolerance can be used to "smooth" the
808 IncreaseDegreeCountKnots (Degree, NewDegree : Integer;
810 Mults : Array1OfInteger from TColStd)
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.
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);
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);
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);
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!!!
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
869 -- The number of poles in the new curve is :
871 -- Poles.Length() + (NewDegree - Degree) * Number of spans
873 -- Where the number of spans is :
875 -- LastUKnotIndex(Mults) - FirstUKnotIndex(Mults) + 1
877 -- for a non-periodic curve
879 -- And Knots.Length() - 1 for a periodic curve.
881 -- The multiplicities of all knots are increased by
882 -- the degree elevation.
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.
892 -- Example : Suppose a curve of degree 3 starting
893 -- with following knots and multiplicities :
898 -- The FirstUKnot is 2. because the sum of
899 -- multiplicities is Degree+1 : 1 + 2 + 1 = 4 = 3 + 1
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.
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 :
913 -- The multipicity of the first knot may also be
914 -- reduced if the sum is still to big.
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.
920 -- The method IncreaseDegreeCountKnots can be used to
921 -- compute the new number of knots.\
923 ---Warning: To be used for Beziercurves ONLY!!!
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>.
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);
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);
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);
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>
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);
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);
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);
1020 -------------------------------------------------------------
1021 -------------------------------------------------------------
1022 ---------- ----------
1023 ---------- Curve Evaluations ----------
1024 ---------- ----------
1025 -------------------------------------------------------------
1026 -------------------------------------------------------------
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;
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);
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);
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!!!
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!!!
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;
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);
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);
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!!!
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!!!
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;
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);
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);
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!!!
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!!!
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;
1173 V1,V2,V3 : out Real);
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);
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);
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!!!
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!!!
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;
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);
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);
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!!!
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 :
1263 -- * Rational or not Rational.
1265 -- * Knots and multiplicities or "flat knots" without
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.
1273 -- VERY IMPORTANT!!!
1274 -- USE BSplCLib::NoWeights() as Weights argument for non
1275 -- rational curves computations.
1276 ---Warning: To be used for Beziercurves ONLY!!!
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 isPeriodic : in Boolean = Standard_False)
1288 ---Purpose: This evaluates the Bspline Basis at a
1289 -- given parameter Parameter up to the
1290 -- requested DerivativeOrder and store the
1291 -- result in the array BsplineBasis in the
1292 -- following fashion
1293 -- BSplineBasis(1,1) =
1294 -- value of first non vanishing
1295 -- Bspline function which has Index FirstNonZeroBsplineIndex
1296 -- BsplineBasis(1,2) =
1297 -- value of second non vanishing
1298 -- Bspline function which has Index
1299 -- FirstNonZeroBsplineIndex + 1
1300 -- BsplineBasis(1,n) =
1301 -- value of second non vanishing non vanishing
1302 -- Bspline function which has Index
1303 -- FirstNonZeroBsplineIndex + n (n <= Order)
1304 -- BSplineBasis(2,1) =
1305 -- value of derivative of first non vanishing
1306 -- Bspline function which has Index FirstNonZeroBsplineIndex
1307 -- BSplineBasis(N,1) =
1308 -- value of Nth derivative of first non vanishing
1309 -- Bspline function which has Index FirstNonZeroBsplineIndex
1310 -- if N <= DerivativeOrder + 1
1312 BuildBSpMatrix(Parameters : in Array1OfReal from TColStd;
1313 OrderArray : in Array1OfInteger from TColStd;
1314 FlatKnots : in Array1OfReal from TColStd;
1315 Degree : in Integer;
1316 Matrix : in out Matrix from math;
1317 UpperBandWidth : out Integer ;
1318 LowerBandWidth : out Integer) returns Integer ;
1319 ---Purpose: This Builds a fully blown Matrix of
1323 -- with i and j within 1..Order + NumPoles
1324 -- The integer ni is the ith slot of the
1325 -- array OrderArray, tj is the jth slot of
1326 -- the array Parameters
1328 FactorBandedMatrix(Matrix : in out Matrix from math ;
1329 UpperBandWidth : in Integer ;
1330 LowerBandWidth : in Integer ;
1331 PivotIndexProblem : out Integer) returns Integer ;
1332 ---Purpose: this factors the Banded Matrix in
1333 -- the LU form with a Banded storage of
1334 -- components of the L matrix
1335 -- WARNING : do not use if the Matrix is
1336 -- totally positive (It is the case for
1337 -- Bspline matrices build as above with
1338 -- parameters being the Schoenberg points
1340 SolveBandedSystem (Matrix : in Matrix from math ;
1341 UpperBandWidth : in Integer ;
1342 LowerBandWidth : in Integer ;
1343 ArrayDimension : in Integer ;
1344 Array : in out Real)
1346 ---Purpose: This solves the system Matrix.X = B
1347 -- with when Matrix is factored in LU form
1348 -- The Array is an seen as an
1349 -- Array[1..N][1..ArrayDimension] with N =
1350 -- the rank of the matrix Matrix. The
1351 -- result is stored in Array when each
1352 -- coordinate is solved that is B is the
1353 -- array whose values are
1354 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1356 SolveBandedSystem (Matrix : in Matrix from math ;
1357 UpperBandWidth : in Integer ;
1358 LowerBandWidth : in Integer ;
1359 Array : in out Array1OfPnt2d from TColgp)
1361 ---Purpose: This solves the system Matrix.X = B
1362 -- with when Matrix is factored in LU form
1363 -- The Array has the length of
1364 -- the rank of the matrix Matrix. The
1365 -- result is stored in Array when each
1366 -- coordinate is solved that is B is the
1367 -- array whose values are
1368 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1370 SolveBandedSystem (Matrix : in Matrix from math ;
1371 UpperBandWidth : in Integer ;
1372 LowerBandWidth : in Integer ;
1373 Array : in out Array1OfPnt from TColgp)
1375 ---Purpose: This solves the system Matrix.X = B
1376 -- with when Matrix is factored in LU form
1377 -- The Array has the length of
1378 -- the rank of the matrix Matrix. The
1379 -- result is stored in Array when each
1380 -- coordinate is solved that is B is the
1381 -- array whose values are
1382 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1384 SolveBandedSystem (Matrix : in Matrix from math ;
1385 UpperBandWidth : in Integer ;
1386 LowerBandWidth : in Integer ;
1387 HomogenousFlag : in Boolean ;
1388 ArrayDimension : Integer ;
1389 Array : in out Real ;
1390 Weights : in out Real )
1393 SolveBandedSystem (Matrix : in Matrix from math ;
1394 UpperBandWidth : in Integer ;
1395 LowerBandWidth : in Integer ;
1396 HomogenousFlag : in Boolean ;
1397 Array : in out Array1OfPnt2d from TColgp;
1398 Weights : in out Array1OfReal from TColStd )
1400 ---Purpose: This solves the system Matrix.X = B
1401 -- with when Matrix is factored in LU form
1402 -- The Array is an seen as an
1403 -- Array[1..N][1..ArrayDimension] with N =
1404 -- the rank of the matrix Matrix. The
1405 -- result is stored in Array when each
1406 -- coordinate is solved that is B is the
1407 -- array whose values are B[i] =
1408 -- Array[i][p] for each p in
1409 -- 1..ArrayDimension. If HomogeneousFlag ==
1410 -- 0 the Poles are multiplied by the
1411 -- Weights uppon Entry and once
1412 -- interpolation is carried over the
1413 -- result of the poles are divided by the
1414 -- result of the interpolation of the
1415 -- weights. Otherwise if HomogenousFlag == 1
1416 -- the Poles and Weigths are treated homogenously
1417 -- that is that those are interpolated as they
1418 -- are and result is returned without division
1419 -- by the interpolated weigths.
1421 SolveBandedSystem (Matrix : in Matrix from math ;
1422 UpperBandWidth : in Integer ;
1423 LowerBandWidth : in Integer ;
1424 HomogeneousFlag : in Boolean ;
1425 Array : in out Array1OfPnt from TColgp;
1426 Weights : in out Array1OfReal from TColStd )
1428 ---Purpose: This solves the system Matrix.X = B
1429 -- with when Matrix is factored in LU form
1430 -- The Array is an seen as an
1431 -- Array[1..N][1..ArrayDimension] with N =
1432 -- the rank of the matrix Matrix. The
1433 -- result is stored in Array when each
1434 -- coordinate is solved that is B is the
1435 -- array whose values are
1436 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1437 -- If HomogeneousFlag ==
1438 -- 0 the Poles are multiplied by the
1439 -- Weights uppon Entry and once
1440 -- interpolation is carried over the
1441 -- result of the poles are divided by the
1442 -- result of the interpolation of the
1443 -- weights. Otherwise if HomogenousFlag == 1
1444 -- the Poles and Weigths are treated homogenously
1445 -- that is that those are interpolated as they
1446 -- are and result is returned without division
1447 -- by the interpolated weigths.
1449 MergeBSplineKnots(Tolerance : Real from Standard ;
1450 StartValue : Real from Standard ;
1451 EndValue : Real from Standard ;
1452 Degree1 : Integer from Standard ;
1453 Knots1 : Array1OfReal from TColStd ;
1454 Mults1 : Array1OfInteger from TColStd ;
1455 Degree2 : Integer from Standard ;
1456 Knots2 : Array1OfReal from TColStd ;
1457 Mults2 : Array1OfInteger from TColStd ;
1458 NumPoles : in out Integer ;
1459 NewKnots : in out HArray1OfReal from TColStd ;
1460 NewMults : in out HArray1OfInteger from TColStd) ;
1461 ---Purpose: Merges two knot vector by setting the starting and
1462 -- ending values to StartValue and EndValue
1464 FunctionReparameterise(Function : EvaluatorFunction from BSplCLib ;
1465 BSplineDegree : Integer ;
1466 BSplineFlatKnots : Array1OfReal from TColStd ;
1467 PolesDimension : Integer ;
1468 Poles : in out Real ;
1470 FlatKnots : Array1OfReal from TColStd ;
1471 NewDegree : Integer ;
1472 NewPoles : in out Real ;
1473 Status : in out Integer) ;
1474 ---Purpose: This function will compose a given Vectorial BSpline F(t)
1475 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1476 -- its Poles array which are coded as an array of Real
1477 -- of the form [1..NumPoles][1..PolesDimension] with a
1478 -- function a(t) which is assumed to satisfy the
1481 -- 1. F(a(t)) is a polynomial BSpline
1482 -- that can be expressed exactly as a BSpline of degree
1483 -- NewDegree on the knots FlatKnots
1485 -- 2. a(t) defines a differentiable
1486 -- isomorphism between the range of FlatKnots to the range
1487 -- of BSplineFlatKnots which is the
1488 -- same as the range of F(t)
1491 -- the caller's responsability to insure that conditions
1492 -- 1. and 2. above are satisfied : no check whatsoever
1493 -- is made in this method
1495 -- Status will return 0 if OK else it will return the pivot index
1496 -- of the matrix that was inverted to compute the multiplied
1497 -- BSpline : the method used is interpolation at Schoenenberg
1498 -- points of F(a(t))
1500 FunctionReparameterise(
1501 Function : EvaluatorFunction from BSplCLib ;
1502 BSplineDegree : Integer ;
1503 BSplineFlatKnots : Array1OfReal from TColStd ;
1504 Poles : Array1OfReal from TColStd ;
1506 FlatKnots : Array1OfReal from TColStd ;
1507 NewDegree : Integer ;
1508 NewPoles : in out Array1OfReal from TColStd ;
1509 Status : in out Integer) ;
1510 ---Purpose: This function will compose a given Vectorial BSpline F(t)
1511 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1512 -- its Poles array which are coded as an array of Real
1513 -- of the form [1..NumPoles][1..PolesDimension] with a
1514 -- function a(t) which is assumed to satisfy the
1517 -- 1. F(a(t)) is a polynomial BSpline
1518 -- that can be expressed exactly as a BSpline of degree
1519 -- NewDegree on the knots FlatKnots
1521 -- 2. a(t) defines a differentiable
1522 -- isomorphism between the range of FlatKnots to the range
1523 -- of BSplineFlatKnots which is the
1524 -- same as the range of F(t)
1527 -- the caller's responsability to insure that conditions
1528 -- 1. and 2. above are satisfied : no check whatsoever
1529 -- is made in this method
1531 -- Status will return 0 if OK else it will return the pivot index
1532 -- of the matrix that was inverted to compute the multiplied
1533 -- BSpline : the method used is interpolation at Schoenenberg
1534 -- points of F(a(t))
1536 FunctionReparameterise( Function : EvaluatorFunction from BSplCLib ;
1537 BSplineDegree : Integer ;
1538 BSplineFlatKnots : Array1OfReal from TColStd ;
1539 Poles : Array1OfPnt from TColgp ;
1541 FlatKnots : Array1OfReal from TColStd ;
1542 NewDegree : Integer ;
1543 NewPoles : in out Array1OfPnt from TColgp ;
1544 Status : in out Integer) ;
1545 ---Purpose: this will compose a given Vectorial BSpline F(t)
1546 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1547 -- its Poles array which are coded as an array of Real
1548 -- of the form [1..NumPoles][1..PolesDimension] with a
1549 -- function a(t) which is assumed to satisfy the
1550 -- following : 1. F(a(t)) is a polynomial BSpline
1551 -- that can be expressed exactly as a BSpline of degree
1552 -- NewDegree on the knots FlatKnots
1553 -- 2. a(t) defines a differentiable
1554 -- isomorphism between the range of FlatKnots to the range
1555 -- of BSplineFlatKnots which is the
1556 -- same as the range of F(t)
1558 -- the caller's responsability to insure that conditions
1559 -- 1. and 2. above are satisfied : no check whatsoever
1560 -- is made in this method
1561 -- Status will return 0 if OK else it will return the pivot index
1562 -- of the matrix that was inverted to compute the multiplied
1563 -- BSpline : the method used is interpolation at Schoenenberg
1564 -- points of F(a(t))
1566 FunctionReparameterise(
1567 Function : EvaluatorFunction from BSplCLib ;
1568 BSplineDegree : Integer ;
1569 BSplineFlatKnots : Array1OfReal from TColStd ;
1570 Poles : Array1OfPnt2d from TColgp ;
1572 FlatKnots : Array1OfReal from TColStd ;
1573 NewDegree : Integer ;
1574 NewPoles : in out Array1OfPnt2d from TColgp ;
1575 Status : in out Integer) ;
1576 ---Purpose: this will compose a given Vectorial BSpline F(t)
1577 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1578 -- its Poles array which are coded as an array of Real
1579 -- of the form [1..NumPoles][1..PolesDimension] with a
1580 -- function a(t) which is assumed to satisfy the
1581 -- following : 1. F(a(t)) is a polynomial BSpline
1582 -- that can be expressed exactly as a BSpline of degree
1583 -- NewDegree on the knots FlatKnots
1584 -- 2. a(t) defines a differentiable
1585 -- isomorphism between the range of FlatKnots to the range
1586 -- of BSplineFlatKnots which is the
1587 -- same as the range of F(t)
1589 -- the caller's responsability to insure that conditions
1590 -- 1. and 2. above are satisfied : no check whatsoever
1591 -- is made in this method
1592 -- Status will return 0 if OK else it will return the pivot index
1593 -- of the matrix that was inverted to compute the multiplied
1594 -- BSpline : the method used is interpolation at Schoenenberg
1595 -- points of F(a(t))
1597 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1598 BSplineDegree : Integer ;
1599 BSplineFlatKnots : Array1OfReal from TColStd ;
1600 PolesDimension : Integer ;
1601 Poles : in out Real ;
1602 FlatKnots : Array1OfReal from TColStd ;
1603 NewDegree : Integer ;
1604 NewPoles : in out Real ;
1605 Status : in out Integer) ;
1606 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1607 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1608 -- its Poles array which are coded as an array of Real
1609 -- of the form [1..NumPoles][1..PolesDimension] by a
1610 -- function a(t) which is assumed to satisfy the
1611 -- following : 1. a(t) * F(t) is a polynomial BSpline
1612 -- that can be expressed exactly as a BSpline of degree
1613 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1614 -- is the same as the range of F(t)
1616 -- the caller's responsability to insure that conditions
1617 -- 1. and 2. above are satisfied : no check whatsoever
1618 -- is made in this method
1619 -- Status will return 0 if OK else it will return the pivot index
1620 -- of the matrix that was inverted to compute the multiplied
1621 -- BSpline : the method used is interpolation at Schoenenberg
1622 -- points of a(t)*F(t)
1624 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1625 BSplineDegree : Integer ;
1626 BSplineFlatKnots : Array1OfReal from TColStd ;
1627 Poles : Array1OfReal from TColStd ;
1628 FlatKnots : Array1OfReal from TColStd ;
1629 NewDegree : Integer ;
1630 NewPoles : in out Array1OfReal from TColStd ;
1631 Status : in out Integer) ;
1632 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1633 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1634 -- its Poles array which are coded as an array of Real
1635 -- of the form [1..NumPoles][1..PolesDimension] by a
1636 -- function a(t) which is assumed to satisfy the
1637 -- following : 1. a(t) * F(t) is a polynomial BSpline
1638 -- that can be expressed exactly as a BSpline of degree
1639 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1640 -- is the same as the range of F(t)
1642 -- the caller's responsability to insure that conditions
1643 -- 1. and 2. above are satisfied : no check whatsoever
1644 -- is made in this method
1645 -- Status will return 0 if OK else it will return the pivot index
1646 -- of the matrix that was inverted to compute the multiplied
1647 -- BSpline : the method used is interpolation at Schoenenberg
1648 -- points of a(t)*F(t)
1650 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1651 BSplineDegree : Integer ;
1652 BSplineFlatKnots : Array1OfReal from TColStd ;
1653 Poles : Array1OfPnt2d from TColgp ;
1654 FlatKnots : Array1OfReal from TColStd ;
1655 NewDegree : Integer ;
1656 NewPoles : in out Array1OfPnt2d from TColgp ;
1657 Status : in out Integer) ;
1658 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1659 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1660 -- its Poles array which are coded as an array of Real
1661 -- of the form [1..NumPoles][1..PolesDimension] by a
1662 -- function a(t) which is assumed to satisfy the
1663 -- following : 1. a(t) * F(t) is a polynomial BSpline
1664 -- that can be expressed exactly as a BSpline of degree
1665 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1666 -- is the same as the range of F(t)
1668 -- the caller's responsability to insure that conditions
1669 -- 1. and 2. above are satisfied : no check whatsoever
1670 -- is made in this method
1671 -- Status will return 0 if OK else it will return the pivot index
1672 -- of the matrix that was inverted to compute the multiplied
1673 -- BSpline : the method used is interpolation at Schoenenberg
1674 -- points of a(t)*F(t)
1676 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1677 BSplineDegree : Integer ;
1678 BSplineFlatKnots : Array1OfReal from TColStd ;
1679 Poles : Array1OfPnt from TColgp ;
1680 FlatKnots : Array1OfReal from TColStd ;
1681 NewDegree : Integer ;
1682 NewPoles : in out Array1OfPnt from TColgp ;
1683 Status : in out Integer) ;
1684 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1685 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1686 -- its Poles array which are coded as an array of Real
1687 -- of the form [1..NumPoles][1..PolesDimension] by a
1688 -- function a(t) which is assumed to satisfy the
1689 -- following : 1. a(t) * F(t) is a polynomial BSpline
1690 -- that can be expressed exactly as a BSpline of degree
1691 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1692 -- is the same as the range of F(t)
1694 -- the caller's responsability to insure that conditions
1695 -- 1. and 2. above are satisfied : no check whatsoever
1696 -- is made in this method
1697 -- Status will return 0 if OK else it will return the pivot index
1698 -- of the matrix that was inverted to compute the multiplied
1699 -- BSpline : the method used is interpolation at Schoenenberg
1700 -- points of a(t)*F(t)
1703 PeriodicFlag : Boolean ;
1704 DerivativeRequest : Integer ;
1705 ExtrapMode : in out Integer ;
1707 FlatKnots : Array1OfReal from TColStd ;
1708 ArrayDimension : Integer ;
1709 Poles : in out Real ;
1710 Result : in out Real) ;
1711 ---Purpose: Perform the De Boor algorithm to evaluate a point at
1712 -- parameter <U>, with <Degree> and <Dimension>.
1714 -- Poles is an array of Reals of size
1716 -- <Dimension> * <Degree>+1
1718 -- Containing the poles. At the end <Poles> contains
1719 -- the current point. Poles Contain all the poles of
1720 -- the BsplineCurve, Knots also Contains all the knots
1721 -- of the BsplineCurve. ExtrapMode has two slots [0] =
1722 -- Degree used to extrapolate before the first knot [1]
1723 -- = Degre used to extrapolate after the last knot has
1724 -- to be between 1 and Degree
1727 PeriodicFlag : Boolean ;
1728 DerivativeRequest : Integer ;
1729 ExtrapMode : in out Integer ;
1731 FlatKnots : Array1OfReal from TColStd ;
1732 ArrayDimension : Integer ;
1733 Poles : in out Real ;
1734 Weights : in out Real ;
1735 PolesResult : in out Real ;
1736 WeightsResult : in out Real) ;
1737 ---Purpose: Perform the De Boor algorithm to evaluate a point at
1738 -- parameter <U>, with <Degree> and <Dimension>.
1739 -- Evaluates by multiplying the Poles by the Weights and
1740 -- gives the homogeneous result in PolesResult that is
1741 -- the results of the evaluation of the numerator once it
1742 -- has been multiplied by the weights and in
1743 -- WeightsResult one has the result of the evaluation of
1746 -- Warning: <PolesResult> and <WeightsResult> must be dimensionned
1750 PeriodicFlag : Boolean ;
1751 HomogeneousFlag : Boolean ;
1752 ExtrapMode : in out Integer ;
1754 FlatKnots : Array1OfReal from TColStd ;
1755 Poles : Array1OfPnt from TColgp;
1756 Weights : Array1OfReal from TColStd ;
1757 Point : out Pnt from gp ;
1758 Weight : in out Real) ;
1759 ---Purpose: Perform the evaluation of the Bspline Basis
1760 -- and then multiplies by the weights
1761 -- this just evaluates the current point
1764 PeriodicFlag : Boolean ;
1765 HomogeneousFlag : Boolean ;
1766 ExtrapMode : in out Integer ;
1768 FlatKnots : Array1OfReal from TColStd ;
1769 Poles : Array1OfPnt2d from TColgp;
1770 Weights : Array1OfReal from TColStd ;
1771 Point : out Pnt2d from gp ;
1772 Weight : in out Real) ;
1773 ---Purpose: Perform the evaluation of the Bspline Basis
1774 -- and then multiplies by the weights
1775 -- this just evaluates the current point
1778 TangExtendToConstraint(FlatKnots : Array1OfReal from TColStd ;
1779 C1Coefficient : Real ;
1780 NumPoles : in Integer ;
1781 Poles : in out Real ;
1782 Dimension : Integer ;
1784 ConstraintPoint : Array1OfReal from TColStd ;
1785 Continuity : Integer ;
1787 NbPolesResult : in out Integer ;
1788 NbKnotsRsult : in out Integer ;
1789 KnotsResult : in out Real ;
1790 PolesResult : in out Real) ;
1791 ---Purpose: Extend a BSpline nD using the tangency map
1792 -- <C1Coefficient> is the coefficient of reparametrisation
1793 -- <Continuity> must be equal to 1, 2 or 3.
1794 -- <Degree> must be greater or equal than <Continuity> + 1.
1796 -- Warning: <KnotsResult> and <PolesResult> must be dimensionned
1801 CacheParameter : Real;
1803 Poles : Array1OfPnt from TColgp ;
1804 Weights : Array1OfReal from TColStd ;
1805 Point : out Pnt from gp) ;
1806 ---Purpose: Perform the evaluation of the of the cache
1807 -- the parameter must be normalized between
1808 -- the 0 and 1 for the span.
1809 -- The Cache must be valid when calling this
1810 -- routine. Geom Package will insure that.
1811 -- and then multiplies by the weights
1812 -- this just evaluates the current point
1813 -- the CacheParameter is where the Cache was
1814 -- constructed the SpanLength is to normalize
1815 -- the polynomial in the cache to avoid bad conditioning
1820 CacheParameter : Real;
1822 Poles : Array1OfPnt2d from TColgp;
1823 Weights : Array1OfReal from TColStd ;
1824 Point : out Pnt2d from gp) ;
1825 ---Purpose: Perform the evaluation of the Bspline Basis
1826 -- and then multiplies by the weights
1827 -- this just evaluates the current point
1828 -- the parameter must be normalized between
1829 -- the 0 and 1 for the span.
1830 -- The Cache must be valid when calling this
1831 -- routine. Geom Package will insure that.
1832 -- and then multiplies by the weights
1833 -- ththe CacheParameter is where the Cache was
1834 -- constructed the SpanLength is to normalize
1835 -- the polynomial in the cache to avoid bad conditioning
1836 -- effectsis just evaluates the current point
1839 Poles : Array1OfPnt from TColgp ;
1840 Weights : Array1OfReal from TColStd ;
1841 Point : out Pnt from gp) ;
1842 ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with
1843 -- the method PolesCoefficients.
1844 -- Warning: To be used for Beziercurves ONLY!!!
1848 Poles : Array1OfPnt2d from TColgp ;
1849 Weights : Array1OfReal from TColStd ;
1850 Point : out Pnt2d from gp) ;
1851 ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with
1852 -- the method PolesCoefficients.
1853 -- Warning: To be used for Beziercurves ONLY!!!
1858 CacheParameter: Real;
1860 Poles : Array1OfPnt from TColgp ;
1861 Weights : Array1OfReal from TColStd ;
1862 Point : out Pnt from gp ;
1863 Vec : out Vec from gp) ;
1864 ---Purpose: Perform the evaluation of the of the cache
1865 -- the parameter must be normalized between
1866 -- the 0 and 1 for the span.
1867 -- The Cache must be valid when calling this
1868 -- routine. Geom Package will insure that.
1869 -- and then multiplies by the weights
1870 -- this just evaluates the current point
1871 -- the CacheParameter is where the Cache was
1872 -- constructed the SpanLength is to normalize
1873 -- the polynomial in the cache to avoid bad conditioning
1878 CacheParameter : Real;
1880 Poles : Array1OfPnt2d from TColgp;
1881 Weights : Array1OfReal from TColStd ;
1882 Point : out Pnt2d from gp ;
1883 Vec : out Vec2d from gp) ;
1884 ---Purpose: Perform the evaluation of the Bspline Basis
1885 -- and then multiplies by the weights
1886 -- this just evaluates the current point
1887 -- the parameter must be normalized between
1888 -- the 0 and 1 for the span.
1889 -- The Cache must be valid when calling this
1890 -- routine. Geom Package will insure that.
1891 -- and then multiplies by the weights
1892 -- ththe CacheParameter is where the Cache was
1893 -- constructed the SpanLength is to normalize
1894 -- the polynomial in the cache to avoid bad conditioning
1895 -- effectsis just evaluates the current point
1898 Poles : Array1OfPnt from TColgp ;
1899 Weights : Array1OfReal from TColStd ;
1900 Point : out Pnt from gp;
1901 Vec : out Vec from gp) ;
1902 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1903 -- the method PolesCoefficients.
1904 -- Warning: To be used for Beziercurves ONLY!!!
1908 Poles : Array1OfPnt2d from TColgp ;
1909 Weights : Array1OfReal from TColStd ;
1910 Point : out Pnt2d from gp;
1911 Vec : out Vec2d from gp) ;
1912 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1913 -- the method PolesCoefficients.
1914 -- Warning: To be used for Beziercurves ONLY!!!
1919 CacheParameter : Real;
1921 Poles : Array1OfPnt from TColgp ;
1922 Weights : Array1OfReal from TColStd ;
1923 Point : out Pnt from gp ;
1924 Vec1,Vec2 : out Vec from gp) ;
1925 ---Purpose: Perform the evaluation of the of the cache
1926 -- the parameter must be normalized between
1927 -- the 0 and 1 for the span.
1928 -- The Cache must be valid when calling this
1929 -- routine. Geom Package will insure that.
1930 -- and then multiplies by the weights
1931 -- this just evaluates the current point
1932 -- the CacheParameter is where the Cache was
1933 -- constructed the SpanLength is to normalize
1934 -- the polynomial in the cache to avoid bad conditioning
1939 CacheParameter : Real;
1941 Poles : Array1OfPnt2d from TColgp;
1942 Weights : Array1OfReal from TColStd ;
1943 Point : out Pnt2d from gp ;
1944 Vec1,Vec2 : out Vec2d from gp) ;
1945 ---Purpose: Perform the evaluation of the Bspline Basis
1946 -- and then multiplies by the weights
1947 -- this just evaluates the current point
1948 -- the parameter must be normalized between
1949 -- the 0 and 1 for the span.
1950 -- The Cache must be valid when calling this
1951 -- routine. Geom Package will insure that.
1952 -- and then multiplies by the weights
1953 -- ththe CacheParameter is where the Cache was
1954 -- constructed the SpanLength is to normalize
1955 -- the polynomial in the cache to avoid bad conditioning
1956 -- effectsis just evaluates the current point
1959 Poles : Array1OfPnt from TColgp ;
1960 Weights : Array1OfReal from TColStd ;
1961 Point : out Pnt from gp;
1962 Vec1,Vec2 : out Vec from gp) ;
1963 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1964 -- the method PolesCoefficients.
1965 -- Warning: To be used for Beziercurves ONLY!!!
1969 Poles : Array1OfPnt2d from TColgp ;
1970 Weights : Array1OfReal from TColStd ;
1971 Point : out Pnt2d from gp;
1972 Vec1,Vec2 : out Vec2d from gp) ;
1973 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1974 -- the method PolesCoefficients.
1975 -- Warning: To be used for Beziercurves ONLY!!!
1981 CacheParameter : Real;
1983 Poles : Array1OfPnt from TColgp ;
1984 Weights : Array1OfReal from TColStd ;
1985 Point : out Pnt from gp ;
1986 Vec1,Vec2,Vec3 : out Vec from gp) ;
1987 ---Purpose: Perform the evaluation of the of the cache
1988 -- the parameter must be normalized between
1989 -- the 0 and 1 for the span.
1990 -- The Cache must be valid when calling this
1991 -- routine. Geom Package will insure that.
1992 -- and then multiplies by the weights
1993 -- this just evaluates the current point
1994 -- the CacheParameter is where the Cache was
1995 -- constructed the SpanLength is to normalize
1996 -- the polynomial in the cache to avoid bad conditioning
2001 CacheParameter : Real;
2003 Poles : Array1OfPnt2d from TColgp;
2004 Weights : Array1OfReal from TColStd ;
2005 Point : out Pnt2d from gp ;
2006 Vec1,Vec2,Vec3 : out Vec2d from gp) ;
2007 ---Purpose: Perform the evaluation of the Bspline Basis
2008 -- and then multiplies by the weights
2009 -- this just evaluates the current point
2010 -- the parameter must be normalized between
2011 -- the 0 and 1 for the span.
2012 -- The Cache must be valid when calling this
2013 -- routine. Geom Package will insure that.
2014 -- and then multiplies by the weights
2015 -- ththe CacheParameter is where the Cache was
2016 -- constructed the SpanLength is to normalize
2017 -- the polynomial in the cache to avoid bad conditioning
2018 -- effectsis just evaluates the current point
2021 Poles : Array1OfPnt from TColgp ;
2022 Weights : Array1OfReal from TColStd ;
2023 Point : out Pnt from gp;
2024 Vec1,Vec2,Vec3: out Vec from gp) ;
2025 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
2026 -- the method PolesCoefficients.
2027 -- Warning: To be used for Beziercurves ONLY!!!
2031 Poles : Array1OfPnt2d from TColgp ;
2032 Weights : Array1OfReal from TColStd ;
2033 Point : out Pnt2d from gp;
2034 Vec1,Vec2,Vec3: out Vec2d from gp) ;
2035 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
2036 -- the method PolesCoefficients.
2037 -- Warning: To be used for Beziercurves ONLY!!!
2040 BuildCache(U : Real;
2041 InverseOfSpanDomain : Real;
2042 PeriodicFlag : Boolean ;
2044 FlatKnots : Array1OfReal from TColStd ;
2045 Poles : Array1OfPnt from TColgp;
2046 Weights : Array1OfReal from TColStd ;
2047 CachePoles : in out Array1OfPnt from TColgp;
2048 CacheWeights : in out Array1OfReal from TColStd) ;
2049 ---Purpose: Perform the evaluation of the Taylor expansion
2050 -- of the Bspline normalized between 0 and 1.
2051 -- If rational computes the homogeneous Taylor expension
2052 -- for the numerator and stores it in CachePoles
2054 BuildCache(U : Real;
2055 InverseOfSpanDomain : Real;
2056 PeriodicFlag : Boolean ;
2058 FlatKnots : Array1OfReal from TColStd ;
2059 Poles : Array1OfPnt2d from TColgp;
2060 Weights : Array1OfReal from TColStd ;
2061 CachePoles : in out Array1OfPnt2d from TColgp;
2062 CacheWeights : in out Array1OfReal from TColStd) ;
2063 ---Purpose: Perform the evaluation of the Taylor expansion
2064 -- of the Bspline normalized between 0 and 1.
2065 -- If rational computes the homogeneous Taylor expension
2066 -- for the numerator and stores it in CachePoles
2068 BuildCache(theParameter : Real;
2069 theSpanDomain : Real;
2070 thePeriodicFlag : Boolean ;
2071 theDegree : Integer;
2072 theFlatKnots : Array1OfReal from TColStd ;
2073 thePoles : Array1OfPnt from TColgp;
2074 theWeights : Array1OfReal from TColStd ;
2075 theCacheArray : in out Array2OfReal from TColStd) ;
2076 ---Purpose: Perform the evaluation of the Taylor expansion
2077 -- of the Bspline normalized between 0 and 1.
2078 -- Structure of result optimized for BSplCLib_Cache.
2080 BuildCache(theParameter : Real;
2081 theSpanDomain : Real;
2082 thePeriodicFlag : Boolean ;
2083 theDegree : Integer;
2084 theFlatKnots : Array1OfReal from TColStd ;
2085 thePoles : Array1OfPnt2d from TColgp;
2086 theWeights : Array1OfReal from TColStd ;
2087 theCacheArray : in out Array2OfReal from TColStd) ;
2088 ---Purpose: Perform the evaluation of the Taylor expansion
2089 -- of the Bspline normalized between 0 and 1.
2090 -- Structure of result optimized for BSplCLib_Cache.
2092 PolesCoefficients(Poles : Array1OfPnt2d from TColgp;
2093 CachePoles : in out Array1OfPnt2d from TColgp);
2094 ---Warning: To be used for Beziercurves ONLY!!!
2097 PolesCoefficients(Poles : Array1OfPnt2d from TColgp;
2098 Weights : Array1OfReal from TColStd ;
2099 CachePoles : in out Array1OfPnt2d from TColgp;
2100 CacheWeights : in out Array1OfReal from TColStd) ;
2101 ---Warning: To be used for Beziercurves ONLY!!!
2103 PolesCoefficients(Poles : Array1OfPnt from TColgp;
2104 CachePoles : in out Array1OfPnt from TColgp);
2105 ---Warning: To be used for Beziercurves ONLY!!!
2108 PolesCoefficients(Poles : Array1OfPnt from TColgp;
2109 Weights : Array1OfReal from TColStd ;
2110 CachePoles : in out Array1OfPnt from TColgp;
2111 CacheWeights : in out Array1OfReal from TColStd) ;
2112 ---Purpose: Encapsulation of BuildCache to perform the
2113 -- evaluation of the Taylor expansion for beziercurves
2115 -- Warning: To be used for Beziercurves ONLY!!!
2117 FlatBezierKnots (Degree: Integer) returns Real;
2118 ---Purpose: Returns pointer to statically allocated array representing
2119 -- flat knots for bezier curve of the specified degree.
2120 -- Raises OutOfRange if Degree > MaxDegree()
2121 ---C++: return const &
2123 BuildSchoenbergPoints(Degree : Integer ;
2124 FlatKnots : Array1OfReal from TColStd ;
2125 Parameters : in out Array1OfReal from TColStd) ;
2126 ---Purpose: builds the Schoenberg points from the flat knot
2127 -- used to interpolate a BSpline since the
2128 -- BSpline matrix is invertible.
2130 Interpolate(Degree : Integer ;
2131 FlatKnots : Array1OfReal from TColStd ;
2132 Parameters : Array1OfReal from TColStd ;
2133 ContactOrderArray : Array1OfInteger from TColStd ;
2134 Poles : in out Array1OfPnt 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 or interpolation at Scheonberg
2151 -- points the method will work
2152 -- The InversionProblem will report 0 if there was no
2153 -- problem else it will give the index of the faulty
2156 Interpolate(Degree : Integer ;
2157 FlatKnots : Array1OfReal from TColStd ;
2158 Parameters : Array1OfReal from TColStd ;
2159 ContactOrderArray : Array1OfInteger from TColStd ;
2160 Poles : in out Array1OfPnt2d from TColgp ;
2161 InversionProblem : out Integer) ;
2162 ---Purpose: Performs the interpolation of the data given in
2163 -- the Poles array according to the requests in
2164 -- ContactOrderArray that is : if
2165 -- ContactOrderArray(i) has value d it means that
2166 -- Poles(i) containes the dth derivative of the
2167 -- function to be interpolated. The length L of the
2168 -- following arrays must be the same :
2169 -- Parameters, ContactOrderArray, Poles,
2170 -- The length of FlatKnots is Degree + L + 1
2172 -- the method used to do that interpolation is
2173 -- gauss elimination WITHOUT pivoting. Thus if the
2174 -- diagonal is not dominant there is no guarantee
2175 -- that the algorithm will work. Nevertheless for
2176 -- Cubic interpolation at knots or interpolation at Scheonberg
2177 -- points the method will work.
2178 -- The InversionProblem w
2179 -- ll report 0 if there was no
2180 -- problem else it will give the index of the faulty
2183 Interpolate(Degree : Integer ;
2184 FlatKnots : Array1OfReal from TColStd ;
2185 Parameters : Array1OfReal from TColStd ;
2186 ContactOrderArray : Array1OfInteger from TColStd ;
2187 Poles : in out Array1OfPnt from TColgp ;
2188 Weights : in out Array1OfReal from TColStd ;
2189 InversionProblem : out Integer) ;
2190 ---Purpose: Performs the interpolation of the data given in
2191 -- the Poles array according to the requests in
2192 -- ContactOrderArray that is : if
2193 -- ContactOrderArray(i) has value d it means that
2194 -- Poles(i) containes the dth derivative of the
2195 -- function to be interpolated. The length L of the
2196 -- following arrays must be the same :
2197 -- Parameters, ContactOrderArray, Poles,
2198 -- The length of FlatKnots is Degree + L + 1
2200 -- the method used to do that interpolation is
2201 -- gauss elimination WITHOUT pivoting. Thus if the
2202 -- diagonal is not dominant there is no guarantee
2203 -- that the algorithm will work. Nevertheless for
2204 -- Cubic interpolation at knots or interpolation at Scheonberg
2205 -- points the method will work.
2206 -- The InversionProblem will report 0 if there was no
2207 -- problem else it will give the index of the faulty
2212 Interpolate(Degree : Integer ;
2213 FlatKnots : Array1OfReal from TColStd ;
2214 Parameters : Array1OfReal from TColStd ;
2215 ContactOrderArray : Array1OfInteger from TColStd ;
2216 Poles : in out Array1OfPnt2d from TColgp ;
2217 Weights : in out Array1OfReal from TColStd ;
2218 InversionProblem : out Integer) ;
2219 ---Purpose: Performs the interpolation of the data given in
2220 -- the Poles array according to the requests in
2221 -- ContactOrderArray that is : if
2222 -- ContactOrderArray(i) has value d it means that
2223 -- Poles(i) containes the dth derivative of the
2224 -- function to be interpolated. The length L of the
2225 -- following arrays must be the same :
2226 -- Parameters, ContactOrderArray, Poles,
2227 -- The length of FlatKnots is Degree + L + 1
2229 -- the method used to do that interpolation is
2230 -- gauss elimination WITHOUT pivoting. Thus if the
2231 -- diagonal is not dominant there is no guarantee
2232 -- that the algorithm will work. Nevertheless for
2233 -- Cubic interpolation at knots or interpolation at Scheonberg
2234 -- points the method will work.
2235 -- The InversionProblem w
2236 -- ll report 0 if there was no
2237 -- problem else it will give the i
2239 Interpolate(Degree : Integer ;
2240 FlatKnots : Array1OfReal from TColStd ;
2241 Parameters : Array1OfReal from TColStd ;
2242 ContactOrderArray : Array1OfInteger from TColStd ;
2243 ArrayDimension : Integer ;
2244 Poles : in out Real ;
2245 InversionProblem : out Integer) ;
2246 ---Purpose: Performs the interpolation of the data given in
2247 -- the Poles array according to the requests in
2248 -- ContactOrderArray that is : if
2249 -- ContactOrderArray(i) has value d it means that
2250 -- Poles(i) containes the dth derivative of the
2251 -- function to be interpolated. The length L of the
2252 -- following arrays must be the same :
2253 -- Parameters, ContactOrderArray
2254 -- The length of FlatKnots is Degree + L + 1
2255 -- The PolesArray is an seen as an
2256 -- Array[1..N][1..ArrayDimension] with N = tge length
2257 -- of the parameters array
2259 -- the method used to do that interpolation is
2260 -- gauss elimination WITHOUT pivoting. Thus if the
2261 -- diagonal is not dominant there is no guarantee
2262 -- that the algorithm will work. Nevertheless for
2263 -- Cubic interpolation or interpolation at Scheonberg
2264 -- points the method will work
2265 -- The InversionProblem will report 0 if there was no
2266 -- problem else it will give the index of the faulty
2270 Interpolate(Degree : Integer ;
2271 FlatKnots : Array1OfReal from TColStd ;
2272 Parameters : Array1OfReal from TColStd ;
2273 ContactOrderArray : Array1OfInteger from TColStd ;
2274 ArrayDimension : Integer ;
2275 Poles : in out Real ;
2276 Weights : in out Real ;
2277 InversionProblem : out Integer) ;
2279 MovePoint(U : Real; -- parameter of the point
2280 Displ : Vec2d from gp; -- translation vector of the point
2281 Index1 : Integer; -- first movable pole
2282 Index2 : Integer; -- last movable pole
2285 Poles : Array1OfPnt2d from TColgp;
2286 Weights : Array1OfReal from TColStd;
2287 FlatKnots : Array1OfReal from TColStd;
2288 FirstIndex : in out Integer; -- first pole modified
2289 LastIndex : in out Integer; -- last pole modified
2290 NewPoles : in out Array1OfPnt2d from TColgp); -- new poles
2291 ---Purpose: Find the new poles which allows an old point (with a
2292 -- given u as parameter) to reach a new position
2293 -- Index1 and Index2 indicate the range of poles we can move
2294 -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side
2295 -- don't enter (1,NbPoles) -> error: rigid move
2296 -- (2, NbPoles-1) -> the ends are enforced
2297 -- (3, NbPoles-2) -> the ends and the tangency are enforced
2298 -- if Problem in BSplineBasis calculation, no change for the curve
2299 -- and FirstIndex, LastIndex = 0
2301 MovePoint(U : Real; -- parameter of the point
2302 Displ : Vec from gp; -- translation vector of the point
2303 Index1 : Integer; -- first movable pole
2304 Index2 : Integer; -- last movable pole
2307 Poles : Array1OfPnt from TColgp;
2308 Weights : Array1OfReal from TColStd;
2309 FlatKnots : Array1OfReal from TColStd;
2310 FirstIndex : in out Integer; -- first pole modified
2311 LastIndex : in out Integer; -- last pole modified
2312 NewPoles : in out Array1OfPnt from TColgp); -- new poles
2313 ---Purpose: Find the new poles which allows an old point (with a
2314 -- given u as parameter) to reach a new position
2315 -- Index1 and Index2 indicate the range of poles we can move
2316 -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side
2317 -- don't enter (1,NbPoles) -> error: rigid move
2318 -- (2, NbPoles-1) -> the ends are enforced
2319 -- (3, NbPoles-2) -> the ends and the tangency are enforced
2320 -- if Problem in BSplineBasis calculation, no change for the curve
2321 -- and FirstIndex, LastIndex = 0
2323 MovePointAndTangent(U : Real ;
2324 ArrayDimension : Integer ;
2325 Delta : in out Real ;
2326 DeltaDerivative : in out Real ;
2329 Rational : Boolean ;
2330 StartingCondition : Integer ;
2331 EndingCondition : Integer ;
2332 Poles : in out Real ;
2333 Weights : Array1OfReal from TColStd;
2334 FlatKnots : Array1OfReal from TColStd;
2335 NewPoles : in out Real ;
2336 ErrorStatus : in out Integer) ;
2337 ---Purpose: This is the dimension free version of the utility
2338 -- U is the parameter must be within the first FlatKnots and the
2339 -- last FlatKnots Delta is the amount the curve has to be moved
2340 -- DeltaDerivative is the amount the derivative has to be moved.
2341 -- Delta and DeltaDerivative must be array of dimension
2342 -- ArrayDimension Degree is the degree of the BSpline and the
2343 -- FlatKnots are the knots of the BSpline Starting Condition if =
2344 -- -1 means the starting point of the curve can move
2346 -- starting point of the cuve cannot move but tangen starting
2347 -- point of the curve cannot move
2348 -- = 1 means the starting point and tangents cannot move
2349 -- = 2 means the starting point tangent and curvature cannot move
2351 -- Same holds for EndingCondition
2352 -- Poles are the poles of the curve
2353 -- Weights are the weights of the curve if Rational = Standard_True
2354 -- NewPoles are the poles of the deformed curve
2355 -- ErrorStatus will be 0 if no error happened
2356 -- 1 if there are not enough knots/poles
2357 -- the imposed conditions
2358 -- The way to solve this problem is to add knots to the BSpline
2359 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2360 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2361 -- have at least 2 internal knots.
2363 MovePointAndTangent(U : Real ;
2364 Delta : Vec from gp ;
2365 DeltaDerivative : Vec from gp ;
2368 Rational : Boolean ;
2369 StartingCondition : Integer ;
2370 EndingCondition : Integer ;
2371 Poles : Array1OfPnt from TColgp ;
2372 Weights : Array1OfReal from TColStd;
2373 FlatKnots : Array1OfReal from TColStd;
2374 NewPoles : in out Array1OfPnt from TColgp ;
2375 ErrorStatus : in out Integer) ;
2376 ---Purpose: This is the dimension free version of the utility
2377 -- U is the parameter must be within the first FlatKnots and the
2378 -- last FlatKnots Delta is the amount the curve has to be moved
2379 -- DeltaDerivative is the amount the derivative has to be moved.
2380 -- Delta and DeltaDerivative must be array of dimension
2381 -- ArrayDimension Degree is the degree of the BSpline and the
2382 -- FlatKnots are the knots of the BSpline Starting Condition if =
2383 -- -1 means the starting point of the curve can move
2385 -- starting point of the cuve cannot move but tangen starting
2386 -- point of the curve cannot move
2387 -- = 1 means the starting point and tangents cannot move
2388 -- = 2 means the starting point tangent and curvature cannot move
2390 -- Same holds for EndingCondition
2391 -- Poles are the poles of the curve
2392 -- Weights are the weights of the curve if Rational = Standard_True
2393 -- NewPoles are the poles of the deformed curve
2394 -- ErrorStatus will be 0 if no error happened
2395 -- 1 if there are not enough knots/poles
2396 -- the imposed conditions
2397 -- The way to solve this problem is to add knots to the BSpline
2398 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2399 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2400 -- have at least 2 internal knots.
2402 MovePointAndTangent(U : Real ;
2403 Delta : Vec2d from gp ;
2404 DeltaDerivative : Vec2d from gp ;
2407 Rational : Boolean ;
2408 StartingCondition : Integer ;
2409 EndingCondition : Integer ;
2410 Poles : Array1OfPnt2d from TColgp ;
2411 Weights : Array1OfReal from TColStd ;
2412 FlatKnots : Array1OfReal from TColStd ;
2413 NewPoles : in out Array1OfPnt2d from TColgp ;
2414 ErrorStatus : in out Integer) ;
2415 ---Purpose: This is the dimension free version of the utility
2416 -- U is the parameter must be within the first FlatKnots and the
2417 -- last FlatKnots Delta is the amount the curve has to be moved
2418 -- DeltaDerivative is the amount the derivative has to be moved.
2419 -- Delta and DeltaDerivative must be array of dimension
2420 -- ArrayDimension Degree is the degree of the BSpline and the
2421 -- FlatKnots are the knots of the BSpline Starting Condition if =
2422 -- -1 means the starting point of the curve can move
2424 -- starting point of the cuve cannot move but tangen starting
2425 -- point of the curve cannot move
2426 -- = 1 means the starting point and tangents cannot move
2427 -- = 2 means the starting point tangent and curvature cannot move
2429 -- Same holds for EndingCondition
2430 -- Poles are the poles of the curve
2431 -- Weights are the weights of the curve if Rational = Standard_True
2432 -- NewPoles are the poles of the deformed curve
2433 -- ErrorStatus will be 0 if no error happened
2434 -- 1 if there are not enough knots/poles
2435 -- the imposed conditions
2436 -- The way to solve this problem is to add knots to the BSpline
2437 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2438 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2439 -- have at least 2 internal knots.
2441 Resolution( PolesArray : in out Real ;
2442 ArrayDimension : Integer ;
2443 NumPoles : Integer ;
2444 Weights : in Array1OfReal from TColStd;
2445 FlatKnots : in Array1OfReal from TColStd;
2446 Degree : in Integer;
2447 Tolerance3D : Real from Standard ;
2448 UTolerance : out Real from Standard) ;
2450 -- given a tolerance in 3D space returns a
2451 -- tolerance in U parameter space such that
2452 -- all u1 and u0 in the domain of the curve f(u)
2453 -- | u1 - u0 | < UTolerance and
2454 -- we have |f (u1) - f (u0)| < Tolerance3D
2456 Resolution( Poles : in Array1OfPnt from TColgp ;
2457 Weights : in Array1OfReal from TColStd ;
2458 NumPoles : in Integer from Standard ;
2459 FlatKnots : in Array1OfReal from TColStd ;
2460 Degree : in Integer from Standard ;
2461 Tolerance3D : Real from Standard ;
2462 UTolerance : out Real from Standard) ;
2464 -- given a tolerance in 3D space returns a
2465 -- tolerance in U parameter space such that
2466 -- all u1 and u0 in the domain of the curve f(u)
2467 -- | u1 - u0 | < UTolerance and
2468 -- we have |f (u1) - f (u0)| < Tolerance3D
2470 Resolution( Poles : in Array1OfPnt2d from TColgp ;
2471 Weights : in Array1OfReal from TColStd ;
2472 NumPoles : in Integer from Standard ;
2473 FlatKnots : in Array1OfReal from TColStd ;
2474 Degree : in Integer ;
2475 Tolerance3D : Real from Standard ;
2476 UTolerance : out Real from Standard) ;
2478 -- given a tolerance in 3D space returns a
2479 -- tolerance in U parameter space such that
2480 -- all u1 and u0 in the domain of the curve f(u)
2481 -- | u1 - u0 | < UTolerance and
2482 -- we have |f (u1) - f (u0)| < Tolerance3D