1 // Created on: 1993-03-09
3 // Copyright (c) 1993-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 #ifndef _Geom_BSplineSurface_HeaderFile
18 #define _Geom_BSplineSurface_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <GeomAbs_BSplKnotDistribution.hxx>
25 #include <GeomAbs_Shape.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColgp_HArray2OfPnt.hxx>
28 #include <TColStd_HArray2OfReal.hxx>
29 #include <TColStd_HArray1OfReal.hxx>
30 #include <TColStd_HArray1OfInteger.hxx>
31 #include <Standard_Real.hxx>
32 #include <Geom_BoundedSurface.hxx>
33 #include <TColgp_Array2OfPnt.hxx>
34 #include <TColStd_Array1OfReal.hxx>
35 #include <TColStd_Array1OfInteger.hxx>
36 #include <TColStd_Array2OfReal.hxx>
37 #include <TColgp_Array1OfPnt.hxx>
38 class Standard_ConstructionError;
39 class Standard_DimensionError;
40 class Standard_DomainError;
41 class Standard_OutOfRange;
42 class Standard_NoSuchObject;
43 class Standard_RangeError;
44 class Geom_UndefinedDerivative;
52 class Geom_BSplineSurface;
53 DEFINE_STANDARD_HANDLE(Geom_BSplineSurface, Geom_BoundedSurface)
55 //! Describes a BSpline surface.
56 //! In each parametric direction, a BSpline surface can be:
57 //! - uniform or non-uniform,
58 //! - rational or non-rational,
59 //! - periodic or non-periodic.
60 //! A BSpline surface is defined by:
61 //! - its degrees, in the u and v parametric directions,
62 //! - its periodic characteristic, in the u and v parametric directions,
63 //! - a table of poles, also called control points (together
64 //! with the associated weights if the surface is rational), and
65 //! - a table of knots, together with the associated multiplicities.
66 //! The degree of a Geom_BSplineSurface is limited to
67 //! a value (25) which is defined and controlled by the
68 //! system. This value is returned by the function MaxDegree.
70 //! Poles and Weights are manipulated using two associative double arrays:
71 //! - the poles table, which is a double array of gp_Pnt points, and
72 //! - the weights table, which is a double array of reals.
73 //! The bounds of the poles and weights arrays are:
74 //! - 1 and NbUPoles for the row bounds (provided
75 //! that the BSpline surface is not periodic in the u
76 //! parametric direction), where NbUPoles is the
77 //! number of poles of the surface in the u parametric direction, and
78 //! - 1 and NbVPoles for the column bounds (provided
79 //! that the BSpline surface is not periodic in the v
80 //! parametric direction), where NbVPoles is the
81 //! number of poles of the surface in the v parametric direction.
82 //! The poles of the surface are the points used to shape
83 //! and reshape the surface. They comprise a rectangular network.
84 //! If the surface is not periodic:
85 //! - The points (1, 1), (NbUPoles, 1), (1,
86 //! NbVPoles), and (NbUPoles, NbVPoles)
87 //! are the four parametric "corners" of the surface.
88 //! - The first column of poles and the last column of
89 //! poles define two BSpline curves which delimit the
90 //! surface in the v parametric direction. These are the
91 //! v isoparametric curves corresponding to the two
92 //! bounds of the v parameter.
93 //! - The first row of poles and the last row of poles
94 //! define two BSpline curves which delimit the surface
95 //! in the u parametric direction. These are the u
96 //! isoparametric curves corresponding to the two bounds of the u parameter.
97 //! If the surface is periodic, these geometric properties are not verified.
98 //! It is more difficult to define a geometrical significance
99 //! for the weights. However they are useful for
100 //! representing a quadric surface precisely. Moreover, if
101 //! the weights of all the poles are equal, the surface has
102 //! a polynomial equation, and hence is a "non-rational surface".
103 //! The non-rational surface is a special, but frequently
104 //! used, case, where all poles have identical weights.
105 //! The weights are defined and used only in the case of
106 //! a rational surface. The rational characteristic is
107 //! defined in each parametric direction. A surface can be
108 //! rational in the u parametric direction, and
109 //! non-rational in the v parametric direction.
110 //! Knots and Multiplicities
111 //! For a Geom_BSplineSurface the table of knots is
112 //! made up of two increasing sequences of reals, without
113 //! repetition, one for each parametric direction. The
114 //! multiplicities define the repetition of the knots.
115 //! A BSpline surface comprises multiple contiguous
116 //! patches, which are themselves polynomial or rational
117 //! surfaces. The knots are the parameters of the
118 //! isoparametric curves which limit these contiguous
119 //! patches. The multiplicity of a knot on a BSpline
120 //! surface (in a given parametric direction) is related to
121 //! the degree of continuity of the surface at that knot in
122 //! that parametric direction:
123 //! Degree of continuity at knot(i) = Degree - Multi(i) where:
124 //! - Degree is the degree of the BSpline surface in
125 //! the given parametric direction, and
126 //! - Multi(i) is the multiplicity of knot number i in
127 //! the given parametric direction.
128 //! There are some special cases, where the knots are
129 //! regularly spaced in one parametric direction (i.e. the
130 //! difference between two consecutive knots is a constant).
131 //! - "Uniform": all the multiplicities are equal to 1.
132 //! - "Quasi-uniform": all the multiplicities are equal to 1,
133 //! except for the first and last knots in this parametric
134 //! direction, and these are equal to Degree + 1.
135 //! - "Piecewise Bezier": all the multiplicities are equal to
136 //! Degree except for the first and last knots, which
137 //! are equal to Degree + 1. This surface is a
138 //! concatenation of Bezier patches in the given
139 //! parametric direction.
140 //! If the BSpline surface is not periodic in a given
141 //! parametric direction, the bounds of the knots and
142 //! multiplicities tables are 1 and NbKnots, where
143 //! NbKnots is the number of knots of the BSpline
144 //! surface in that parametric direction.
145 //! If the BSpline surface is periodic in a given parametric
146 //! direction, and there are k periodic knots and p
147 //! periodic poles in that parametric direction:
148 //! - the period is such that:
149 //! period = Knot(k+1) - Knot(1), and
150 //! - the poles and knots tables in that parametric
151 //! direction can be considered as infinite tables, such that:
152 //! Knot(i+k) = Knot(i) + period, and
153 //! Pole(i+p) = Pole(i)
154 //! Note: The data structure tables for a periodic BSpline
155 //! surface are more complex than those of a non-periodic one.
157 //! . A survey of curve and surface methods in CADG Wolfgang BOHM
159 //! . On de Boor-like algorithms and blossoming Wolfgang BOEHM
161 //! . Blossoming and knot insertion algorithms for B-spline curves
162 //! Ronald N. GOLDMAN
163 //! . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA
164 //! . Curves and Surfaces for Computer Aided Geometric Design,
165 //! a practical guide Gerald Farin
166 class Geom_BSplineSurface : public Geom_BoundedSurface
172 //! Creates a non-rational b-spline surface (weights
173 //! default value is 1.).
174 //! The following conditions must be verified.
175 //! 0 < UDegree <= MaxDegree.
176 //! UKnots.Length() == UMults.Length() >= 2
177 //! UKnots(i) < UKnots(i+1) (Knots are increasing)
178 //! 1 <= UMults(i) <= UDegree
179 //! On a non uperiodic surface the first and last
180 //! umultiplicities may be UDegree+1 (this is even
181 //! recommanded if you want the curve to start and finish on
182 //! the first and last pole).
183 //! On a uperiodic surface the first and the last
184 //! umultiplicities must be the same.
185 //! on non-uperiodic surfaces
186 //! Poles.ColLength() == Sum(UMults(i)) - UDegree - 1 >= 2
187 //! on uperiodic surfaces
188 //! Poles.ColLength() == Sum(UMults(i)) except the first or last
189 //! The previous conditions for U holds also for V, with the
190 //! RowLength of the poles.
191 Standard_EXPORT Geom_BSplineSurface(const TColgp_Array2OfPnt& Poles, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger& VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean UPeriodic = Standard_False, const Standard_Boolean VPeriodic = Standard_False);
193 //! Creates a non-rational b-spline surface (weights
194 //! default value is 1.).
196 //! The following conditions must be verified.
197 //! 0 < UDegree <= MaxDegree.
199 //! UKnots.Length() == UMults.Length() >= 2
201 //! UKnots(i) < UKnots(i+1) (Knots are increasing)
202 //! 1 <= UMults(i) <= UDegree
204 //! On a non uperiodic surface the first and last
205 //! umultiplicities may be UDegree+1 (this is even
206 //! recommanded if you want the curve to start and finish on
207 //! the first and last pole).
209 //! On a uperiodic surface the first and the last
210 //! umultiplicities must be the same.
212 //! on non-uperiodic surfaces
214 //! Poles.ColLength() == Sum(UMults(i)) - UDegree - 1 >= 2
216 //! on uperiodic surfaces
218 //! Poles.ColLength() == Sum(UMults(i)) except the first or
221 //! The previous conditions for U holds also for V, with the
222 //! RowLength of the poles.
223 Standard_EXPORT Geom_BSplineSurface(const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal& Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger& VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean UPeriodic = Standard_False, const Standard_Boolean VPeriodic = Standard_False);
225 //! Exchanges the u and v parametric directions on
226 //! this BSpline surface.
227 //! As a consequence:
228 //! - the poles and weights tables are transposed,
229 //! - the knots and multiplicities tables are exchanged,
230 //! - degrees of continuity, and rational, periodic and
231 //! uniform characteristics are exchanged, and
232 //! - the orientation of the surface is inverted.
233 Standard_EXPORT void ExchangeUV();
235 //! Sets the surface U periodic.
236 //! Modifies this surface to be periodic in the U
237 //! parametric direction.
238 //! To become periodic in a given parametric direction a
239 //! surface must be closed in that parametric direction,
240 //! and the knot sequence relative to that direction must be periodic.
241 //! To generate this periodic sequence of knots, the
242 //! functions FirstUKnotIndex and LastUKnotIndex are used to
243 //! compute I1 and I2. These are the indexes, in the
244 //! knot array associated with the given parametric
245 //! direction, of the knots that correspond to the first and
246 //! last parameters of this BSpline surface in the given
247 //! parametric direction. Hence the period is:
248 //! Knots(I1) - Knots(I2)
249 //! As a result, the knots and poles tables are modified.
251 //! Standard_ConstructionError if the surface is not
252 //! closed in the given parametric direction.
253 Standard_EXPORT void SetUPeriodic();
255 //! Sets the surface V periodic.
256 //! Modifies this surface to be periodic in the V
257 //! parametric direction.
258 //! To become periodic in a given parametric direction a
259 //! surface must be closed in that parametric direction,
260 //! and the knot sequence relative to that direction must be periodic.
261 //! To generate this periodic sequence of knots, the
262 //! functions FirstVKnotIndex and LastVKnotIndex are used to
263 //! compute I1 and I2. These are the indexes, in the
264 //! knot array associated with the given parametric
265 //! direction, of the knots that correspond to the first and
266 //! last parameters of this BSpline surface in the given
267 //! parametric direction. Hence the period is:
268 //! Knots(I1) - Knots(I2)
269 //! As a result, the knots and poles tables are modified.
271 //! Standard_ConstructionError if the surface is not
272 //! closed in the given parametric direction.
273 Standard_EXPORT void SetVPeriodic();
275 //! returns the parameter normalized within
276 //! the period if the surface is periodic : otherwise
277 //! does not do anything
278 Standard_EXPORT void PeriodicNormalization (Standard_Real& U, Standard_Real& V) const;
280 //! Assigns the knot of index Index in the knots table in
281 //! the corresponding parametric direction to be the
282 //! origin of this periodic BSpline surface. As a
283 //! consequence, the knots and poles tables are modified.
285 //! Standard_NoSuchObject if this BSpline surface is
286 //! not periodic in the given parametric direction.
287 //! Standard_DomainError if Index is outside the
288 //! bounds of the knots table in the given parametric direction.
289 Standard_EXPORT void SetUOrigin (const Standard_Integer Index);
291 //! Assigns the knot of index Index in the knots table in
292 //! the corresponding parametric direction to be the
293 //! origin of this periodic BSpline surface. As a
294 //! consequence, the knots and poles tables are modified.
296 //! Standard_NoSuchObject if this BSpline surface is
297 //! not periodic in the given parametric direction.
298 //! Standard_DomainError if Index is outside the
299 //! bounds of the knots table in the given parametric direction.
300 Standard_EXPORT void SetVOrigin (const Standard_Integer Index);
302 //! Sets the surface U not periodic.
303 //! Changes this BSpline surface into a non-periodic
304 //! surface along U direction.
305 //! If this surface is already non-periodic, it is not modified.
306 //! Note: the poles and knots tables are modified.
307 Standard_EXPORT void SetUNotPeriodic();
309 //! Sets the surface V not periodic.
310 //! Changes this BSpline surface into a non-periodic
311 //! surface along V direction.
312 //! If this surface is already non-periodic, it is not modified.
313 //! Note: the poles and knots tables are modified.
314 Standard_EXPORT void SetVNotPeriodic();
316 //! Changes the orientation of this BSpline surface in the
317 //! U parametric direction. The bounds of the
318 //! surface are not changed but the given parametric
319 //! direction is reversed. Hence the orientation of the
320 //! surface is reversed.
321 //! The knots and poles tables are modified.
322 Standard_EXPORT void UReverse() Standard_OVERRIDE;
324 //! Changes the orientation of this BSpline surface in the
325 //! V parametric direction. The bounds of the
326 //! surface are not changed but the given parametric
327 //! direction is reversed. Hence the orientation of the
328 //! surface is reversed.
329 //! The knots and poles tables are modified.
330 Standard_EXPORT void VReverse() Standard_OVERRIDE;
332 //! Computes the u parameter on the modified
333 //! surface, produced by reversing its U parametric
334 //! direction, for the point of u parameter U, on this BSpline surface.
335 //! For a BSpline surface, these functions return respectively:
336 //! - UFirst + ULast - U,
337 //! where UFirst, ULast are
338 //! the values of the first and last parameters of this
339 //! BSpline surface, in the u parametric directions.
340 Standard_EXPORT Standard_Real UReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
342 //! Computes the v parameter on the modified
343 //! surface, produced by reversing its V parametric
344 //! direction, for the point of v parameter V on this BSpline surface.
345 //! For a BSpline surface, these functions return respectively:
346 //! - VFirst + VLast - V,
347 //! VFirst and VLast are
348 //! the values of the first and last parameters of this
349 //! BSpline surface, in the v pametric directions.
350 Standard_EXPORT Standard_Real VReversedParameter (const Standard_Real V) const Standard_OVERRIDE;
352 //! Increases the degrees of this BSpline surface to
353 //! UDegree and VDegree in the u and v parametric
354 //! directions respectively. As a result, the tables of poles,
355 //! weights and multiplicities are modified. The tables of
356 //! knots is not changed.
357 //! Note: Nothing is done if the given degree is less than
358 //! or equal to the current degree in the corresponding
359 //! parametric direction.
361 //! Standard_ConstructionError if UDegree or
362 //! VDegree is greater than
363 //! Geom_BSplineSurface::MaxDegree().
364 Standard_EXPORT void IncreaseDegree (const Standard_Integer UDegree, const Standard_Integer VDegree);
366 //! Inserts into the knots table for the U
367 //! parametric direction of this BSpline surface:
368 //! - the values of the array Knots, with their respective
369 //! multiplicities, Mults.
370 //! If the knot value to insert already exists in the table, its multiplicity is:
371 //! - increased by M, if Add is true (the default), or
372 //! - increased to M, if Add is false.
373 //! The tolerance criterion used to check the equality of
374 //! the knots is the larger of the values ParametricTolerance and
375 //! Standard_Real::Epsilon(val), where val is the knot value to be inserted.
377 //! - If a given multiplicity coefficient is null, or negative, nothing is done.
378 //! - The new multiplicity of a knot is limited to the degree of this BSpline surface in the
379 //! corresponding parametric direction.
381 //! Standard_ConstructionError if a knot value to
382 //! insert is outside the bounds of this BSpline surface in
383 //! the specified parametric direction. The comparison
384 //! uses the precision criterion ParametricTolerance.
385 Standard_EXPORT void InsertUKnots (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Real ParametricTolerance = 0.0, const Standard_Boolean Add = Standard_True);
387 //! Inserts into the knots table for the V
388 //! parametric direction of this BSpline surface:
389 //! - the values of the array Knots, with their respective
390 //! multiplicities, Mults.
391 //! If the knot value to insert already exists in the table, its multiplicity is:
392 //! - increased by M, if Add is true (the default), or
393 //! - increased to M, if Add is false.
394 //! The tolerance criterion used to check the equality of
395 //! the knots is the larger of the values ParametricTolerance and
396 //! Standard_Real::Epsilon(val), where val is the knot value to be inserted.
398 //! - If a given multiplicity coefficient is null, or negative, nothing is done.
399 //! - The new multiplicity of a knot is limited to the degree of this BSpline surface in the
400 //! corresponding parametric direction.
402 //! Standard_ConstructionError if a knot value to
403 //! insert is outside the bounds of this BSpline surface in
404 //! the specified parametric direction. The comparison
405 //! uses the precision criterion ParametricTolerance.
406 Standard_EXPORT void InsertVKnots (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Real ParametricTolerance = 0.0, const Standard_Boolean Add = Standard_True);
408 //! Reduces to M the multiplicity of the knot of index
409 //! Index in the U parametric direction. If M is 0, the knot is removed.
410 //! With a modification of this type, the table of poles is also modified.
411 //! Two different algorithms are used systematically to
412 //! compute the new poles of the surface. For each
413 //! pole, the distance between the pole calculated
414 //! using the first algorithm and the same pole
415 //! calculated using the second algorithm, is checked. If
416 //! this distance is less than Tolerance it ensures that
417 //! the surface is not modified by more than Tolerance.
418 //! Under these conditions, the function returns true;
419 //! otherwise, it returns false.
420 //! A low tolerance prevents modification of the
421 //! surface. A high tolerance "smoothes" the surface.
423 //! Standard_OutOfRange if Index is outside the
424 //! bounds of the knots table of this BSpline surface.
425 Standard_EXPORT Standard_Boolean RemoveUKnot (const Standard_Integer Index, const Standard_Integer M, const Standard_Real Tolerance);
427 //! Reduces to M the multiplicity of the knot of index
428 //! Index in the V parametric direction. If M is 0, the knot is removed.
429 //! With a modification of this type, the table of poles is also modified.
430 //! Two different algorithms are used systematically to
431 //! compute the new poles of the surface. For each
432 //! pole, the distance between the pole calculated
433 //! using the first algorithm and the same pole
434 //! calculated using the second algorithm, is checked. If
435 //! this distance is less than Tolerance it ensures that
436 //! the surface is not modified by more than Tolerance.
437 //! Under these conditions, the function returns true;
438 //! otherwise, it returns false.
439 //! A low tolerance prevents modification of the
440 //! surface. A high tolerance "smoothes" the surface.
442 //! Standard_OutOfRange if Index is outside the
443 //! bounds of the knots table of this BSpline surface.
444 Standard_EXPORT Standard_Boolean RemoveVKnot (const Standard_Integer Index, const Standard_Integer M, const Standard_Real Tolerance);
447 //! Increases the multiplicity of the knot of range UIndex
448 //! in the UKnots sequence.
449 //! M is the new multiplicity. M must be greater than the
450 //! previous multiplicity and lower or equal to the degree
451 //! of the surface in the U parametric direction.
452 //! Raised if M is not in the range [1, UDegree]
454 //! Raised if UIndex is not in the range [FirstUKnotIndex,
455 //! LastUKnotIndex] given by the methods with the same name.
456 Standard_EXPORT void IncreaseUMultiplicity (const Standard_Integer UIndex, const Standard_Integer M);
459 //! Increases until order M the multiplicity of the set of knots
460 //! FromI1,...., ToI2 in the U direction. This method can be used
461 //! to make a B_spline surface into a PiecewiseBezier B_spline
463 //! If <me> was uniform, it can become non uniform.
465 //! Raised if FromI1 or ToI2 is out of the range [FirstUKnotIndex,
468 //! M should be greater than the previous multiplicity of the
469 //! all the knots FromI1,..., ToI2 and lower or equal to the
470 //! Degree of the surface in the U parametric direction.
471 Standard_EXPORT void IncreaseUMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer M);
474 //! Increments the multiplicity of the consecutives uknots FromI1..ToI2
475 //! by step. The multiplicity of each knot FromI1,.....,ToI2 must be
476 //! lower or equal to the UDegree of the B_spline.
478 //! Raised if FromI1 or ToI2 is not in the range
479 //! [FirstUKnotIndex, LastUKnotIndex]
481 //! Raised if one knot has a multiplicity greater than UDegree.
482 Standard_EXPORT void IncrementUMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer Step);
485 //! Increases the multiplicity of a knot in the V direction.
486 //! M is the new multiplicity.
488 //! M should be greater than the previous multiplicity and lower
489 //! than the degree of the surface in the V parametric direction.
491 //! Raised if VIndex is not in the range [FirstVKnotIndex,
492 //! LastVKnotIndex] given by the methods with the same name.
493 Standard_EXPORT void IncreaseVMultiplicity (const Standard_Integer VIndex, const Standard_Integer M);
496 //! Increases until order M the multiplicity of the set of knots
497 //! FromI1,...., ToI2 in the V direction. This method can be used to
498 //! make a BSplineSurface into a PiecewiseBezier B_spline
499 //! surface. If <me> was uniform, it can become non-uniform.
501 //! Raised if FromI1 or ToI2 is out of the range [FirstVKnotIndex,
502 //! LastVKnotIndex] given by the methods with the same name.
504 //! M should be greater than the previous multiplicity of the
505 //! all the knots FromI1,..., ToI2 and lower or equal to the
506 //! Degree of the surface in the V parametric direction.
507 Standard_EXPORT void IncreaseVMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer M);
510 //! Increments the multiplicity of the consecutives vknots FromI1..ToI2
511 //! by step. The multiplicity of each knot FromI1,.....,ToI2 must be
512 //! lower or equal to the VDegree of the B_spline.
514 //! Raised if FromI1 or ToI2 is not in the range
515 //! [FirstVKnotIndex, LastVKnotIndex]
517 //! Raised if one knot has a multiplicity greater than VDegree.
518 Standard_EXPORT void IncrementVMultiplicity (const Standard_Integer FromI1, const Standard_Integer ToI2, const Standard_Integer Step);
521 //! Inserts a knot value in the sequence of UKnots. If U is a knot
522 //! value this method increases the multiplicity of the knot if the
523 //! previous multiplicity was lower than M else it does nothing. The
524 //! tolerance criterion is ParametricTolerance. ParametricTolerance
525 //! should be greater or equal than Resolution from package gp.
527 //! Raised if U is out of the bounds [U1, U2] given by the methods
528 //! Bounds, the criterion ParametricTolerance is used.
529 //! Raised if M is not in the range [1, UDegree].
530 Standard_EXPORT void InsertUKnot (const Standard_Real U, const Standard_Integer M, const Standard_Real ParametricTolerance, const Standard_Boolean Add = Standard_True);
533 //! Inserts a knot value in the sequence of VKnots. If V is a knot
534 //! value this method increases the multiplicity of the knot if the
535 //! previous multiplicity was lower than M otherwise it does nothing.
536 //! The tolerance criterion is ParametricTolerance.
537 //! ParametricTolerance should be greater or equal than Resolution
540 //! raises if V is out of the Bounds [V1, V2] given by the methods
541 //! Bounds, the criterion ParametricTolerance is used.
542 //! raises if M is not in the range [1, VDegree].
543 Standard_EXPORT void InsertVKnot (const Standard_Real V, const Standard_Integer M, const Standard_Real ParametricTolerance, const Standard_Boolean Add = Standard_True);
546 //! Segments the surface between U1 and U2 in the U-Direction.
547 //! between V1 and V2 in the V-Direction.
548 //! The control points are modified, the first and the last point
549 //! are not the same.
551 //! Even if <me> is not closed it can become closed after the
552 //! segmentation for example if U1 or U2 are out of the bounds
553 //! of the surface <me> or if the surface makes loop.
554 //! raises if U2 < U1 or V2 < V1
555 Standard_EXPORT void Segment (const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2);
558 //! Segments the surface between U1 and U2 in the U-Direction.
559 //! between V1 and V2 in the V-Direction.
561 //! same as Segment but do nothing if U1 and U2 (resp. V1 and V2) are
562 //! equal to the bounds in U (resp. in V) of <me>.
563 //! For example, if <me> is periodic in V, it will be always periodic
564 //! in V after the segmentation if the bounds in V are unchanged
567 //! Even if <me> is not closed it can become closed after the
568 //! segmentation for example if U1 or U2 are out of the bounds
569 //! of the surface <me> or if the surface makes loop.
570 //! raises if U2 < U1 or V2 < V1
571 Standard_EXPORT void CheckAndSegment (const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2);
573 //! Substitutes the UKnots of range UIndex with K.
575 //! Raised if UIndex < 1 or UIndex > NbUKnots
577 //! Raised if K >= UKnots(UIndex+1) or K <= UKnots(UIndex-1)
578 Standard_EXPORT void SetUKnot (const Standard_Integer UIndex, const Standard_Real K);
580 //! Changes all the U-knots of the surface.
581 //! The multiplicity of the knots are not modified.
583 //! Raised if there is an index such that UK (Index+1) <= UK (Index).
585 //! Raised if UK.Lower() < 1 or UK.Upper() > NbUKnots
586 Standard_EXPORT void SetUKnots (const TColStd_Array1OfReal& UK);
589 //! Changes the value of the UKnots of range UIndex and
590 //! increases its multiplicity.
592 //! Raised if UIndex is not in the range [FirstUKnotIndex,
593 //! LastUKnotIndex] given by the methods with the same name.
595 //! Raised if K >= UKnots(UIndex+1) or K <= UKnots(UIndex-1)
596 //! M must be lower than UDegree and greater than the previous
597 //! multiplicity of the knot of range UIndex.
598 Standard_EXPORT void SetUKnot (const Standard_Integer UIndex, const Standard_Real K, const Standard_Integer M);
600 //! Substitutes the VKnots of range VIndex with K.
602 //! Raised if VIndex < 1 or VIndex > NbVKnots
604 //! Raised if K >= VKnots(VIndex+1) or K <= VKnots(VIndex-1)
605 Standard_EXPORT void SetVKnot (const Standard_Integer VIndex, const Standard_Real K);
607 //! Changes all the V-knots of the surface.
608 //! The multiplicity of the knots are not modified.
610 //! Raised if there is an index such that VK (Index+1) <= VK (Index).
612 //! Raised if VK.Lower() < 1 or VK.Upper() > NbVKnots
613 Standard_EXPORT void SetVKnots (const TColStd_Array1OfReal& VK);
616 //! Changes the value of the VKnots of range VIndex and increases
617 //! its multiplicity.
619 //! Raised if VIndex is not in the range [FirstVKnotIndex,
620 //! LastVKnotIndex] given by the methods with the same name.
622 //! Raised if K >= VKnots(VIndex+1) or K <= VKnots(VIndex-1)
623 //! M must be lower than VDegree and greater than the previous
624 //! multiplicity of the knot of range VIndex.
625 Standard_EXPORT void SetVKnot (const Standard_Integer VIndex, const Standard_Real K, const Standard_Integer M);
628 //! Locates the parametric value U in the sequence of UKnots.
629 //! If "WithKnotRepetition" is True we consider the knot's
630 //! representation with repetition of multiple knot value,
631 //! otherwise we consider the knot's representation with
632 //! no repetition of multiple knot values.
633 //! UKnots (I1) <= U <= UKnots (I2)
634 //! . if I1 = I2 U is a knot value (the tolerance criterion
635 //! ParametricTolerance is used).
636 //! . if I1 < 1 => U < UKnots(1) - Abs(ParametricTolerance)
637 //! . if I2 > NbUKnots => U > UKnots(NbUKnots)+Abs(ParametricTolerance)
638 Standard_EXPORT void LocateU (const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer& I1, Standard_Integer& I2, const Standard_Boolean WithKnotRepetition = Standard_False) const;
641 //! Locates the parametric value V in the sequence of knots.
642 //! If "WithKnotRepetition" is True we consider the knot's
643 //! representation with repetition of multiple knot value,
644 //! otherwise we consider the knot's representation with
645 //! no repetition of multiple knot values.
646 //! VKnots (I1) <= V <= VKnots (I2)
647 //! . if I1 = I2 V is a knot value (the tolerance criterion
648 //! ParametricTolerance is used).
649 //! . if I1 < 1 => V < VKnots(1) - Abs(ParametricTolerance)
650 //! . if I2 > NbVKnots => V > VKnots(NbVKnots)+Abs(ParametricTolerance)
651 //! poles insertion and removing
652 //! The following methods are available only if the surface
653 //! is Uniform or QuasiUniform in the considered direction
654 //! The knot repartition is modified.
655 Standard_EXPORT void LocateV (const Standard_Real V, const Standard_Real ParametricTolerance, Standard_Integer& I1, Standard_Integer& I2, const Standard_Boolean WithKnotRepetition = Standard_False) const;
658 //! Substitutes the pole of range (UIndex, VIndex) with P.
659 //! If the surface is rational the weight of range (UIndex, VIndex)
662 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
663 //! VIndex > NbVPoles.
664 Standard_EXPORT void SetPole (const Standard_Integer UIndex, const Standard_Integer VIndex, const gp_Pnt& P);
667 //! Substitutes the pole and the weight of range (UIndex, VIndex)
670 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
671 //! VIndex > NbVPoles.
672 //! Raised if Weight <= Resolution from package gp.
673 Standard_EXPORT void SetPole (const Standard_Integer UIndex, const Standard_Integer VIndex, const gp_Pnt& P, const Standard_Real Weight);
676 //! Changes a column of poles or a part of this column.
677 //! Raised if Vindex < 1 or VIndex > NbVPoles.
679 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbUPoles.
680 Standard_EXPORT void SetPoleCol (const Standard_Integer VIndex, const TColgp_Array1OfPnt& CPoles);
683 //! Changes a column of poles or a part of this column with the
684 //! corresponding weights. If the surface was rational it can
685 //! become non rational. If the surface was non rational it can
687 //! Raised if Vindex < 1 or VIndex > NbVPoles.
689 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbUPoles
690 //! Raised if the bounds of CPoleWeights are not the same as the
691 //! bounds of CPoles.
692 //! Raised if one of the weight value of CPoleWeights is lower or
693 //! equal to Resolution from package gp.
694 Standard_EXPORT void SetPoleCol (const Standard_Integer VIndex, const TColgp_Array1OfPnt& CPoles, const TColStd_Array1OfReal& CPoleWeights);
697 //! Changes a row of poles or a part of this row with the
698 //! corresponding weights. If the surface was rational it can
699 //! become non rational. If the surface was non rational it can
701 //! Raised if Uindex < 1 or UIndex > NbUPoles.
703 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbVPoles
704 //! raises if the bounds of CPoleWeights are not the same as the
705 //! bounds of CPoles.
706 //! Raised if one of the weight value of CPoleWeights is lower or
707 //! equal to Resolution from package gp.
708 Standard_EXPORT void SetPoleRow (const Standard_Integer UIndex, const TColgp_Array1OfPnt& CPoles, const TColStd_Array1OfReal& CPoleWeights);
711 //! Changes a row of poles or a part of this row.
712 //! Raised if Uindex < 1 or UIndex > NbUPoles.
714 //! Raised if CPoles.Lower() < 1 or CPoles.Upper() > NbVPoles.
715 Standard_EXPORT void SetPoleRow (const Standard_Integer UIndex, const TColgp_Array1OfPnt& CPoles);
718 //! Changes the weight of the pole of range UIndex, VIndex.
719 //! If the surface was non rational it can become rational.
720 //! If the surface was rational it can become non rational.
722 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
723 //! VIndex > NbVPoles
725 //! Raised if weight is lower or equal to Resolution from
727 Standard_EXPORT void SetWeight (const Standard_Integer UIndex, const Standard_Integer VIndex, const Standard_Real Weight);
730 //! Changes a column of weights of a part of this column.
732 //! Raised if VIndex < 1 or VIndex > NbVPoles
734 //! Raised if CPoleWeights.Lower() < 1 or
735 //! CPoleWeights.Upper() > NbUPoles.
736 //! Raised if a weight value is lower or equal to Resolution
738 Standard_EXPORT void SetWeightCol (const Standard_Integer VIndex, const TColStd_Array1OfReal& CPoleWeights);
741 //! Changes a row of weights or a part of this row.
743 //! Raised if UIndex < 1 or UIndex > NbUPoles
745 //! Raised if CPoleWeights.Lower() < 1 or
746 //! CPoleWeights.Upper() > NbVPoles.
747 //! Raised if a weight value is lower or equal to Resolution
749 Standard_EXPORT void SetWeightRow (const Standard_Integer UIndex, const TColStd_Array1OfReal& CPoleWeights);
751 //! Move a point with parameter U and V to P.
752 //! given u,v as parameters) to reach a new position
753 //! UIndex1, UIndex2, VIndex1, VIndex2:
754 //! indicates the poles which can be moved
755 //! if Problem in BSplineBasis calculation, no change
756 //! for the curve and
757 //! UFirstIndex, VLastIndex = 0
758 //! VFirstIndex, VLastIndex = 0
760 //! Raised if UIndex1 < UIndex2 or VIndex1 < VIndex2 or
761 //! UIndex1 < 1 || UIndex1 > NbUPoles or
762 //! UIndex2 < 1 || UIndex2 > NbUPoles
763 //! VIndex1 < 1 || VIndex1 > NbVPoles or
764 //! VIndex2 < 1 || VIndex2 > NbVPoles
765 //! characteristics of the surface
766 Standard_EXPORT void MovePoint (const Standard_Real U, const Standard_Real V, const gp_Pnt& P, const Standard_Integer UIndex1, const Standard_Integer UIndex2, const Standard_Integer VIndex1, const Standard_Integer VIndex2, Standard_Integer& UFirstIndex, Standard_Integer& ULastIndex, Standard_Integer& VFirstIndex, Standard_Integer& VLastIndex);
769 //! Returns true if the first control points row and the last
770 //! control points row are identical. The tolerance criterion
771 //! is Resolution from package gp.
772 Standard_EXPORT Standard_Boolean IsUClosed() const Standard_OVERRIDE;
775 //! Returns true if the first control points column and the
776 //! last last control points column are identical.
777 //! The tolerance criterion is Resolution from package gp.
778 Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
781 //! Returns True if the order of continuity of the surface in the
782 //! U direction is N.
784 Standard_EXPORT Standard_Boolean IsCNu (const Standard_Integer N) const Standard_OVERRIDE;
787 //! Returns True if the order of continuity of the surface
788 //! in the V direction is N.
790 Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE;
793 //! Returns True if the surface is closed in the U direction
794 //! and if the B-spline has been turned into a periodic surface
795 //! using the function SetUPeriodic.
796 Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
799 //! Returns False if for each row of weights all the weights
801 //! The tolerance criterion is resolution from package gp.
804 //! if Weights = |0.5, 0.5, 0.5| returns False
806 Standard_EXPORT Standard_Boolean IsURational() const;
809 //! Returns True if the surface is closed in the V direction
810 //! and if the B-spline has been turned into a periodic
811 //! surface using the function SetVPeriodic.
812 Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
815 //! Returns False if for each column of weights all the weights
817 //! The tolerance criterion is resolution from package gp.
820 //! if Weights = |1.0, 2.0, 0.5| returns False
822 Standard_EXPORT Standard_Boolean IsVRational() const;
825 //! Returns the parametric bounds of the surface.
827 //! These parametric values are the bounds of the array of
828 //! knots UKnots and VKnots only if the first knots and the
829 //! last knots have a multiplicity equal to UDegree + 1 or
831 Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const Standard_OVERRIDE;
834 //! Returns the continuity of the surface :
835 //! C0 : only geometric continuity,
836 //! C1 : continuity of the first derivative all along the Surface,
837 //! C2 : continuity of the second derivative all along the Surface,
838 //! C3 : continuity of the third derivative all along the Surface,
839 //! CN : the order of continuity is infinite.
840 //! A B-spline surface is infinitely continuously differentiable
841 //! for the couple of parameters U, V such thats U != UKnots(i)
842 //! and V != VKnots(i). The continuity of the surface at a knot
843 //! value depends on the multiplicity of this knot.
845 //! If the surface is C1 in the V direction and C2 in the U
846 //! direction this function returns Shape = C1.
847 Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
850 //! Computes the Index of the UKnots which gives the first
851 //! parametric value of the surface in the U direction.
852 //! The UIso curve corresponding to this value is a
853 //! boundary curve of the surface.
854 Standard_EXPORT Standard_Integer FirstUKnotIndex() const;
857 //! Computes the Index of the VKnots which gives the
858 //! first parametric value of the surface in the V direction.
859 //! The VIso curve corresponding to this knot is a boundary
860 //! curve of the surface.
861 Standard_EXPORT Standard_Integer FirstVKnotIndex() const;
864 //! Computes the Index of the UKnots which gives the
865 //! last parametric value of the surface in the U direction.
866 //! The UIso curve corresponding to this knot is a boundary
867 //! curve of the surface.
868 Standard_EXPORT Standard_Integer LastUKnotIndex() const;
871 //! Computes the Index of the VKnots which gives the
872 //! last parametric value of the surface in the V direction.
873 //! The VIso curve corresponding to this knot is a
874 //! boundary curve of the surface.
875 Standard_EXPORT Standard_Integer LastVKnotIndex() const;
877 //! Returns the number of knots in the U direction.
878 Standard_EXPORT Standard_Integer NbUKnots() const;
880 //! Returns number of poles in the U direction.
881 Standard_EXPORT Standard_Integer NbUPoles() const;
883 //! Returns the number of knots in the V direction.
884 Standard_EXPORT Standard_Integer NbVKnots() const;
886 //! Returns the number of poles in the V direction.
887 Standard_EXPORT Standard_Integer NbVPoles() const;
890 //! Returns the pole of range (UIndex, VIndex).
892 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1 or
893 //! VIndex > NbVPoles.
894 Standard_EXPORT gp_Pnt Pole (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
896 //! Returns the poles of the B-spline surface.
898 //! Raised if the length of P in the U and V direction
899 //! is not equal to NbUpoles and NbVPoles.
900 Standard_EXPORT void Poles (TColgp_Array2OfPnt& P) const;
902 //! Returns the poles of the B-spline surface.
903 Standard_EXPORT const TColgp_Array2OfPnt& Poles() const;
906 //! Returns the degree of the normalized B-splines Ni,n in the U
908 Standard_EXPORT Standard_Integer UDegree() const;
911 //! Returns the Knot value of range UIndex.
912 //! Raised if UIndex < 1 or UIndex > NbUKnots
913 Standard_EXPORT Standard_Real UKnot (const Standard_Integer UIndex) const;
916 //! Returns NonUniform or Uniform or QuasiUniform or
917 //! PiecewiseBezier. If all the knots differ by a
918 //! positive constant from the preceding knot in the U
919 //! direction the B-spline surface can be :
920 //! - Uniform if all the knots are of multiplicity 1,
921 //! - QuasiUniform if all the knots are of multiplicity 1
922 //! except for the first and last knot which are of
923 //! multiplicity Degree + 1,
924 //! - PiecewiseBezier if the first and last knots have
925 //! multiplicity Degree + 1 and if interior knots have
926 //! multiplicity Degree
927 //! otherwise the surface is non uniform in the U direction
928 //! The tolerance criterion is Resolution from package gp.
929 Standard_EXPORT GeomAbs_BSplKnotDistribution UKnotDistribution() const;
931 //! Returns the knots in the U direction.
933 //! Raised if the length of Ku is not equal to the number of knots
934 //! in the U direction.
935 Standard_EXPORT void UKnots (TColStd_Array1OfReal& Ku) const;
937 //! Returns the knots in the U direction.
938 Standard_EXPORT const TColStd_Array1OfReal& UKnots() const;
940 //! Returns the uknots sequence.
941 //! In this sequence the knots with a multiplicity greater than 1
944 //! Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
946 //! Raised if the length of Ku is not equal to NbUPoles + UDegree + 1
947 Standard_EXPORT void UKnotSequence (TColStd_Array1OfReal& Ku) const;
949 //! Returns the uknots sequence.
950 //! In this sequence the knots with a multiplicity greater than 1
953 //! Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
954 Standard_EXPORT const TColStd_Array1OfReal& UKnotSequence() const;
957 //! Returns the multiplicity value of knot of range UIndex in
959 //! Raised if UIndex < 1 or UIndex > NbUKnots.
960 Standard_EXPORT Standard_Integer UMultiplicity (const Standard_Integer UIndex) const;
963 //! Returns the multiplicities of the knots in the U direction.
965 //! Raised if the length of Mu is not equal to the number of
966 //! knots in the U direction.
967 Standard_EXPORT void UMultiplicities (TColStd_Array1OfInteger& Mu) const;
969 //! Returns the multiplicities of the knots in the U direction.
970 Standard_EXPORT const TColStd_Array1OfInteger& UMultiplicities() const;
973 //! Returns the degree of the normalized B-splines Ni,d in the
975 Standard_EXPORT Standard_Integer VDegree() const;
977 //! Returns the Knot value of range VIndex.
978 Standard_EXPORT Standard_Real VKnot (const Standard_Integer VIndex) const;
981 //! Returns NonUniform or Uniform or QuasiUniform or
982 //! PiecewiseBezier. If all the knots differ by a positive
983 //! constant from the preceding knot in the V direction the
984 //! B-spline surface can be :
985 //! - Uniform if all the knots are of multiplicity 1,
986 //! - QuasiUniform if all the knots are of multiplicity 1
987 //! except for the first and last knot which are of
988 //! multiplicity Degree + 1,
989 //! - PiecewiseBezier if the first and last knots have
990 //! multiplicity Degree + 1 and if interior knots have
991 //! multiplicity Degree
992 //! otherwise the surface is non uniform in the V direction.
993 //! The tolerance criterion is Resolution from package gp.
994 Standard_EXPORT GeomAbs_BSplKnotDistribution VKnotDistribution() const;
996 //! Returns the knots in the V direction.
998 //! Raised if the length of Kv is not equal to the number of
999 //! knots in the V direction.
1000 Standard_EXPORT void VKnots (TColStd_Array1OfReal& Kv) const;
1002 //! Returns the knots in the V direction.
1003 Standard_EXPORT const TColStd_Array1OfReal& VKnots() const;
1005 //! Returns the vknots sequence.
1006 //! In this sequence the knots with a multiplicity greater than 1
1009 //! Kv = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
1011 //! Raised if the length of Kv is not equal to NbVPoles + VDegree + 1
1012 Standard_EXPORT void VKnotSequence (TColStd_Array1OfReal& Kv) const;
1014 //! Returns the vknots sequence.
1015 //! In this sequence the knots with a multiplicity greater than 1
1018 //! Ku = {k1, k1, k1, k2, k3, k3, k4, k4, k4}
1019 Standard_EXPORT const TColStd_Array1OfReal& VKnotSequence() const;
1022 //! Returns the multiplicity value of knot of range VIndex in
1023 //! the v direction.
1024 //! Raised if VIndex < 1 or VIndex > NbVKnots
1025 Standard_EXPORT Standard_Integer VMultiplicity (const Standard_Integer VIndex) const;
1028 //! Returns the multiplicities of the knots in the V direction.
1030 //! Raised if the length of Mv is not equal to the number of
1031 //! knots in the V direction.
1032 Standard_EXPORT void VMultiplicities (TColStd_Array1OfInteger& Mv) const;
1034 //! Returns the multiplicities of the knots in the V direction.
1035 Standard_EXPORT const TColStd_Array1OfInteger& VMultiplicities() const;
1037 //! Returns the weight value of range UIndex, VIndex.
1039 //! Raised if UIndex < 1 or UIndex > NbUPoles or VIndex < 1
1040 //! or VIndex > NbVPoles.
1041 Standard_EXPORT Standard_Real Weight (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
1043 //! Returns the weights of the B-spline surface.
1045 //! Raised if the length of W in the U and V direction is
1046 //! not equal to NbUPoles and NbVPoles.
1047 Standard_EXPORT void Weights (TColStd_Array2OfReal& W) const;
1049 //! Returns the weights of the B-spline surface.
1050 //! value and derivatives computation
1051 Standard_EXPORT const TColStd_Array2OfReal* Weights() const;
1053 Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const Standard_OVERRIDE;
1055 //! Raised if the continuity of the surface is not C1.
1056 Standard_EXPORT void D1 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const Standard_OVERRIDE;
1058 //! Raised if the continuity of the surface is not C2.
1059 Standard_EXPORT void D2 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const Standard_OVERRIDE;
1061 //! Raised if the continuity of the surface is not C3.
1062 Standard_EXPORT void D3 (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const Standard_OVERRIDE;
1065 //! Nu is the order of derivation in the U parametric direction and
1066 //! Nv is the order of derivation in the V parametric direction.
1068 //! Raised if the continuity of the surface is not CNu in the U
1069 //! direction and CNv in the V direction.
1071 //! Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
1073 //! The following functions computes the point for the
1074 //! parametric values (U, V) and the derivatives at
1075 //! this point on the B-spline surface patch delimited
1076 //! with the knots FromUK1, FromVK1 and the knots ToUK2,
1077 //! ToVK2. (U, V) can be out of these parametric bounds
1078 //! but for the computation we only use the definition
1079 //! of the surface between these knots. This method is
1080 //! useful to compute local derivative, if the order of
1081 //! continuity of the whole surface is not greater enough.
1082 //! Inside the parametric knot's domain previously defined
1083 //! the evaluations are the same as if we consider the whole
1084 //! definition of the surface. Of course the evaluations are
1085 //! different outside this parametric domain.
1086 Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const Standard_OVERRIDE;
1088 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1090 //! Raised if FromUK1, ToUK2 are not in the range [FirstUKnotIndex,
1091 //! LastUKnotIndex] or if FromVK1, ToVK2 are not in the range
1092 //! [FirstVKnotIndex, LastVKnotIndex]
1093 Standard_EXPORT void LocalD0 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P) const;
1096 //! Raised if the local continuity of the surface is not C1
1097 //! between the knots FromUK1, ToUK2 and FromVK1, ToVK2.
1098 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1100 //! Raised if FromUK1, ToUK2 are not in the range [FirstUKnotIndex,
1101 //! LastUKnotIndex] or if FromVK1, ToVK2 are not in the range
1102 //! [FirstVKnotIndex, LastVKnotIndex]
1103 Standard_EXPORT void LocalD1 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const;
1106 //! Raised if the local continuity of the surface is not C2
1107 //! between the knots FromUK1, ToUK2 and FromVK1, ToVK2.
1108 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1110 //! Raised if FromUK1, ToUK2 are not in the range [FirstUKnotIndex,
1111 //! LastUKnotIndex] or if FromVK1, ToVK2 are not in the range
1112 //! [FirstVKnotIndex, LastVKnotIndex]
1113 Standard_EXPORT void LocalD2 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const;
1116 //! Raised if the local continuity of the surface is not C3
1117 //! between the knots FromUK1, ToUK2 and FromVK1, ToVK2.
1118 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1120 //! Raised if FromUK1, ToUK2 are not in the range [FirstUKnotIndex,
1121 //! LastUKnotIndex] or if FromVK1, ToVK2 are not in the range
1122 //! [FirstVKnotIndex, LastVKnotIndex]
1123 Standard_EXPORT void LocalD3 (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const;
1126 //! Raised if the local continuity of the surface is not CNu
1127 //! between the knots FromUK1, ToUK2 and CNv between the knots
1129 //! Raised if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1131 //! Raised if FromUK1, ToUK2 are not in the range [FirstUKnotIndex,
1132 //! LastUKnotIndex] or if FromVK1, ToVK2 are not in the range
1133 //! [FirstVKnotIndex, LastVKnotIndex]
1134 Standard_EXPORT gp_Vec LocalDN (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, const Standard_Integer Nu, const Standard_Integer Nv) const;
1137 //! Computes the point of parameter U, V on the BSpline surface patch
1138 //! defines between the knots UK1 UK2, VK1, VK2. U can be out of the
1139 //! bounds [Knot UK1, Knot UK2] and V can be outof the bounds
1140 //! [Knot VK1, Knot VK2] but for the computation we only use the
1141 //! definition of the surface between these knot values.
1142 //! Raises if FromUK1 = ToUK2 or FromVK1 = ToVK2.
1144 //! Raises if FromUK1, ToUK2 are not in the range [FirstUKnotIndex,
1145 //! LastUKnotIndex] or if FromVK1, ToVK2 are not in the range
1146 //! [FirstVKnotIndex, LastVKnotIndex]
1147 Standard_EXPORT gp_Pnt LocalValue (const Standard_Real U, const Standard_Real V, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2) const;
1150 //! Computes the U isoparametric curve.
1151 //! A B-spline curve is returned.
1152 Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE;
1155 //! Computes the V isoparametric curve.
1156 //! A B-spline curve is returned.
1157 Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V) const Standard_OVERRIDE;
1160 //! Computes the U isoparametric curve.
1161 //! If CheckRational=False, no try to make it non-rational.
1162 //! A B-spline curve is returned.
1163 Standard_EXPORT Handle(Geom_Curve) UIso (const Standard_Real U, const Standard_Boolean CheckRational) const;
1166 //! Computes the V isoparametric curve.
1167 //! If CheckRational=False, no try to make it non-rational.
1168 //! A B-spline curve is returned.
1170 Standard_EXPORT Handle(Geom_Curve) VIso (const Standard_Real V, const Standard_Boolean CheckRational) const;
1172 //! Applies the transformation T to this BSpline surface.
1173 Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
1176 //! Returns the value of the maximum degree of the normalized
1177 //! B-spline basis functions in the u and v directions.
1178 Standard_EXPORT static Standard_Integer MaxDegree();
1180 //! Computes two tolerance values for this BSpline
1181 //! surface, based on the given tolerance in 3D space
1182 //! Tolerance3D. The tolerances computed are:
1183 //! - UTolerance in the u parametric direction, and
1184 //! - VTolerance in the v parametric direction.
1185 //! If f(u,v) is the equation of this BSpline surface,
1186 //! UTolerance and VTolerance guarantee that :
1187 //! | u1 - u0 | < UTolerance and
1188 //! | v1 - v0 | < VTolerance
1189 //! ====> |f (u1,v1) - f (u0,v0)| < Tolerance3D
1190 Standard_EXPORT void Resolution (const Standard_Real Tolerance3D, Standard_Real& UTolerance, Standard_Real& VTolerance);
1192 //! Creates a new object which is a copy of this BSpline surface.
1193 Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
1198 DEFINE_STANDARD_RTTI(Geom_BSplineSurface,Geom_BoundedSurface)
1208 //! Recompute the flatknots, the knotsdistribution, the
1209 //! continuity for U.
1210 Standard_EXPORT void UpdateUKnots();
1212 //! Recompute the flatknots, the knotsdistribution, the
1213 //! continuity for V.
1214 Standard_EXPORT void UpdateVKnots();
1216 Standard_Boolean urational;
1217 Standard_Boolean vrational;
1218 Standard_Boolean uperiodic;
1219 Standard_Boolean vperiodic;
1220 GeomAbs_BSplKnotDistribution uknotSet;
1221 GeomAbs_BSplKnotDistribution vknotSet;
1222 GeomAbs_Shape Usmooth;
1223 GeomAbs_Shape Vsmooth;
1224 Standard_Integer udeg;
1225 Standard_Integer vdeg;
1226 Handle(TColgp_HArray2OfPnt) poles;
1227 Handle(TColStd_HArray2OfReal) weights;
1228 Handle(TColStd_HArray1OfReal) ufknots;
1229 Handle(TColStd_HArray1OfReal) vfknots;
1230 Handle(TColStd_HArray1OfReal) uknots;
1231 Handle(TColStd_HArray1OfReal) vknots;
1232 Handle(TColStd_HArray1OfInteger) umults;
1233 Handle(TColStd_HArray1OfInteger) vmults;
1234 Standard_Real umaxderivinv;
1235 Standard_Real vmaxderivinv;
1236 Standard_Boolean maxderivinvok;
1247 #endif // _Geom_BSplineSurface_HeaderFile