1 -- Created on: 1991-08-09
2 -- Created by: Jean Claude VAUTHIER
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 --Modified : RLE Aug 1993 Major modifications.
22 -- 15-Mar-95 xab : added cache mecanism to speed up
24 -- 25-Mar-95 xab : added Lagrange evaluator
25 -- mei : modified 08-Jun-95 : added method MovePoint
26 -- xab : modified 11-Mar-96 : added method MovePointAndTangent
27 -- xab : modified 18-Mar-97 : added method to reparameterise a bspline
28 -- jct : modified 15-Apr-97 : added method to extend a bspline
32 ---Purpose: BSplCLib B-spline curve Library.
34 -- The BSplCLib package is a basic library for BSplines. It
35 -- provides three categories of functions.
37 -- * Management methods to process knots and multiplicities.
39 -- * Multi-Dimensions spline methods. BSpline methods where
40 -- poles have an arbitrary number of dimensions. They divides
43 -- - Global methods modifying the whole set of poles. The
44 -- poles are described by an array of Reals and a
45 -- Dimension. Example : Inserting knots.
47 -- - Local methods computing points and derivatives. The
48 -- poles are described by a pointer on a local array of
49 -- Reals and a Dimension. The local array is modified.
51 -- * 2D and 3D spline curves methods.
53 -- Methods for 2d and 3d BSplines curves rational or not
56 -- Those methods have the following structure :
58 -- - They extract the pole informations in a working array.
60 -- - They process the working array with the
61 -- multi-dimension methods. (for example a 3d rational
62 -- curve is processed as a 4 dimension curve).
64 -- - They get back the result in the original dimension.
66 -- Note that the bspline surface methods found in the
67 -- package BSplSLib uses the same structure and rely on
70 -- In the following list of methods the 2d and 3d curve
71 -- methods will be described with the corresponding
72 -- multi-dimension method.
74 -- The 3d or 2d B-spline curve is defined with :
76 -- . its control points : TColgp_Array1OfPnt(2d) Poles
77 -- . its weights : TColStd_Array1OfReal Weights
78 -- . its knots : TColStd_Array1OfReal Knots
79 -- . its multiplicities : TColStd_Array1OfInteger Mults
80 -- . its degree : Standard_Integer Degree
81 -- . its periodicity : Standard_Boolean Periodic
84 -- The bounds of Poles and Weights should be the same.
85 -- The bounds of Knots and Mults should be the same.
87 -- Weights can be a null reference (BSplCLib::NoWeights())
88 -- the curve is non rational.
90 -- Mults can be a null reference (BSplCLib::NoMults())
91 -- the knots are "flat" knots.
94 -- B-spline curve, Functions, Library
97 -- . A survey of curves and surfaces methods in CADG Wolfgang
99 -- . On de Boor-like algorithms and blossoming Wolfgang BOEHM
101 -- . Blossoming and knot insertion algorithms for B-spline curves
103 -- . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA
104 -- . Curves and Surfaces for Computer Aided Geometric Design,
105 -- a practical guide Gerald Farin
107 uses TColStd, gp, TColgp, math, GeomAbs
112 imported EvaluatorFunction ;
113 ---Purpose: this is a one dimensional function
114 -- typedef void (*EvaluatorFunction) (
115 -- Standard_Integer // Derivative Request
116 -- Standard_Real * // StartEnd[2]
117 -- Standard_Real // Parameter
118 -- Standard_Real & // Result
119 -- Standard_Integer &) ;// Error Code
120 -- serves to multiply a given vectorial BSpline by a function
122 enumeration KnotDistribution is NonUniform, Uniform;
123 ---Purpose: This enumeration describes the repartition of the
124 -- knots sequence. If all the knots differ by the
125 -- same positive constant from the preceding knot the
126 -- "KnotDistribution" is <Uniform> else it is
129 enumeration MultDistribution is NonConstant, Constant, QuasiConstant;
130 ---Purpose: This enumeration describes the form of the
131 -- sequence of mutiplicities. MultDistribution is :
133 -- Constant if all the multiplicities have the same
136 -- QuasiConstant if all the internal knots have the
137 -- same multiplicity and if the first and last knot
138 -- have a different multiplicity.
140 -- NonConstant in other cases.
142 -------------------------------------------------------------
143 -------------------------------------------------------------
144 ---------- ----------
145 ---------- Knots and Multiplicities ----------
146 ---------- ----------
147 -------------------------------------------------------------
148 -------------------------------------------------------------
150 Hunt (XX : in Array1OfReal from TColStd;
152 Iloc : in out Integer);
153 ---Purpose: This routine searches the position of the real
154 -- value X in the ordered set of real values XX.
156 -- The elements in the table XX are either
157 -- monotonically increasing or monotonically
160 -- The input value Iloc is used to initialize the
161 -- algorithm : if Iloc is outside of the bounds
162 -- [XX.Lower(), -- XX.Upper()] the bisection algorithm
163 -- is used else the routine searches from a previous
164 -- known position by increasing steps then converges
167 -- This routine is used to locate a knot value in a
170 ---References : Numerical Recipes in C (William H.Press, Brian
171 -- P. Flannery, Saul A. Teukolsky, William T.
174 FirstUKnotIndex (Degree : Integer;
175 Mults : Array1OfInteger from TColStd)
177 ---Purpose: Computes the index of the knots value which gives
178 -- the start point of the curve.
181 LastUKnotIndex (Degree : Integer;
182 Mults : Array1OfInteger from TColStd)
184 ---Purpose: Computes the index of the knots value which gives
185 -- the end point of the curve.
187 FlatIndex (Degree : Integer;
189 Mults : Array1OfInteger from TColStd;
192 ---Purpose: Computes the index of the flats knots sequence
193 -- corresponding to <Index> in the knots sequence
194 -- which multiplicities are <Mults>.
196 LocateParameter (Degree : Integer;
197 Knots : Array1OfReal from TColStd;
198 Mults : Array1OfInteger from TColStd;
200 IsPeriodic : Boolean;
203 KnotIndex : in out Integer;
205 ---Purpose: Locates the parametric value U in the knots
206 -- sequence between the knot K1 and the knot K2.
207 -- The value return in Index verifies.
209 -- Knots(Index) <= U < Knots(Index + 1)
210 -- if U <= Knots (K1) then Index = K1
211 -- if U >= Knots (K2) then Index = K2 - 1
213 -- If Periodic is True U may be modified to fit in
214 -- the range Knots(K1), Knots(K2). In any case the
215 -- correct value is returned in NewU.
217 -- Warnings :Index is used as input data to initialize the
218 -- searching function.
219 -- Warning: Knots have to be "withe repetitions"
221 LocateParameter (Degree : Integer;
222 Knots : Array1OfReal from TColStd;
224 IsPeriodic : Boolean;
227 KnotIndex : in out Integer;
229 ---Purpose: Locates the parametric value U in the knots
230 -- sequence between the knot K1 and the knot K2.
231 -- The value return in Index verifies.
233 -- Knots(Index) <= U < Knots(Index + 1)
234 -- if U <= Knots (K1) then Index = K1
235 -- if U >= Knots (K2) then Index = K2 - 1
237 -- If Periodic is True U may be modified to fit in
238 -- the range Knots(K1), Knots(K2). In any case the
239 -- correct value is returned in NewU.
241 -- Warnings :Index is used as input data to initialize the
242 -- searching function.
243 -- Warning: Knots have to be "flat"
245 LocateParameter (Knots : Array1OfReal from TColStd;
249 Index : in out Integer;
255 LocateParameter (Degree : Integer;
256 Knots : Array1OfReal from TColStd;
257 Mults : Array1OfInteger from TColStd;
260 Index : in out Integer;
264 MaxKnotMult (Mults : Array1OfInteger from TColStd;
267 ---Purpose: Finds the greatest multiplicity in a set of knots
268 -- between K1 and K2. Mults is the multiplicity
269 -- associated with each knot value.
271 MinKnotMult (Mults : Array1OfInteger from TColStd;
274 ---Purpose: Finds the lowest multiplicity in a set of knots
275 -- between K1 and K2. Mults is the multiplicity
276 -- associated with each knot value.
278 NbPoles(Degree : Integer;
280 Mults : Array1OfInteger from TColStd)
282 ---Purpose: Returns the number of poles of the curve. Returns 0 if
283 -- one of the multiplicities is incorrect.
287 -- * Greater than Degree, or Degree+1 at the first and
288 -- last knot of a non periodic curve.
290 -- * The last periodicity on a periodic curve is not
291 -- equal to the first.
293 KnotSequenceLength(Mults : Array1OfInteger from TColStd;
297 ---Purpose: Returns the length of the sequence of knots with
302 -- Sum(Mults(i), i = Mults.Lower(); i <= Mults.Upper());
306 -- Sum(Mults(i); i = Mults.Lower(); i < Mults.Upper())
309 KnotSequence (Knots : Array1OfReal from TColStd;
310 Mults : Array1OfInteger from TColStd;
311 KnotSeq : in out Array1OfReal from TColStd);
313 KnotSequence (Knots : Array1OfReal from TColStd;
314 Mults : Array1OfInteger from TColStd;
317 KnotSeq : in out Array1OfReal from TColStd);
318 ---Purpose: Computes the sequence of knots KnotSeq with
319 -- repetition of the knots of multiplicity greater
322 -- Length of KnotSeq must be KnotSequenceLength(Mults,Degree,Periodic)
324 KnotsLength( KnotSeq : Array1OfReal from TColStd;
325 Periodic : Boolean = Standard_False)
327 ---Purpose: Returns the length of the sequence of knots (and
328 -- Mults) without repetition.
330 Knots( KnotSeq : Array1OfReal from TColStd;
331 Knots : out Array1OfReal from TColStd;
332 Mults : out Array1OfInteger from TColStd;
333 Periodic : Boolean = Standard_False);
334 ---Purpose: Computes the sequence of knots Knots without
335 -- repetition of the knots of multiplicity greater
338 -- Length of <Knots> and <Mults> must be
339 -- KnotsLength(KnotSequence,Periodic)
341 KnotForm (Knots : Array1OfReal from TColStd;
342 FromK1, ToK2 : Integer)
343 returns KnotDistribution;
344 ---Purpose: Analyses if the knots distribution is "Uniform"
345 -- or "NonUniform" between the knot FromK1 and the
346 -- knot ToK2. There is no repetition of knot in the
347 -- knots'sequence <Knots>.
349 MultForm (Mults : Array1OfInteger from TColStd;
350 FromK1, ToK2 : Integer)
351 returns MultDistribution;
353 -- Analyses the distribution of multiplicities between
354 -- the knot FromK1 and the Knot ToK2.
356 KnotAnalysis (Degree : Integer;
358 CKnots : Array1OfReal from TColStd;
359 CMults : Array1OfInteger from TColStd;
360 KnotForm : out BSplKnotDistribution from GeomAbs;
361 MaxKnotMult: out Integer);
362 ---Purpose: Analyzes the array of knots.
363 -- Returns the form and the maximum knot multiplicity.
365 Reparametrize (U1, U2 : Real;
366 Knots : in out Array1OfReal from TColStd);
368 -- Reparametrizes a B-spline curve to [U1, U2].
369 -- The knot values are recomputed such that Knots (Lower) = U1
370 -- and Knots (Upper) = U2 but the knot form is not modified.
372 -- In the array Knots the values must be in ascending order.
373 -- U1 must not be equal to U2 to avoid division by zero.
376 Reverse (Knots : in out Array1OfReal from TColStd);
377 ---Purpose: Reverses the array knots to become the knots
378 -- sequence of the reversed curve.
380 Reverse (Mults : in out Array1OfInteger from TColStd);
381 ---Purpose: Reverses the array of multiplicities.
383 Reverse (Poles : in out Array1OfPnt from TColgp;
385 ---Purpose: Reverses the array of poles. Last is the index of
386 -- the new first pole. On a non periodic curve last
387 -- is Poles.Upper(). On a periodic curve last is
389 -- (number of flat knots - degree - 1)
393 -- (sum of multiplicities(but for the last) + degree
396 Reverse (Poles : in out Array1OfPnt2d from TColgp;
398 ---Purpose: Reverses the array of poles.
400 Reverse (Weights : in out Array1OfReal from TColStd;
402 ---Purpose: Reverses the array of poles.
404 IsRational(Weights : Array1OfReal from TColStd;
406 Epsilon : Real = 0.0) returns Boolean;
408 -- Returns False if all the weights of the array <Weights>
409 -- between I1 an I2 are identic. Epsilon is used for
410 -- comparing weights. If Epsilon is 0. the Epsilon of the
411 -- first weight is used.
413 MaxDegree returns Integer;
414 ---Purpose: returns the degree maxima for a BSplineCurve.
421 Poles : in out Real);
422 ---Purpose: Perform the Boor algorithm to evaluate a point at
423 -- parameter <U>, with <Degree> and <Dimension>.
425 -- Poles is an array of Reals of size
427 -- <Dimension> * <Degree>+1
429 -- Containing the poles. At the end <Poles> contains
430 -- the current point.
439 ---Purpose: Performs the Boor Algorithm at parameter <U> with
440 -- the given <Degree> and the array of <Knots> on the
441 -- poles <Poles> of dimension <Dimension>. The schema
442 -- is computed until level <Depth> on a basis of
445 -- * Knots is an array of reals of length :
447 -- <Length> + <Degree>
449 -- * Poles is an array of reals of length :
451 -- (2 * <Length> + 1) * <Dimension>
453 -- The poles values must be set in the array at the
466 -- The results are found in the array poles depending
467 -- on the Depth. (See the method GetPole).
469 AntiBoorScheme(U : Real;
476 Tolerance : Real) returns Boolean;
477 ---Purpose: Compute the content of Pole before the BoorScheme.
478 -- This method is used to remove poles.
480 -- U is the poles to remove, Knots should contains the
481 -- knots of the curve after knot removal.
483 -- The first and last poles do not change, the other
484 -- poles are computed by averaging two possible values.
485 -- The distance between the two possible poles is
486 -- computed, if it is higher than <Tolerance> False is
489 Derivative(Degree : Integer;
494 Poles : in out Real);
495 ---Purpose: Computes the poles of the BSpline giving the
496 -- derivatives of order <Order>.
498 -- The formula for the first order is
500 -- Pole(i) = Degree * (Pole(i+1) - Pole(i)) /
501 -- (Knots(i+Degree+1) - Knots(i+1))
503 -- This formula is repeated (Degree is decremented at
511 Poles : in out Real);
512 ---Purpose: Performs the Bohm Algorithm at parameter <U>. This
513 -- algorithm computes the value and all the derivatives
514 -- up to order N (N <= Degree).
516 -- <Poles> is the original array of poles.
518 -- The result in <Poles> is the value and the
519 -- derivatives. Poles[0] is the value, Poles[Degree]
520 -- is the last derivative.
523 NoWeights returns Array1OfReal from TColStd;
524 ---Purpose: Used as argument for a non rational curve.
529 NoMults returns Array1OfInteger from TColStd;
530 ---Purpose: Used as argument for a flatknots evaluation.
535 BuildKnots(Degree, Index : Integer;
537 Knots : Array1OfReal from TColStd;
538 Mults : Array1OfInteger from TColStd;
540 ---Purpose: Stores in LK the usefull knots for the BoorSchem
541 -- on the span Knots(Index) - Knots(Index+1)
543 PoleIndex (Degree, Index : Integer;
545 Mults : Array1OfInteger from TColStd)
547 ---Purpose: Return the index of the first Pole to use on the
548 -- span Mults(Index) - Mults(Index+1). This index
549 -- must be added to Poles.Lower().
551 BuildEval(Degree,Index : Integer;
552 Poles : Array1OfReal from TColStd;
553 Weights : Array1OfReal from TColStd;
556 BuildEval(Degree,Index : Integer;
557 Poles : Array1OfPnt from TColgp;
558 Weights : Array1OfReal from TColStd;
561 BuildEval(Degree,Index : Integer;
562 Poles : Array1OfPnt2d from TColgp;
563 Weights : Array1OfReal from TColStd;
565 ---Purpose: Copy in <LP> the poles and weights for the Eval
566 -- scheme. starting from Poles(Poles.Lower()+Index)
568 BuildBoor(Index,Length,Dimension : Integer;
569 Poles : Array1OfReal from TColStd;
571 ---Purpose: Copy in <LP> poles for <Dimension> Boor scheme.
572 -- Starting from <Index> * <Dimension>, copy
576 BoorIndex(Index, Length, Depth : Integer)
578 ---Purpose: Returns the index in the Boor result array of the
579 -- poles <Index>. If the Boor algorithm was perform
580 -- with <Length> and <Depth>.
582 GetPole(Index,Length,Depth,Dimension : Integer;
583 LocPoles : in out Real;
584 Position : in out Integer;
585 Pole : in out Array1OfReal from TColStd);
586 ---Purpose: Copy the pole at position <Index> in the Boor
587 -- scheme of dimension <Dimension> to <Position> in
588 -- the array <Pole>. <Position> is updated.
592 Periodic : in Boolean;
593 Knots : in Array1OfReal from TColStd;
594 Mults : in Array1OfInteger from TColStd;
595 AddKnots : in Array1OfReal from TColStd;
596 AddMults : in Array1OfInteger from TColStd;
597 NbPoles : out Integer;
598 NbKnots : out Integer;
600 Add : in Boolean = Standard_True)
602 ---Purpose: Returns in <NbPoles, NbKnots> the new number of poles
603 -- and knots if the sequence of knots <AddKnots,
604 -- AddMults> is inserted in the sequence <Knots, Mults>.
606 -- Epsilon is used to compare knots for equality.
608 -- If Add is True the multiplicities on equal knots are
611 -- If Add is False the max value of the multiplicities is
615 -- The knew knots are knot increasing.
616 -- The new knots are not in the range.
620 Periodic : in Boolean;
621 Dimension : in Integer;
622 Poles : in Array1OfReal from TColStd;
623 Knots : in Array1OfReal from TColStd;
624 Mults : in Array1OfInteger from TColStd;
625 AddKnots : in Array1OfReal from TColStd;
626 AddMults : in Array1OfInteger from TColStd;
627 NewPoles : out Array1OfReal from TColStd;
628 NewKnots : out Array1OfReal from TColStd;
629 NewMults : out Array1OfInteger from TColStd;
631 Add : in Boolean = Standard_True);
635 Periodic : in Boolean;
636 Poles : in Array1OfPnt from TColgp;
637 Weights : in Array1OfReal from TColStd;
638 Knots : in Array1OfReal from TColStd;
639 Mults : in Array1OfInteger from TColStd;
640 AddKnots : in Array1OfReal from TColStd;
641 AddMults : in Array1OfInteger from TColStd;
642 NewPoles : out Array1OfPnt from TColgp;
643 NewWeights : out Array1OfReal from TColStd;
644 NewKnots : out Array1OfReal from TColStd;
645 NewMults : out Array1OfInteger from TColStd;
647 Add : in Boolean = Standard_True);
651 Periodic : in Boolean;
652 Poles : in Array1OfPnt2d from TColgp;
653 Weights : in Array1OfReal from TColStd;
654 Knots : in Array1OfReal from TColStd;
655 Mults : in Array1OfInteger from TColStd;
656 AddKnots : in Array1OfReal from TColStd;
657 AddMults : in Array1OfInteger from TColStd;
658 NewPoles : out Array1OfPnt2d from TColgp;
659 NewWeights : out Array1OfReal from TColStd;
660 NewKnots : out Array1OfReal from TColStd;
661 NewMults : out Array1OfInteger from TColStd;
663 Add : in Boolean = Standard_True);
664 ---Purpose: Insert a sequence of knots <AddKnots> with
665 -- multiplicities <AddMults>. <AddKnots> must be a non
666 -- decreasing sequence and verifies :
668 -- Knots(Knots.Lower()) <= AddKnots(AddKnots.Lower())
669 -- Knots(Knots.Upper()) >= AddKnots(AddKnots.Upper())
671 -- The NewPoles and NewWeights arrays must have a length :
672 -- Poles.Length() + Sum(AddMults())
674 -- When a knot to insert is identic to an existing knot the
675 -- multiplicities are added.
677 -- Epsilon is used to test knots for equality.
679 -- When AddMult is negative or null the knot is not inserted.
680 -- No multiplicity will becomes higher than the degree.
682 -- The new Knots and Multiplicities are copied in <NewKnots>
685 -- All the New arrays should be correctly dimensioned.
687 -- When all the new knots are existing knots, i.e. only the
688 -- multiplicities will change it is safe to use the same
689 -- arrays as input and output.
696 Periodic : in Boolean;
697 Poles : in Array1OfPnt from TColgp;
698 Weights : in Array1OfReal from TColStd;
699 Knots : in Array1OfReal from TColStd;
700 Mults : in Array1OfInteger from TColStd;
701 NewPoles : out Array1OfPnt from TColgp;
702 NewWeights : out Array1OfReal from TColStd);
709 Periodic : in Boolean;
710 Poles : in Array1OfPnt2d from TColgp;
711 Weights : in Array1OfReal from TColStd;
712 Knots : in Array1OfReal from TColStd;
713 Mults : in Array1OfInteger from TColStd;
714 NewPoles : out Array1OfPnt2d from TColgp;
715 NewWeights : out Array1OfReal from TColStd);
716 ---Purpose: Insert a new knot U of multiplicity UMult in the
719 -- The location of the new Knot should be given as an input
720 -- data. UIndex locates the new knot U in the knot sequence
721 -- and Knots (UIndex) < U < Knots (UIndex + 1).
723 -- The new control points corresponding to this insertion are
724 -- returned. Knots and Mults are not updated.
727 KnotIndex : in Integer;
730 Periodic : in Boolean;
731 Poles : in Array1OfPnt from TColgp;
732 Weights : in Array1OfReal from TColStd;
733 Knots : in Array1OfReal from TColStd;
734 Mults : in Array1OfInteger from TColStd;
735 NewPoles : out Array1OfPnt from TColgp;
736 NewWeights : out Array1OfReal from TColStd);
739 KnotIndex : in Integer;
742 Periodic : in Boolean;
743 Poles : in Array1OfPnt2d from TColgp;
744 Weights : in Array1OfReal from TColStd;
745 Knots : in Array1OfReal from TColStd;
746 Mults : in Array1OfInteger from TColStd;
747 NewPoles : out Array1OfPnt2d from TColgp;
748 NewWeights : out Array1OfReal from TColStd);
749 ---Purpose: Raise the multiplicity of knot to <UMult>.
751 -- The new control points are returned. Knots and Mults are
758 Periodic : in Boolean;
759 Dimension : in Integer;
760 Poles : in Array1OfReal from TColStd;
761 Knots : in Array1OfReal from TColStd;
762 Mults : in Array1OfInteger from TColStd;
763 NewPoles : out Array1OfReal from TColStd;
764 NewKnots : out Array1OfReal from TColStd;
765 NewMults : out Array1OfInteger from TColStd;
766 Tolerance : Real) returns Boolean;
772 Periodic : in Boolean;
773 Poles : in Array1OfPnt from TColgp;
774 Weights : in Array1OfReal from TColStd;
775 Knots : in Array1OfReal from TColStd;
776 Mults : in Array1OfInteger from TColStd;
777 NewPoles : out Array1OfPnt from TColgp;
778 NewWeights : out Array1OfReal from TColStd;
779 NewKnots : out Array1OfReal from TColStd;
780 NewMults : out Array1OfInteger from TColStd;
781 Tolerance : Real) returns Boolean;
787 Periodic : in Boolean;
788 Poles : in Array1OfPnt2d from TColgp;
789 Weights : in Array1OfReal from TColStd;
790 Knots : in Array1OfReal from TColStd;
791 Mults : in Array1OfInteger from TColStd;
792 NewPoles : out Array1OfPnt2d from TColgp;
793 NewWeights : out Array1OfReal from TColStd;
794 NewKnots : out Array1OfReal from TColStd;
795 NewMults : out Array1OfInteger from TColStd;
796 Tolerance : Real) returns Boolean;
797 ---Purpose: Decrement the multiplicity of <Knots(Index)>
798 -- to <Mult>. If <Mult> is null the knot is
801 -- As there are two ways to compute the new poles
802 -- the midlle will be used as long as the
803 -- distance is lower than Tolerance.
805 -- If a distance is bigger than tolerance the
806 -- methods returns False and the new arrays are
809 -- A low tolerance can be used to test if the
810 -- knot can be removed without modifying the
813 -- A high tolerance can be used to "smooth" the
817 IncreaseDegreeCountKnots (Degree, NewDegree : Integer;
819 Mults : Array1OfInteger from TColStd)
821 ---Purpose: Returns the number of knots of a curve with
822 -- multiplicities <Mults> after elevating the degree from
823 -- <Degree> to <NewDegree>. See the IncreaseDegree method
824 -- for more comments.
826 IncreaseDegree (Degree,
827 NewDegree : in Integer;
828 Periodic : in Boolean;
829 Dimension : in Integer;
830 Poles : in Array1OfReal from TColStd;
831 Knots : in Array1OfReal from TColStd;
832 Mults : in Array1OfInteger from TColStd;
833 NewPoles : in out Array1OfReal from TColStd;
834 NewKnots : in out Array1OfReal from TColStd;
835 NewMults : in out Array1OfInteger from TColStd);
837 IncreaseDegree (Degree,
838 NewDegree : in Integer;
839 Periodic : in Boolean;
840 Poles : in Array1OfPnt from TColgp;
841 Weights : in Array1OfReal from TColStd;
842 Knots : in Array1OfReal from TColStd;
843 Mults : in Array1OfInteger from TColStd;
844 NewPoles : in out Array1OfPnt from TColgp;
845 NewWeights : in out Array1OfReal from TColStd;
846 NewKnots : in out Array1OfReal from TColStd;
847 NewMults : in out Array1OfInteger from TColStd);
849 IncreaseDegree (Degree,
850 NewDegree : in Integer;
851 Periodic : in Boolean;
852 Poles : in Array1OfPnt2d from TColgp;
853 Weights : in Array1OfReal from TColStd;
854 Knots : in Array1OfReal from TColStd;
855 Mults : in Array1OfInteger from TColStd;
856 NewPoles : in out Array1OfPnt2d from TColgp;
857 NewWeights : in out Array1OfReal from TColStd;
858 NewKnots : in out Array1OfReal from TColStd;
859 NewMults : in out Array1OfInteger from TColStd);
862 IncreaseDegree (NewDegree : in Integer;
863 Poles : in Array1OfPnt from TColgp;
864 Weights : in Array1OfReal from TColStd;
865 NewPoles : in out Array1OfPnt from TColgp;
866 NewWeights : in out Array1OfReal from TColStd);
867 ---Warning: To be used for Beziercurves ONLY!!!
869 IncreaseDegree (NewDegree : in Integer;
870 Poles : in Array1OfPnt2d from TColgp;
871 Weights : in Array1OfReal from TColStd;
872 NewPoles : in out Array1OfPnt2d from TColgp;
873 NewWeights : in out Array1OfReal from TColStd);
874 ---Purpose: Increase the degree of a bspline (or bezier) curve
875 -- of dimension <Dimension> form <Degree> to
878 -- The number of poles in the new curve is :
880 -- Poles.Length() + (NewDegree - Degree) * Number of spans
882 -- Where the number of spans is :
884 -- LastUKnotIndex(Mults) - FirstUKnotIndex(Mults) + 1
886 -- for a non-periodic curve
888 -- And Knots.Length() - 1 for a periodic curve.
890 -- The multiplicities of all knots are increased by
891 -- the degree elevation.
893 -- The new knots are usually the same knots with the
894 -- exception of a non-periodic curve with the first
895 -- and last multiplicity not equal to Degree+1 where
896 -- knots are removed form the start and the bottom
897 -- untils the sum of the multiplicities is equal to
898 -- NewDegree+1 at the knots corresponding to the
899 -- first and last parameters of the curve.
901 -- Example : Suppose a curve of degree 3 starting
902 -- with following knots and multiplicities :
907 -- The FirstUKnot is 2. because the sum of
908 -- multiplicities is Degree+1 : 1 + 2 + 1 = 4 = 3 + 1
910 -- i.e. the first parameter of the curve is 2. and
911 -- will still be 2. after degree elevation. Let
912 -- raises this curve to degree 4. The multiplicities
913 -- are increased by 2.
915 -- They become 2 3 2. But we need a sum of
916 -- multiplicities of 5 at knot 2. So the first knot
917 -- is removed and the new knots are :
922 -- The multipicity of the first knot may also be
923 -- reduced if the sum is still to big.
925 -- In the most common situations (periodic curve or
926 -- curve with first and last multiplicities equals to
927 -- Degree+1) the knots are knot changes.
929 -- The method IncreaseDegreeCountKnots can be used to
930 -- compute the new number of knots.\
932 ---Warning: To be used for Beziercurves ONLY!!!
934 PrepareUnperiodize (Degree : in Integer from Standard;
935 Mults : in Array1OfInteger from TColStd;
936 NbKnots : out Integer from Standard;
937 NbPoles : out Integer from Standard);
938 ---Purpose: Set in <NbKnots> and <NbPolesToAdd> the number of Knots and
939 -- Poles of the NotPeriodic Curve identical at the
940 -- periodic curve with a degree <Degree> , a
941 -- knots-distribution with Multiplicities <Mults>.
943 Unperiodize (Degree : in Integer from Standard;
944 Dimension : in Integer from Standard;
945 Mults : in Array1OfInteger from TColStd;
946 Knots : in Array1OfReal from TColStd;
947 Poles : in Array1OfReal from TColStd;
948 NewMults : out Array1OfInteger from TColStd;
949 NewKnots : out Array1OfReal from TColStd;
950 NewPoles : out Array1OfReal from TColStd);
952 Unperiodize (Degree : in Integer from Standard;
953 Mults : in Array1OfInteger from TColStd;
954 Knots : in Array1OfReal from TColStd;
955 Poles : in Array1OfPnt from TColgp;
956 Weights : in Array1OfReal from TColStd;
957 NewMults : out Array1OfInteger from TColStd;
958 NewKnots : out Array1OfReal from TColStd;
959 NewPoles : out Array1OfPnt from TColgp;
960 NewWeights: out Array1OfReal from TColStd);
962 Unperiodize (Degree : in Integer from Standard;
963 Mults : in Array1OfInteger from TColStd;
964 Knots : in Array1OfReal from TColStd;
965 Poles : in Array1OfPnt2d from TColgp;
966 Weights : in Array1OfReal from TColStd;
967 NewMults : out Array1OfInteger from TColStd;
968 NewKnots : out Array1OfReal from TColStd;
969 NewPoles : out Array1OfPnt2d from TColgp;
970 NewWeights: out Array1OfReal from TColStd);
973 PrepareTrimming (Degree : in Integer from Standard;
974 Periodic: in Boolean from Standard;
975 Knots : in Array1OfReal from TColStd;
976 Mults : in Array1OfInteger from TColStd;
977 U1 : in Real from Standard;
978 U2 : in Real from Standard;
979 NbKnots : out Integer from Standard;
980 NbPoles : out Integer from Standard);
981 ---Purpose: Set in <NbKnots> and <NbPoles> the number of Knots and
982 -- Poles of the curve resulting of the trimming of the
983 -- BSplinecurve definded with <degree>, <knots>, <mults>
985 Trimming (Degree : in Integer from Standard;
986 Periodic : in Boolean from Standard;
987 Dimension : in Integer from Standard;
988 Knots : in Array1OfReal from TColStd;
989 Mults : in Array1OfInteger from TColStd;
990 Poles : in Array1OfReal from TColStd;
991 U1 : in Real from Standard;
992 U2 : in Real from Standard;
993 NewKnots : out Array1OfReal from TColStd;
994 NewMults : out Array1OfInteger from TColStd;
995 NewPoles : out Array1OfReal from TColStd);
998 Trimming (Degree : in Integer from Standard;
999 Periodic : in Boolean from Standard;
1000 Knots : in Array1OfReal from TColStd;
1001 Mults : in Array1OfInteger from TColStd;
1002 Poles : in Array1OfPnt from TColgp;
1003 Weights : in Array1OfReal from TColStd;
1004 U1 : in Real from Standard;
1005 U2 : in Real from Standard;
1006 NewKnots : out Array1OfReal from TColStd;
1007 NewMults : out Array1OfInteger from TColStd;
1008 NewPoles : out Array1OfPnt from TColgp;
1009 NewWeights : out Array1OfReal from TColStd);
1012 Trimming (Degree : in Integer from Standard;
1013 Periodic : in Boolean from Standard;
1014 Knots : in Array1OfReal from TColStd;
1015 Mults : in Array1OfInteger from TColStd;
1016 Poles : in Array1OfPnt2d from TColgp;
1017 Weights : in Array1OfReal from TColStd;
1018 U1 : in Real from Standard;
1019 U2 : in Real from Standard;
1020 NewKnots : out Array1OfReal from TColStd;
1021 NewMults : out Array1OfInteger from TColStd;
1022 NewPoles : out Array1OfPnt2d from TColgp;
1023 NewWeights : out Array1OfReal from TColStd);
1029 -------------------------------------------------------------
1030 -------------------------------------------------------------
1031 ---------- ----------
1032 ---------- Curve Evaluations ----------
1033 ---------- ----------
1034 -------------------------------------------------------------
1035 -------------------------------------------------------------
1039 Degree : in Integer;
1040 Periodic : in Boolean;
1041 Poles : in Array1OfReal from TColStd;
1042 Weights : in Array1OfReal from TColStd;
1043 Knots : in Array1OfReal from TColStd;
1044 Mults : in Array1OfInteger from TColStd;
1049 Degree : in Integer;
1050 Periodic : in Boolean;
1051 Poles : in Array1OfPnt from TColgp;
1052 Weights : in Array1OfReal from TColStd;
1053 Knots : in Array1OfReal from TColStd;
1054 Mults : in Array1OfInteger from TColStd;
1055 P : out Pnt from gp);
1058 UIndex : in Integer;
1059 Degree : in Integer;
1060 Periodic : in Boolean;
1061 Poles : in Array1OfPnt2d from TColgp;
1062 Weights : in Array1OfReal from TColStd;
1063 Knots : in Array1OfReal from TColStd;
1064 Mults : in Array1OfInteger from TColStd;
1065 P : out Pnt2d from gp);
1068 Poles : in Array1OfPnt from TColgp;
1069 Weights : in Array1OfReal from TColStd;
1070 P : out Pnt from gp);
1071 ---Warning: To be used for Beziercurves ONLY!!!
1074 Poles : in Array1OfPnt2d from TColgp;
1075 Weights : in Array1OfReal from TColStd;
1076 P : out Pnt2d from gp);
1077 ---Warning: To be used for Beziercurves ONLY!!!
1081 Degree : in Integer;
1082 Periodic : in Boolean;
1083 Poles : in Array1OfReal from TColStd;
1084 Weights : in Array1OfReal from TColStd;
1085 Knots : in Array1OfReal from TColStd;
1086 Mults : in Array1OfInteger from TColStd;
1092 Degree : in Integer;
1093 Periodic : in Boolean;
1094 Poles : in Array1OfPnt from TColgp;
1095 Weights : in Array1OfReal from TColStd;
1096 Knots : in Array1OfReal from TColStd;
1097 Mults : in Array1OfInteger from TColStd;
1098 P : out Pnt from gp;
1099 V : out Vec from gp);
1102 UIndex : in Integer;
1103 Degree : in Integer;
1104 Periodic : in Boolean;
1105 Poles : in Array1OfPnt2d from TColgp;
1106 Weights : in Array1OfReal from TColStd;
1107 Knots : in Array1OfReal from TColStd;
1108 Mults : in Array1OfInteger from TColStd;
1109 P : out Pnt2d from gp;
1110 V : out Vec2d from gp);
1113 Poles : in Array1OfPnt from TColgp;
1114 Weights : in Array1OfReal from TColStd;
1115 P : out Pnt from gp;
1116 V : out Vec from gp);
1117 ---Warning: To be used for Beziercurves ONLY!!!
1120 Poles : in Array1OfPnt2d from TColgp;
1121 Weights : in Array1OfReal from TColStd;
1122 P : out Pnt2d from gp;
1123 V : out Vec2d from gp);
1124 ---Warning: To be used for Beziercurves ONLY!!!
1128 Degree : in Integer;
1129 Periodic : in Boolean;
1130 Poles : in Array1OfReal from TColStd;
1131 Weights : in Array1OfReal from TColStd;
1132 Knots : in Array1OfReal from TColStd;
1133 Mults : in Array1OfInteger from TColStd;
1139 Degree : in Integer;
1140 Periodic : in Boolean;
1141 Poles : in Array1OfPnt from TColgp;
1142 Weights : in Array1OfReal from TColStd;
1143 Knots : in Array1OfReal from TColStd;
1144 Mults : in Array1OfInteger from TColStd;
1145 P : out Pnt from gp;
1146 V1,V2 : out Vec from gp);
1149 UIndex : in Integer;
1150 Degree : in Integer;
1151 Periodic : in Boolean;
1152 Poles : in Array1OfPnt2d from TColgp;
1153 Weights : in Array1OfReal from TColStd;
1154 Knots : in Array1OfReal from TColStd;
1155 Mults : in Array1OfInteger from TColStd;
1156 P : out Pnt2d from gp;
1157 V1,V2 : out Vec2d from gp);
1160 Poles : in Array1OfPnt from TColgp;
1161 Weights : in Array1OfReal from TColStd;
1162 P : out Pnt from gp;
1163 V1,V2 : out Vec from gp);
1164 ---Warning: To be used for Beziercurves ONLY!!!
1167 Poles : in Array1OfPnt2d from TColgp;
1168 Weights : in Array1OfReal from TColStd;
1169 P : out Pnt2d from gp;
1170 V1,V2 : out Vec2d from gp);
1171 ---Warning: To be used for Beziercurves ONLY!!!
1175 Degree : in Integer;
1176 Periodic : in Boolean;
1177 Poles : in Array1OfReal from TColStd;
1178 Weights : in Array1OfReal from TColStd;
1179 Knots : in Array1OfReal from TColStd;
1180 Mults : in Array1OfInteger from TColStd;
1182 V1,V2,V3 : out Real);
1186 Degree : in Integer;
1187 Periodic : in Boolean;
1188 Poles : in Array1OfPnt from TColgp;
1189 Weights : in Array1OfReal from TColStd;
1190 Knots : in Array1OfReal from TColStd;
1191 Mults : in Array1OfInteger from TColStd;
1192 P : out Pnt from gp;
1193 V1,V2,V3 : out Vec from gp);
1196 UIndex : in Integer;
1197 Degree : in Integer;
1198 Periodic : in Boolean;
1199 Poles : in Array1OfPnt2d from TColgp;
1200 Weights : in Array1OfReal from TColStd;
1201 Knots : in Array1OfReal from TColStd;
1202 Mults : in Array1OfInteger from TColStd;
1203 P : out Pnt2d from gp;
1204 V1,V2,V3 : out Vec2d from gp);
1207 Poles : in Array1OfPnt from TColgp;
1208 Weights : in Array1OfReal from TColStd;
1209 P : out Pnt from gp;
1210 V1,V2,V3 : out Vec from gp);
1211 ---Warning: To be used for Beziercurves ONLY!!!
1214 Poles : in Array1OfPnt2d from TColgp;
1215 Weights : in Array1OfReal from TColStd;
1216 P : out Pnt2d from gp;
1217 V1,V2,V3 : out Vec2d from gp);
1218 ---Warning: To be used for Beziercurves ONLY!!!
1223 Degree : in Integer;
1224 Periodic : in Boolean;
1225 Poles : in Array1OfReal from TColStd;
1226 Weights : in Array1OfReal from TColStd;
1227 Knots : in Array1OfReal from TColStd;
1228 Mults : in Array1OfInteger from TColStd;
1234 Degree : in Integer;
1235 Periodic : in Boolean;
1236 Poles : in Array1OfPnt from TColgp;
1237 Weights : in Array1OfReal from TColStd;
1238 Knots : in Array1OfReal from TColStd;
1239 Mults : in Array1OfInteger from TColStd;
1240 VN : out Vec from gp);
1244 UIndex : in Integer;
1245 Degree : in Integer;
1246 Periodic : in Boolean;
1247 Poles : in Array1OfPnt2d from TColgp;
1248 Weights : in Array1OfReal from TColStd;
1249 Knots : in Array1OfReal from TColStd;
1250 Mults : in Array1OfInteger from TColStd;
1251 V : out Vec2d from gp);
1255 Poles : in Array1OfPnt from TColgp;
1256 Weights : in Array1OfReal from TColStd;
1257 P : out Pnt from gp;
1258 VN : out Vec from gp);
1259 ---Warning: To be used for Beziercurves ONLY!!!
1263 Poles : in Array1OfPnt2d from TColgp;
1264 Weights : in Array1OfReal from TColStd;
1265 P : out Pnt2d from gp;
1266 VN : out Vec2d from gp);
1267 ---Purpose: The above functions compute values and
1268 -- derivatives in the following situations :
1272 -- * Rational or not Rational.
1274 -- * Knots and multiplicities or "flat knots" without
1277 -- * The <Index> is the the localization of the
1278 -- parameter in the knot sequence. If <Index> is out
1279 -- of range the correct value will be searched.
1282 -- VERY IMPORTANT!!!
1283 -- USE BSplCLib::NoWeights() as Weights argument for non
1284 -- rational curves computations.
1285 ---Warning: To be used for Beziercurves ONLY!!!
1287 EvalBsplineBasis(Side : in Integer ;
1288 DerivativeOrder : in Integer ;
1289 Order : in Integer ;
1290 FlatKnots : Array1OfReal from TColStd ;
1291 Parameter : in Real ;
1292 FirstNonZeroBsplineIndex : in out Integer ;
1293 BsplineBasis : in out Matrix from math)
1296 ---Purpose: This evaluates the Bspline Basis at a
1297 -- given parameter Parameter up to the
1298 -- requested DerivativeOrder and store the
1299 -- result in the array BsplineBasis in the
1300 -- following fashion
1301 -- BSplineBasis(1,1) =
1302 -- value of first non vanishing
1303 -- Bspline function which has Index FirstNonZeroBsplineIndex
1304 -- BsplineBasis(1,2) =
1305 -- value of second non vanishing
1306 -- Bspline function which has Index
1307 -- FirstNonZeroBsplineIndex + 1
1308 -- BsplineBasis(1,n) =
1309 -- value of second non vanishing non vanishing
1310 -- Bspline function which has Index
1311 -- FirstNonZeroBsplineIndex + n (n <= Order)
1312 -- BSplineBasis(2,1) =
1313 -- value of derivative of first non vanishing
1314 -- Bspline function which has Index FirstNonZeroBsplineIndex
1315 -- BSplineBasis(N,1) =
1316 -- value of Nth derivative of first non vanishing
1317 -- Bspline function which has Index FirstNonZeroBsplineIndex
1318 -- if N <= DerivativeOrder + 1
1320 BuildBSpMatrix(Parameters : in Array1OfReal from TColStd;
1321 OrderArray : in Array1OfInteger from TColStd;
1322 FlatKnots : in Array1OfReal from TColStd;
1323 Degree : in Integer;
1324 Matrix : in out Matrix from math;
1325 UpperBandWidth : out Integer ;
1326 LowerBandWidth : out Integer) returns Integer ;
1327 ---Purpose: This Builds a fully blown Matrix of
1331 -- with i and j within 1..Order + NumPoles
1332 -- The integer ni is the ith slot of the
1333 -- array OrderArray, tj is the jth slot of
1334 -- the array Parameters
1336 FactorBandedMatrix(Matrix : in out Matrix from math ;
1337 UpperBandWidth : in Integer ;
1338 LowerBandWidth : in Integer ;
1339 PivotIndexProblem : out Integer) returns Integer ;
1340 ---Purpose: this factors the Banded Matrix in
1341 -- the LU form with a Banded storage of
1342 -- components of the L matrix
1343 -- WARNING : do not use if the Matrix is
1344 -- totally positive (It is the case for
1345 -- Bspline matrices build as above with
1346 -- parameters being the Schoenberg points
1348 SolveBandedSystem (Matrix : in Matrix from math ;
1349 UpperBandWidth : in Integer ;
1350 LowerBandWidth : in Integer ;
1351 ArrayDimension : in Integer ;
1352 Array : in out Real)
1354 ---Purpose: This solves the system Matrix.X = B
1355 -- with when Matrix is factored in LU form
1356 -- The Array is an seen as an
1357 -- Array[1..N][1..ArrayDimension] with N =
1358 -- the rank of the matrix Matrix. The
1359 -- result is stored in Array when each
1360 -- coordinate is solved that is B is the
1361 -- array whose values are
1362 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1364 SolveBandedSystem (Matrix : in Matrix from math ;
1365 UpperBandWidth : in Integer ;
1366 LowerBandWidth : in Integer ;
1367 Array : in out Array1OfPnt2d from TColgp)
1369 ---Purpose: This solves the system Matrix.X = B
1370 -- with when Matrix is factored in LU form
1371 -- The Array has the length of
1372 -- the rank of the matrix Matrix. The
1373 -- result is stored in Array when each
1374 -- coordinate is solved that is B is the
1375 -- array whose values are
1376 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1378 SolveBandedSystem (Matrix : in Matrix from math ;
1379 UpperBandWidth : in Integer ;
1380 LowerBandWidth : in Integer ;
1381 Array : in out Array1OfPnt from TColgp)
1383 ---Purpose: This solves the system Matrix.X = B
1384 -- with when Matrix is factored in LU form
1385 -- The Array has the length of
1386 -- the rank of the matrix Matrix. The
1387 -- result is stored in Array when each
1388 -- coordinate is solved that is B is the
1389 -- array whose values are
1390 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1392 SolveBandedSystem (Matrix : in Matrix from math ;
1393 UpperBandWidth : in Integer ;
1394 LowerBandWidth : in Integer ;
1395 HomogenousFlag : in Boolean ;
1396 ArrayDimension : Integer ;
1397 Array : in out Real ;
1398 Weights : in out Real )
1401 SolveBandedSystem (Matrix : in Matrix from math ;
1402 UpperBandWidth : in Integer ;
1403 LowerBandWidth : in Integer ;
1404 HomogenousFlag : in Boolean ;
1405 Array : in out Array1OfPnt2d from TColgp;
1406 Weights : in out Array1OfReal from TColStd )
1408 ---Purpose: This solves the system Matrix.X = B
1409 -- with when Matrix is factored in LU form
1410 -- The Array is an seen as an
1411 -- Array[1..N][1..ArrayDimension] with N =
1412 -- the rank of the matrix Matrix. The
1413 -- result is stored in Array when each
1414 -- coordinate is solved that is B is the
1415 -- array whose values are B[i] =
1416 -- Array[i][p] for each p in
1417 -- 1..ArrayDimension. If HomogeneousFlag ==
1418 -- 0 the Poles are multiplied by the
1419 -- Weights uppon Entry and once
1420 -- interpolation is carried over the
1421 -- result of the poles are divided by the
1422 -- result of the interpolation of the
1423 -- weights. Otherwise if HomogenousFlag == 1
1424 -- the Poles and Weigths are treated homogenously
1425 -- that is that those are interpolated as they
1426 -- are and result is returned without division
1427 -- by the interpolated weigths.
1429 SolveBandedSystem (Matrix : in Matrix from math ;
1430 UpperBandWidth : in Integer ;
1431 LowerBandWidth : in Integer ;
1432 HomogeneousFlag : in Boolean ;
1433 Array : in out Array1OfPnt from TColgp;
1434 Weights : in out Array1OfReal from TColStd )
1436 ---Purpose: This solves the system Matrix.X = B
1437 -- with when Matrix is factored in LU form
1438 -- The Array is an seen as an
1439 -- Array[1..N][1..ArrayDimension] with N =
1440 -- the rank of the matrix Matrix. The
1441 -- result is stored in Array when each
1442 -- coordinate is solved that is B is the
1443 -- array whose values are
1444 -- B[i] = Array[i][p] for each p in 1..ArrayDimension
1445 -- If HomogeneousFlag ==
1446 -- 0 the Poles are multiplied by the
1447 -- Weights uppon Entry and once
1448 -- interpolation is carried over the
1449 -- result of the poles are divided by the
1450 -- result of the interpolation of the
1451 -- weights. Otherwise if HomogenousFlag == 1
1452 -- the Poles and Weigths are treated homogenously
1453 -- that is that those are interpolated as they
1454 -- are and result is returned without division
1455 -- by the interpolated weigths.
1457 MergeBSplineKnots(Tolerance : Real from Standard ;
1458 StartValue : Real from Standard ;
1459 EndValue : Real from Standard ;
1460 Degree1 : Integer from Standard ;
1461 Knots1 : Array1OfReal from TColStd ;
1462 Mults1 : Array1OfInteger from TColStd ;
1463 Degree2 : Integer from Standard ;
1464 Knots2 : Array1OfReal from TColStd ;
1465 Mults2 : Array1OfInteger from TColStd ;
1466 NumPoles : in out Integer ;
1467 NewKnots : in out HArray1OfReal from TColStd ;
1468 NewMults : in out HArray1OfInteger from TColStd) ;
1469 ---Purpose: Merges two knot vector by setting the starting and
1470 -- ending values to StartValue and EndValue
1472 FunctionReparameterise(Function : EvaluatorFunction from BSplCLib ;
1473 BSplineDegree : Integer ;
1474 BSplineFlatKnots : Array1OfReal from TColStd ;
1475 PolesDimension : Integer ;
1476 Poles : in out Real ;
1478 FlatKnots : Array1OfReal from TColStd ;
1479 NewDegree : Integer ;
1480 NewPoles : in out Real ;
1481 Status : in out Integer) ;
1482 ---Purpose: This function will compose a given Vectorial BSpline F(t)
1483 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1484 -- its Poles array which are coded as an array of Real
1485 -- of the form [1..NumPoles][1..PolesDimension] with a
1486 -- function a(t) which is assumed to satisfy the
1489 -- 1. F(a(t)) is a polynomial BSpline
1490 -- that can be expressed exactly as a BSpline of degree
1491 -- NewDegree on the knots FlatKnots
1493 -- 2. a(t) defines a differentiable
1494 -- isomorphism between the range of FlatKnots to the range
1495 -- of BSplineFlatKnots which is the
1496 -- same as the range of F(t)
1499 -- the caller's responsability to insure that conditions
1500 -- 1. and 2. above are satisfied : no check whatsoever
1501 -- is made in this method
1503 -- Status will return 0 if OK else it will return the pivot index
1504 -- of the matrix that was inverted to compute the multiplied
1505 -- BSpline : the method used is interpolation at Schoenenberg
1506 -- points of F(a(t))
1508 FunctionReparameterise(
1509 Function : EvaluatorFunction from BSplCLib ;
1510 BSplineDegree : Integer ;
1511 BSplineFlatKnots : Array1OfReal from TColStd ;
1512 Poles : Array1OfReal from TColStd ;
1514 FlatKnots : Array1OfReal from TColStd ;
1515 NewDegree : Integer ;
1516 NewPoles : in out Array1OfReal from TColStd ;
1517 Status : in out Integer) ;
1518 ---Purpose: This function will compose a given Vectorial BSpline F(t)
1519 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1520 -- its Poles array which are coded as an array of Real
1521 -- of the form [1..NumPoles][1..PolesDimension] with a
1522 -- function a(t) which is assumed to satisfy the
1525 -- 1. F(a(t)) is a polynomial BSpline
1526 -- that can be expressed exactly as a BSpline of degree
1527 -- NewDegree on the knots FlatKnots
1529 -- 2. a(t) defines a differentiable
1530 -- isomorphism between the range of FlatKnots to the range
1531 -- of BSplineFlatKnots which is the
1532 -- same as the range of F(t)
1535 -- the caller's responsability to insure that conditions
1536 -- 1. and 2. above are satisfied : no check whatsoever
1537 -- is made in this method
1539 -- Status will return 0 if OK else it will return the pivot index
1540 -- of the matrix that was inverted to compute the multiplied
1541 -- BSpline : the method used is interpolation at Schoenenberg
1542 -- points of F(a(t))
1544 FunctionReparameterise( Function : EvaluatorFunction from BSplCLib ;
1545 BSplineDegree : Integer ;
1546 BSplineFlatKnots : Array1OfReal from TColStd ;
1547 Poles : Array1OfPnt from TColgp ;
1549 FlatKnots : Array1OfReal from TColStd ;
1550 NewDegree : Integer ;
1551 NewPoles : in out Array1OfPnt from TColgp ;
1552 Status : in out Integer) ;
1553 ---Purpose: this will compose a given Vectorial BSpline F(t)
1554 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1555 -- its Poles array which are coded as an array of Real
1556 -- of the form [1..NumPoles][1..PolesDimension] with a
1557 -- function a(t) which is assumed to satisfy the
1558 -- following : 1. F(a(t)) is a polynomial BSpline
1559 -- that can be expressed exactly as a BSpline of degree
1560 -- NewDegree on the knots FlatKnots
1561 -- 2. a(t) defines a differentiable
1562 -- isomorphism between the range of FlatKnots to the range
1563 -- of BSplineFlatKnots which is the
1564 -- same as the range of F(t)
1566 -- the caller's responsability to insure that conditions
1567 -- 1. and 2. above are satisfied : no check whatsoever
1568 -- is made in this method
1569 -- Status will return 0 if OK else it will return the pivot index
1570 -- of the matrix that was inverted to compute the multiplied
1571 -- BSpline : the method used is interpolation at Schoenenberg
1572 -- points of F(a(t))
1574 FunctionReparameterise(
1575 Function : EvaluatorFunction from BSplCLib ;
1576 BSplineDegree : Integer ;
1577 BSplineFlatKnots : Array1OfReal from TColStd ;
1578 Poles : Array1OfPnt2d from TColgp ;
1580 FlatKnots : Array1OfReal from TColStd ;
1581 NewDegree : Integer ;
1582 NewPoles : in out Array1OfPnt2d from TColgp ;
1583 Status : in out Integer) ;
1584 ---Purpose: this will compose a given Vectorial BSpline F(t)
1585 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1586 -- its Poles array which are coded as an array of Real
1587 -- of the form [1..NumPoles][1..PolesDimension] with a
1588 -- function a(t) which is assumed to satisfy the
1589 -- following : 1. F(a(t)) is a polynomial BSpline
1590 -- that can be expressed exactly as a BSpline of degree
1591 -- NewDegree on the knots FlatKnots
1592 -- 2. a(t) defines a differentiable
1593 -- isomorphism between the range of FlatKnots to the range
1594 -- of BSplineFlatKnots which is the
1595 -- same as the range of F(t)
1597 -- the caller's responsability to insure that conditions
1598 -- 1. and 2. above are satisfied : no check whatsoever
1599 -- is made in this method
1600 -- Status will return 0 if OK else it will return the pivot index
1601 -- of the matrix that was inverted to compute the multiplied
1602 -- BSpline : the method used is interpolation at Schoenenberg
1603 -- points of F(a(t))
1605 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1606 BSplineDegree : Integer ;
1607 BSplineFlatKnots : Array1OfReal from TColStd ;
1608 PolesDimension : Integer ;
1609 Poles : in out Real ;
1610 FlatKnots : Array1OfReal from TColStd ;
1611 NewDegree : Integer ;
1612 NewPoles : in out Real ;
1613 Status : in out Integer) ;
1614 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1615 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1616 -- its Poles array which are coded as an array of Real
1617 -- of the form [1..NumPoles][1..PolesDimension] by a
1618 -- function a(t) which is assumed to satisfy the
1619 -- following : 1. a(t) * F(t) is a polynomial BSpline
1620 -- that can be expressed exactly as a BSpline of degree
1621 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1622 -- is the same as the range of F(t)
1624 -- the caller's responsability to insure that conditions
1625 -- 1. and 2. above are satisfied : no check whatsoever
1626 -- is made in this method
1627 -- Status will return 0 if OK else it will return the pivot index
1628 -- of the matrix that was inverted to compute the multiplied
1629 -- BSpline : the method used is interpolation at Schoenenberg
1630 -- points of a(t)*F(t)
1632 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1633 BSplineDegree : Integer ;
1634 BSplineFlatKnots : Array1OfReal from TColStd ;
1635 Poles : Array1OfReal from TColStd ;
1636 FlatKnots : Array1OfReal from TColStd ;
1637 NewDegree : Integer ;
1638 NewPoles : in out Array1OfReal from TColStd ;
1639 Status : in out Integer) ;
1640 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1641 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1642 -- its Poles array which are coded as an array of Real
1643 -- of the form [1..NumPoles][1..PolesDimension] by a
1644 -- function a(t) which is assumed to satisfy the
1645 -- following : 1. a(t) * F(t) is a polynomial BSpline
1646 -- that can be expressed exactly as a BSpline of degree
1647 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1648 -- is the same as the range of F(t)
1650 -- the caller's responsability to insure that conditions
1651 -- 1. and 2. above are satisfied : no check whatsoever
1652 -- is made in this method
1653 -- Status will return 0 if OK else it will return the pivot index
1654 -- of the matrix that was inverted to compute the multiplied
1655 -- BSpline : the method used is interpolation at Schoenenberg
1656 -- points of a(t)*F(t)
1658 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1659 BSplineDegree : Integer ;
1660 BSplineFlatKnots : Array1OfReal from TColStd ;
1661 Poles : Array1OfPnt2d from TColgp ;
1662 FlatKnots : Array1OfReal from TColStd ;
1663 NewDegree : Integer ;
1664 NewPoles : in out Array1OfPnt2d from TColgp ;
1665 Status : in out Integer) ;
1666 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1667 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1668 -- its Poles array which are coded as an array of Real
1669 -- of the form [1..NumPoles][1..PolesDimension] by a
1670 -- function a(t) which is assumed to satisfy the
1671 -- following : 1. a(t) * F(t) is a polynomial BSpline
1672 -- that can be expressed exactly as a BSpline of degree
1673 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1674 -- is the same as the range of F(t)
1676 -- the caller's responsability to insure that conditions
1677 -- 1. and 2. above are satisfied : no check whatsoever
1678 -- is made in this method
1679 -- Status will return 0 if OK else it will return the pivot index
1680 -- of the matrix that was inverted to compute the multiplied
1681 -- BSpline : the method used is interpolation at Schoenenberg
1682 -- points of a(t)*F(t)
1684 FunctionMultiply(Function : EvaluatorFunction from BSplCLib ;
1685 BSplineDegree : Integer ;
1686 BSplineFlatKnots : Array1OfReal from TColStd ;
1687 Poles : Array1OfPnt from TColgp ;
1688 FlatKnots : Array1OfReal from TColStd ;
1689 NewDegree : Integer ;
1690 NewPoles : in out Array1OfPnt from TColgp ;
1691 Status : in out Integer) ;
1692 ---Purpose: this will multiply a given Vectorial BSpline F(t)
1693 -- defined by its BSplineDegree and BSplineFlatKnotsl,
1694 -- its Poles array which are coded as an array of Real
1695 -- of the form [1..NumPoles][1..PolesDimension] by a
1696 -- function a(t) which is assumed to satisfy the
1697 -- following : 1. a(t) * F(t) is a polynomial BSpline
1698 -- that can be expressed exactly as a BSpline of degree
1699 -- NewDegree on the knots FlatKnots 2. the range of a(t)
1700 -- is the same as the range of F(t)
1702 -- the caller's responsability to insure that conditions
1703 -- 1. and 2. above are satisfied : no check whatsoever
1704 -- is made in this method
1705 -- Status will return 0 if OK else it will return the pivot index
1706 -- of the matrix that was inverted to compute the multiplied
1707 -- BSpline : the method used is interpolation at Schoenenberg
1708 -- points of a(t)*F(t)
1711 PeriodicFlag : Boolean ;
1712 DerivativeRequest : Integer ;
1713 ExtrapMode : in out Integer ;
1715 FlatKnots : Array1OfReal from TColStd ;
1716 ArrayDimension : Integer ;
1717 Poles : in out Real ;
1718 Result : in out Real) ;
1719 ---Purpose: Perform the De Boor algorithm to evaluate a point at
1720 -- parameter <U>, with <Degree> and <Dimension>.
1722 -- Poles is an array of Reals of size
1724 -- <Dimension> * <Degree>+1
1726 -- Containing the poles. At the end <Poles> contains
1727 -- the current point. Poles Contain all the poles of
1728 -- the BsplineCurve, Knots also Contains all the knots
1729 -- of the BsplineCurve. ExtrapMode has two slots [0] =
1730 -- Degree used to extrapolate before the first knot [1]
1731 -- = Degre used to extrapolate after the last knot has
1732 -- to be between 1 and Degree
1735 PeriodicFlag : Boolean ;
1736 DerivativeRequest : Integer ;
1737 ExtrapMode : in out Integer ;
1739 FlatKnots : Array1OfReal from TColStd ;
1740 ArrayDimension : Integer ;
1741 Poles : in out Real ;
1742 Weights : in out Real ;
1743 PolesResult : in out Real ;
1744 WeightsResult : in out Real) ;
1745 ---Purpose: Perform the De Boor algorithm to evaluate a point at
1746 -- parameter <U>, with <Degree> and <Dimension>.
1747 -- Evaluates by multiplying the Poles by the Weights and
1748 -- gives the homogeneous result in PolesResult that is
1749 -- the results of the evaluation of the numerator once it
1750 -- has been multiplied by the weights and in
1751 -- WeightsResult one has the result of the evaluation of
1754 -- Warning: <PolesResult> and <WeightsResult> must be dimensionned
1758 PeriodicFlag : Boolean ;
1759 HomogeneousFlag : Boolean ;
1760 ExtrapMode : in out Integer ;
1762 FlatKnots : Array1OfReal from TColStd ;
1763 Poles : Array1OfPnt from TColgp;
1764 Weights : Array1OfReal from TColStd ;
1765 Point : out Pnt from gp ;
1766 Weight : in out Real) ;
1767 ---Purpose: Perform the evaluation of the Bspline Basis
1768 -- and then multiplies by the weights
1769 -- this just evaluates the current point
1772 PeriodicFlag : Boolean ;
1773 HomogeneousFlag : Boolean ;
1774 ExtrapMode : in out Integer ;
1776 FlatKnots : Array1OfReal from TColStd ;
1777 Poles : Array1OfPnt2d from TColgp;
1778 Weights : Array1OfReal from TColStd ;
1779 Point : out Pnt2d from gp ;
1780 Weight : in out Real) ;
1781 ---Purpose: Perform the evaluation of the Bspline Basis
1782 -- and then multiplies by the weights
1783 -- this just evaluates the current point
1786 TangExtendToConstraint(FlatKnots : Array1OfReal from TColStd ;
1787 C1Coefficient : Real ;
1788 NumPoles : in Integer ;
1789 Poles : in out Real ;
1790 Dimension : Integer ;
1792 ConstraintPoint : Array1OfReal from TColStd ;
1793 Continuity : Integer ;
1795 NbPolesResult : in out Integer ;
1796 NbKnotsRsult : in out Integer ;
1797 KnotsResult : in out Real ;
1798 PolesResult : in out Real) ;
1799 ---Purpose: Extend a BSpline nD using the tangency map
1800 -- <C1Coefficient> is the coefficient of reparametrisation
1801 -- <Continuity> must be equal to 1, 2 or 3.
1802 -- <Degree> must be greater or equal than <Continuity> + 1.
1804 -- Warning: <KnotsResult> and <PolesResult> must be dimensionned
1809 CacheParameter : Real;
1811 Poles : Array1OfPnt from TColgp ;
1812 Weights : Array1OfReal from TColStd ;
1813 Point : out Pnt from gp) ;
1814 ---Purpose: Perform the evaluation of the of the cache
1815 -- the parameter must be normalized between
1816 -- the 0 and 1 for the span.
1817 -- The Cache must be valid when calling this
1818 -- routine. Geom Package will insure that.
1819 -- and then multiplies by the weights
1820 -- this just evaluates the current point
1821 -- the CacheParameter is where the Cache was
1822 -- constructed the SpanLength is to normalize
1823 -- the polynomial in the cache to avoid bad conditioning
1828 CacheParameter : Real;
1830 Poles : Array1OfPnt2d from TColgp;
1831 Weights : Array1OfReal from TColStd ;
1832 Point : out Pnt2d from gp) ;
1833 ---Purpose: Perform the evaluation of the Bspline Basis
1834 -- and then multiplies by the weights
1835 -- this just evaluates the current point
1836 -- the parameter must be normalized between
1837 -- the 0 and 1 for the span.
1838 -- The Cache must be valid when calling this
1839 -- routine. Geom Package will insure that.
1840 -- and then multiplies by the weights
1841 -- ththe CacheParameter is where the Cache was
1842 -- constructed the SpanLength is to normalize
1843 -- the polynomial in the cache to avoid bad conditioning
1844 -- effectsis just evaluates the current point
1847 Poles : Array1OfPnt from TColgp ;
1848 Weights : Array1OfReal from TColStd ;
1849 Point : out Pnt from gp) ;
1850 ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with
1851 -- the method PolesCoefficients.
1852 -- Warning: To be used for Beziercurves ONLY!!!
1856 Poles : Array1OfPnt2d from TColgp ;
1857 Weights : Array1OfReal from TColStd ;
1858 Point : out Pnt2d from gp) ;
1859 ---Purpose: Calls CacheD0 for Bezier Curves Arrays computed with
1860 -- the method PolesCoefficients.
1861 -- Warning: To be used for Beziercurves ONLY!!!
1866 CacheParameter: Real;
1868 Poles : Array1OfPnt from TColgp ;
1869 Weights : Array1OfReal from TColStd ;
1870 Point : out Pnt from gp ;
1871 Vec : out Vec from gp) ;
1872 ---Purpose: Perform the evaluation of the of the cache
1873 -- the parameter must be normalized between
1874 -- the 0 and 1 for the span.
1875 -- The Cache must be valid when calling this
1876 -- routine. Geom Package will insure that.
1877 -- and then multiplies by the weights
1878 -- this just evaluates the current point
1879 -- the CacheParameter is where the Cache was
1880 -- constructed the SpanLength is to normalize
1881 -- the polynomial in the cache to avoid bad conditioning
1886 CacheParameter : Real;
1888 Poles : Array1OfPnt2d from TColgp;
1889 Weights : Array1OfReal from TColStd ;
1890 Point : out Pnt2d from gp ;
1891 Vec : out Vec2d from gp) ;
1892 ---Purpose: Perform the evaluation of the Bspline Basis
1893 -- and then multiplies by the weights
1894 -- this just evaluates the current point
1895 -- the parameter must be normalized between
1896 -- the 0 and 1 for the span.
1897 -- The Cache must be valid when calling this
1898 -- routine. Geom Package will insure that.
1899 -- and then multiplies by the weights
1900 -- ththe CacheParameter is where the Cache was
1901 -- constructed the SpanLength is to normalize
1902 -- the polynomial in the cache to avoid bad conditioning
1903 -- effectsis just evaluates the current point
1906 Poles : Array1OfPnt from TColgp ;
1907 Weights : Array1OfReal from TColStd ;
1908 Point : out Pnt from gp;
1909 Vec : out Vec from gp) ;
1910 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1911 -- the method PolesCoefficients.
1912 -- Warning: To be used for Beziercurves ONLY!!!
1916 Poles : Array1OfPnt2d from TColgp ;
1917 Weights : Array1OfReal from TColStd ;
1918 Point : out Pnt2d from gp;
1919 Vec : out Vec2d from gp) ;
1920 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1921 -- the method PolesCoefficients.
1922 -- Warning: To be used for Beziercurves ONLY!!!
1927 CacheParameter : Real;
1929 Poles : Array1OfPnt from TColgp ;
1930 Weights : Array1OfReal from TColStd ;
1931 Point : out Pnt from gp ;
1932 Vec1,Vec2 : out Vec from gp) ;
1933 ---Purpose: Perform the evaluation of the of the cache
1934 -- the parameter must be normalized between
1935 -- the 0 and 1 for the span.
1936 -- The Cache must be valid when calling this
1937 -- routine. Geom Package will insure that.
1938 -- and then multiplies by the weights
1939 -- this just evaluates the current point
1940 -- the CacheParameter is where the Cache was
1941 -- constructed the SpanLength is to normalize
1942 -- the polynomial in the cache to avoid bad conditioning
1947 CacheParameter : Real;
1949 Poles : Array1OfPnt2d from TColgp;
1950 Weights : Array1OfReal from TColStd ;
1951 Point : out Pnt2d from gp ;
1952 Vec1,Vec2 : out Vec2d from gp) ;
1953 ---Purpose: Perform the evaluation of the Bspline Basis
1954 -- and then multiplies by the weights
1955 -- this just evaluates the current point
1956 -- the parameter must be normalized between
1957 -- the 0 and 1 for the span.
1958 -- The Cache must be valid when calling this
1959 -- routine. Geom Package will insure that.
1960 -- and then multiplies by the weights
1961 -- ththe CacheParameter is where the Cache was
1962 -- constructed the SpanLength is to normalize
1963 -- the polynomial in the cache to avoid bad conditioning
1964 -- effectsis just evaluates the current point
1967 Poles : Array1OfPnt from TColgp ;
1968 Weights : Array1OfReal from TColStd ;
1969 Point : out Pnt from gp;
1970 Vec1,Vec2 : out Vec from gp) ;
1971 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1972 -- the method PolesCoefficients.
1973 -- Warning: To be used for Beziercurves ONLY!!!
1977 Poles : Array1OfPnt2d from TColgp ;
1978 Weights : Array1OfReal from TColStd ;
1979 Point : out Pnt2d from gp;
1980 Vec1,Vec2 : out Vec2d from gp) ;
1981 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
1982 -- the method PolesCoefficients.
1983 -- Warning: To be used for Beziercurves ONLY!!!
1989 CacheParameter : Real;
1991 Poles : Array1OfPnt from TColgp ;
1992 Weights : Array1OfReal from TColStd ;
1993 Point : out Pnt from gp ;
1994 Vec1,Vec2,Vec3 : out Vec from gp) ;
1995 ---Purpose: Perform the evaluation of the of the cache
1996 -- the parameter must be normalized between
1997 -- the 0 and 1 for the span.
1998 -- The Cache must be valid when calling this
1999 -- routine. Geom Package will insure that.
2000 -- and then multiplies by the weights
2001 -- this just evaluates the current point
2002 -- the CacheParameter is where the Cache was
2003 -- constructed the SpanLength is to normalize
2004 -- the polynomial in the cache to avoid bad conditioning
2009 CacheParameter : Real;
2011 Poles : Array1OfPnt2d from TColgp;
2012 Weights : Array1OfReal from TColStd ;
2013 Point : out Pnt2d from gp ;
2014 Vec1,Vec2,Vec3 : out Vec2d from gp) ;
2015 ---Purpose: Perform the evaluation of the Bspline Basis
2016 -- and then multiplies by the weights
2017 -- this just evaluates the current point
2018 -- the parameter must be normalized between
2019 -- the 0 and 1 for the span.
2020 -- The Cache must be valid when calling this
2021 -- routine. Geom Package will insure that.
2022 -- and then multiplies by the weights
2023 -- ththe CacheParameter is where the Cache was
2024 -- constructed the SpanLength is to normalize
2025 -- the polynomial in the cache to avoid bad conditioning
2026 -- effectsis just evaluates the current point
2029 Poles : Array1OfPnt from TColgp ;
2030 Weights : Array1OfReal from TColStd ;
2031 Point : out Pnt from gp;
2032 Vec1,Vec2,Vec3: out Vec from gp) ;
2033 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
2034 -- the method PolesCoefficients.
2035 -- Warning: To be used for Beziercurves ONLY!!!
2039 Poles : Array1OfPnt2d from TColgp ;
2040 Weights : Array1OfReal from TColStd ;
2041 Point : out Pnt2d from gp;
2042 Vec1,Vec2,Vec3: out Vec2d from gp) ;
2043 ---Purpose: Calls CacheD1 for Bezier Curves Arrays computed with
2044 -- the method PolesCoefficients.
2045 -- Warning: To be used for Beziercurves ONLY!!!
2048 BuildCache(U : Real;
2049 InverseOfSpanDomain : Real;
2050 PeriodicFlag : Boolean ;
2052 FlatKnots : Array1OfReal from TColStd ;
2053 Poles : Array1OfPnt from TColgp;
2054 Weights : Array1OfReal from TColStd ;
2055 CachePoles : in out Array1OfPnt from TColgp;
2056 CacheWeights : in out Array1OfReal from TColStd) ;
2057 ---Purpose: Perform the evaluation of the Taylor expansion
2058 -- of the Bspline normalized between 0 and 1.
2059 -- If rational computes the homogeneous Taylor expension
2060 -- for the numerator and stores it in CachePoles
2062 BuildCache(U : Real;
2063 InverseOfSpanDomain : Real;
2064 PeriodicFlag : Boolean ;
2066 FlatKnots : Array1OfReal from TColStd ;
2067 Poles : Array1OfPnt2d from TColgp;
2068 Weights : Array1OfReal from TColStd ;
2069 CachePoles : in out Array1OfPnt2d from TColgp;
2070 CacheWeights : in out Array1OfReal from TColStd) ;
2071 ---Purpose: Perform the evaluation of the Taylor expansion
2072 -- of the Bspline normalized between 0 and 1.
2073 -- If rational computes the homogeneous Taylor expension
2074 -- for the numerator and stores it in CachePoles
2076 PolesCoefficients(Poles : Array1OfPnt2d from TColgp;
2077 CachePoles : in out Array1OfPnt2d from TColgp);
2078 ---Warning: To be used for Beziercurves ONLY!!!
2081 PolesCoefficients(Poles : Array1OfPnt2d from TColgp;
2082 Weights : Array1OfReal from TColStd ;
2083 CachePoles : in out Array1OfPnt2d from TColgp;
2084 CacheWeights : in out Array1OfReal from TColStd) ;
2085 ---Warning: To be used for Beziercurves ONLY!!!
2087 PolesCoefficients(Poles : Array1OfPnt from TColgp;
2088 CachePoles : in out Array1OfPnt from TColgp);
2089 ---Warning: To be used for Beziercurves ONLY!!!
2092 PolesCoefficients(Poles : Array1OfPnt from TColgp;
2093 Weights : Array1OfReal from TColStd ;
2094 CachePoles : in out Array1OfPnt from TColgp;
2095 CacheWeights : in out Array1OfReal from TColStd) ;
2096 ---Purpose: Encapsulation of BuildCache to perform the
2097 -- evaluation of the Taylor expansion for beziercurves
2099 -- Warning: To be used for Beziercurves ONLY!!!
2101 FlatBezierKnots (Degree: Integer) returns Real;
2102 ---Purpose: Returns pointer to statically allocated array representing
2103 -- flat knots for bezier curve of the specified degree.
2104 -- Raises OutOfRange if Degree > MaxDegree()
2105 ---C++: return const &
2107 BuildSchoenbergPoints(Degree : Integer ;
2108 FlatKnots : Array1OfReal from TColStd ;
2109 Parameters : in out Array1OfReal from TColStd) ;
2110 ---Purpose: builds the Schoenberg points from the flat knot
2111 -- used to interpolate a BSpline since the
2112 -- BSpline matrix is invertible.
2114 Interpolate(Degree : Integer ;
2115 FlatKnots : Array1OfReal from TColStd ;
2116 Parameters : Array1OfReal from TColStd ;
2117 ContactOrderArray : Array1OfInteger from TColStd ;
2118 Poles : in out Array1OfPnt from TColgp ;
2119 InversionProblem : out Integer) ;
2120 ---Purpose: Performs the interpolation of the data given in
2121 -- the Poles array according to the requests in
2122 -- ContactOrderArray that is : if
2123 -- ContactOrderArray(i) has value d it means that
2124 -- Poles(i) containes the dth derivative of the
2125 -- function to be interpolated. The length L of the
2126 -- following arrays must be the same :
2127 -- Parameters, ContactOrderArray, Poles,
2128 -- The length of FlatKnots is Degree + L + 1
2130 -- the method used to do that interpolation is
2131 -- gauss elimination WITHOUT pivoting. Thus if the
2132 -- diagonal is not dominant there is no guarantee
2133 -- that the algorithm will work. Nevertheless for
2134 -- Cubic interpolation or interpolation at Scheonberg
2135 -- points the method will work
2136 -- The InversionProblem will report 0 if there was no
2137 -- problem else it will give the index of the faulty
2140 Interpolate(Degree : Integer ;
2141 FlatKnots : Array1OfReal from TColStd ;
2142 Parameters : Array1OfReal from TColStd ;
2143 ContactOrderArray : Array1OfInteger from TColStd ;
2144 Poles : in out Array1OfPnt2d from TColgp ;
2145 InversionProblem : out Integer) ;
2146 ---Purpose: Performs the interpolation of the data given in
2147 -- the Poles array according to the requests in
2148 -- ContactOrderArray that is : if
2149 -- ContactOrderArray(i) has value d it means that
2150 -- Poles(i) containes the dth derivative of the
2151 -- function to be interpolated. The length L of the
2152 -- following arrays must be the same :
2153 -- Parameters, ContactOrderArray, Poles,
2154 -- The length of FlatKnots is Degree + L + 1
2156 -- the method used to do that interpolation is
2157 -- gauss elimination WITHOUT pivoting. Thus if the
2158 -- diagonal is not dominant there is no guarantee
2159 -- that the algorithm will work. Nevertheless for
2160 -- Cubic interpolation at knots or interpolation at Scheonberg
2161 -- points the method will work.
2162 -- The InversionProblem w
2163 -- ll report 0 if there was no
2164 -- problem else it will give the index of the faulty
2167 Interpolate(Degree : Integer ;
2168 FlatKnots : Array1OfReal from TColStd ;
2169 Parameters : Array1OfReal from TColStd ;
2170 ContactOrderArray : Array1OfInteger from TColStd ;
2171 Poles : in out Array1OfPnt from TColgp ;
2172 Weights : in out Array1OfReal from TColStd ;
2173 InversionProblem : out Integer) ;
2174 ---Purpose: Performs the interpolation of the data given in
2175 -- the Poles array according to the requests in
2176 -- ContactOrderArray that is : if
2177 -- ContactOrderArray(i) has value d it means that
2178 -- Poles(i) containes the dth derivative of the
2179 -- function to be interpolated. The length L of the
2180 -- following arrays must be the same :
2181 -- Parameters, ContactOrderArray, Poles,
2182 -- The length of FlatKnots is Degree + L + 1
2184 -- the method used to do that interpolation is
2185 -- gauss elimination WITHOUT pivoting. Thus if the
2186 -- diagonal is not dominant there is no guarantee
2187 -- that the algorithm will work. Nevertheless for
2188 -- Cubic interpolation at knots or interpolation at Scheonberg
2189 -- points the method will work.
2190 -- The InversionProblem will report 0 if there was no
2191 -- problem else it will give the index of the faulty
2196 Interpolate(Degree : Integer ;
2197 FlatKnots : Array1OfReal from TColStd ;
2198 Parameters : Array1OfReal from TColStd ;
2199 ContactOrderArray : Array1OfInteger from TColStd ;
2200 Poles : in out Array1OfPnt2d from TColgp ;
2201 Weights : in out Array1OfReal from TColStd ;
2202 InversionProblem : out Integer) ;
2203 ---Purpose: Performs the interpolation of the data given in
2204 -- the Poles array according to the requests in
2205 -- ContactOrderArray that is : if
2206 -- ContactOrderArray(i) has value d it means that
2207 -- Poles(i) containes the dth derivative of the
2208 -- function to be interpolated. The length L of the
2209 -- following arrays must be the same :
2210 -- Parameters, ContactOrderArray, Poles,
2211 -- The length of FlatKnots is Degree + L + 1
2213 -- the method used to do that interpolation is
2214 -- gauss elimination WITHOUT pivoting. Thus if the
2215 -- diagonal is not dominant there is no guarantee
2216 -- that the algorithm will work. Nevertheless for
2217 -- Cubic interpolation at knots or interpolation at Scheonberg
2218 -- points the method will work.
2219 -- The InversionProblem w
2220 -- ll report 0 if there was no
2221 -- problem else it will give the i
2223 Interpolate(Degree : Integer ;
2224 FlatKnots : Array1OfReal from TColStd ;
2225 Parameters : Array1OfReal from TColStd ;
2226 ContactOrderArray : Array1OfInteger from TColStd ;
2227 ArrayDimension : Integer ;
2228 Poles : in out Real ;
2229 InversionProblem : out Integer) ;
2230 ---Purpose: Performs the interpolation of the data given in
2231 -- the Poles array according to the requests in
2232 -- ContactOrderArray that is : if
2233 -- ContactOrderArray(i) has value d it means that
2234 -- Poles(i) containes the dth derivative of the
2235 -- function to be interpolated. The length L of the
2236 -- following arrays must be the same :
2237 -- Parameters, ContactOrderArray
2238 -- The length of FlatKnots is Degree + L + 1
2239 -- The PolesArray is an seen as an
2240 -- Array[1..N][1..ArrayDimension] with N = tge length
2241 -- of the parameters array
2243 -- the method used to do that interpolation is
2244 -- gauss elimination WITHOUT pivoting. Thus if the
2245 -- diagonal is not dominant there is no guarantee
2246 -- that the algorithm will work. Nevertheless for
2247 -- Cubic interpolation or interpolation at Scheonberg
2248 -- points the method will work
2249 -- The InversionProblem will report 0 if there was no
2250 -- problem else it will give the index of the faulty
2254 Interpolate(Degree : Integer ;
2255 FlatKnots : Array1OfReal from TColStd ;
2256 Parameters : Array1OfReal from TColStd ;
2257 ContactOrderArray : Array1OfInteger from TColStd ;
2258 ArrayDimension : Integer ;
2259 Poles : in out Real ;
2260 Weights : in out Real ;
2261 InversionProblem : out Integer) ;
2263 MovePoint(U : Real; -- parameter of the point
2264 Displ : Vec2d from gp; -- translation vector of the point
2265 Index1 : Integer; -- first movable pole
2266 Index2 : Integer; -- last movable pole
2269 Poles : Array1OfPnt2d from TColgp;
2270 Weights : Array1OfReal from TColStd;
2271 FlatKnots : Array1OfReal from TColStd;
2272 FirstIndex : in out Integer; -- first pole modified
2273 LastIndex : in out Integer; -- last pole modified
2274 NewPoles : in out Array1OfPnt2d from TColgp); -- new poles
2275 ---Purpose: Find the new poles which allows an old point (with a
2276 -- given u as parameter) to reach a new position
2277 -- Index1 and Index2 indicate the range of poles we can move
2278 -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side
2279 -- don't enter (1,NbPoles) -> error: rigid move
2280 -- (2, NbPoles-1) -> the ends are enforced
2281 -- (3, NbPoles-2) -> the ends and the tangency are enforced
2282 -- if Problem in BSplineBasis calculation, no change for the curve
2283 -- and FirstIndex, LastIndex = 0
2285 MovePoint(U : Real; -- parameter of the point
2286 Displ : Vec from gp; -- translation vector of the point
2287 Index1 : Integer; -- first movable pole
2288 Index2 : Integer; -- last movable pole
2291 Poles : Array1OfPnt from TColgp;
2292 Weights : Array1OfReal from TColStd;
2293 FlatKnots : Array1OfReal from TColStd;
2294 FirstIndex : in out Integer; -- first pole modified
2295 LastIndex : in out Integer; -- last pole modified
2296 NewPoles : in out Array1OfPnt from TColgp); -- new poles
2297 ---Purpose: Find the new poles which allows an old point (with a
2298 -- given u as parameter) to reach a new position
2299 -- Index1 and Index2 indicate the range of poles we can move
2300 -- (1, NbPoles-1) or (2, NbPoles) -> no constraint for one side
2301 -- don't enter (1,NbPoles) -> error: rigid move
2302 -- (2, NbPoles-1) -> the ends are enforced
2303 -- (3, NbPoles-2) -> the ends and the tangency are enforced
2304 -- if Problem in BSplineBasis calculation, no change for the curve
2305 -- and FirstIndex, LastIndex = 0
2307 MovePointAndTangent(U : Real ;
2308 ArrayDimension : Integer ;
2309 Delta : in out Real ;
2310 DeltaDerivative : in out Real ;
2313 Rational : Boolean ;
2314 StartingCondition : Integer ;
2315 EndingCondition : Integer ;
2316 Poles : in out Real ;
2317 Weights : Array1OfReal from TColStd;
2318 FlatKnots : Array1OfReal from TColStd;
2319 NewPoles : in out Real ;
2320 ErrorStatus : in out Integer) ;
2321 ---Purpose: This is the dimension free version of the utility
2322 -- U is the parameter must be within the first FlatKnots and the
2323 -- last FlatKnots Delta is the amount the curve has to be moved
2324 -- DeltaDerivative is the amount the derivative has to be moved.
2325 -- Delta and DeltaDerivative must be array of dimension
2326 -- ArrayDimension Degree is the degree of the BSpline and the
2327 -- FlatKnots are the knots of the BSpline Starting Condition if =
2328 -- -1 means the starting point of the curve can move
2330 -- starting point of the cuve cannot move but tangen starting
2331 -- point of the curve cannot move
2332 -- = 1 means the starting point and tangents cannot move
2333 -- = 2 means the starting point tangent and curvature cannot move
2335 -- Same holds for EndingCondition
2336 -- Poles are the poles of the curve
2337 -- Weights are the weights of the curve if Rational = Standard_True
2338 -- NewPoles are the poles of the deformed curve
2339 -- ErrorStatus will be 0 if no error happened
2340 -- 1 if there are not enough knots/poles
2341 -- the imposed conditions
2342 -- The way to solve this problem is to add knots to the BSpline
2343 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2344 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2345 -- have at least 2 internal knots.
2347 MovePointAndTangent(U : Real ;
2348 Delta : Vec from gp ;
2349 DeltaDerivative : Vec from gp ;
2352 Rational : Boolean ;
2353 StartingCondition : Integer ;
2354 EndingCondition : Integer ;
2355 Poles : Array1OfPnt from TColgp ;
2356 Weights : Array1OfReal from TColStd;
2357 FlatKnots : Array1OfReal from TColStd;
2358 NewPoles : in out Array1OfPnt from TColgp ;
2359 ErrorStatus : in out Integer) ;
2360 ---Purpose: This is the dimension free version of the utility
2361 -- U is the parameter must be within the first FlatKnots and the
2362 -- last FlatKnots Delta is the amount the curve has to be moved
2363 -- DeltaDerivative is the amount the derivative has to be moved.
2364 -- Delta and DeltaDerivative must be array of dimension
2365 -- ArrayDimension Degree is the degree of the BSpline and the
2366 -- FlatKnots are the knots of the BSpline Starting Condition if =
2367 -- -1 means the starting point of the curve can move
2369 -- starting point of the cuve cannot move but tangen starting
2370 -- point of the curve cannot move
2371 -- = 1 means the starting point and tangents cannot move
2372 -- = 2 means the starting point tangent and curvature cannot move
2374 -- Same holds for EndingCondition
2375 -- Poles are the poles of the curve
2376 -- Weights are the weights of the curve if Rational = Standard_True
2377 -- NewPoles are the poles of the deformed curve
2378 -- ErrorStatus will be 0 if no error happened
2379 -- 1 if there are not enough knots/poles
2380 -- the imposed conditions
2381 -- The way to solve this problem is to add knots to the BSpline
2382 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2383 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2384 -- have at least 2 internal knots.
2386 MovePointAndTangent(U : Real ;
2387 Delta : Vec2d from gp ;
2388 DeltaDerivative : Vec2d from gp ;
2391 Rational : Boolean ;
2392 StartingCondition : Integer ;
2393 EndingCondition : Integer ;
2394 Poles : Array1OfPnt2d from TColgp ;
2395 Weights : Array1OfReal from TColStd ;
2396 FlatKnots : Array1OfReal from TColStd ;
2397 NewPoles : in out Array1OfPnt2d from TColgp ;
2398 ErrorStatus : in out Integer) ;
2399 ---Purpose: This is the dimension free version of the utility
2400 -- U is the parameter must be within the first FlatKnots and the
2401 -- last FlatKnots Delta is the amount the curve has to be moved
2402 -- DeltaDerivative is the amount the derivative has to be moved.
2403 -- Delta and DeltaDerivative must be array of dimension
2404 -- ArrayDimension Degree is the degree of the BSpline and the
2405 -- FlatKnots are the knots of the BSpline Starting Condition if =
2406 -- -1 means the starting point of the curve can move
2408 -- starting point of the cuve cannot move but tangen starting
2409 -- point of the curve cannot move
2410 -- = 1 means the starting point and tangents cannot move
2411 -- = 2 means the starting point tangent and curvature cannot move
2413 -- Same holds for EndingCondition
2414 -- Poles are the poles of the curve
2415 -- Weights are the weights of the curve if Rational = Standard_True
2416 -- NewPoles are the poles of the deformed curve
2417 -- ErrorStatus will be 0 if no error happened
2418 -- 1 if there are not enough knots/poles
2419 -- the imposed conditions
2420 -- The way to solve this problem is to add knots to the BSpline
2421 -- If StartCondition = 1 and EndCondition = 1 then you need at least
2422 -- 4 + 2 = 6 poles so for example to have a C1 cubic you will need
2423 -- have at least 2 internal knots.
2425 Resolution( PolesArray : in out Real ;
2426 ArrayDimension : Integer ;
2427 NumPoles : Integer ;
2428 Weights : in Array1OfReal from TColStd;
2429 FlatKnots : in Array1OfReal from TColStd;
2430 Degree : in Integer;
2431 Tolerance3D : Real from Standard ;
2432 UTolerance : out Real from Standard) ;
2434 -- given a tolerance in 3D space returns a
2435 -- tolerance in U parameter space such that
2436 -- all u1 and u0 in the domain of the curve f(u)
2437 -- | u1 - u0 | < UTolerance and
2438 -- we have |f (u1) - f (u0)| < Tolerance3D
2440 Resolution( Poles : in Array1OfPnt from TColgp ;
2441 Weights : in Array1OfReal from TColStd ;
2442 NumPoles : in Integer from Standard ;
2443 FlatKnots : in Array1OfReal from TColStd ;
2444 Degree : in Integer from Standard ;
2445 Tolerance3D : Real from Standard ;
2446 UTolerance : out Real from Standard) ;
2448 -- given a tolerance in 3D space returns a
2449 -- tolerance in U parameter space such that
2450 -- all u1 and u0 in the domain of the curve f(u)
2451 -- | u1 - u0 | < UTolerance and
2452 -- we have |f (u1) - f (u0)| < Tolerance3D
2454 Resolution( Poles : in Array1OfPnt2d from TColgp ;
2455 Weights : in Array1OfReal from TColStd ;
2456 NumPoles : in Integer from Standard ;
2457 FlatKnots : in Array1OfReal from TColStd ;
2458 Degree : in Integer ;
2459 Tolerance3D : Real from Standard ;
2460 UTolerance : out Real from Standard) ;
2462 -- given a tolerance in 3D space returns a
2463 -- tolerance in U parameter space such that
2464 -- all u1 and u0 in the domain of the curve f(u)
2465 -- | u1 - u0 | < UTolerance and
2466 -- we have |f (u1) - f (u0)| < Tolerance3D