b311480e |
1 | -- Created on: 1991-10-04 |
2 | -- Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
3 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | -- |
973c2be1 |
5 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
6 | -- |
d5f74e42 |
7 | -- This library is free software; you can redistribute it and/or modify it under |
8 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | -- by the Free Software Foundation, with special exception defined in the file |
10 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | -- |
973c2be1 |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | class BSplineSurfaceKnotSplitting from GeomConvert |
17 | |
18 | --- Purpose : An algorithm to determine isoparametric curves along |
19 | -- which a BSpline surface should be split in order to |
ff8178ef |
20 | -- obtain patches of the same continuity. The continuity order is given at the |
21 | -- construction time. It is possible to compute the surface patches |
22 | -- corresponding to the splitting with the method of package |
23 | -- SplitBSplineSurface. |
7fd59977 |
24 | -- For a B-spline surface the discontinuities are localised at |
25 | -- the knot values. Between two knots values the B-spline is |
26 | -- infinitely continuously differentiable. For each parametric |
27 | -- direction at a knot of range index the continuity in this |
28 | -- direction is equal to : Degree - Mult (Index) where Degree |
29 | -- is the degree of the basis B-spline functions and Mult the |
30 | -- multiplicity of the knot of range Index in the given direction. |
31 | -- If for your computation you need to have B-spline surface with a |
32 | -- minima of continuity it can be interesting to know between which |
33 | -- knot values, a B-spline patch, has a continuity of given order. |
34 | -- This algorithm computes the indexes of the knots where you should |
35 | -- split the surface, to obtain patches with a constant continuity |
36 | -- given at the construction time. If you just want to compute the |
37 | -- local derivatives on the surface you don't need to create the |
38 | -- BSpline patches, you can use the functions LocalD1, LocalD2, |
39 | -- LocalD3, LocalDN of the class BSplineSurface from package Geom. |
40 | |
41 | |
42 | |
43 | |
44 | uses BSplineSurface from Geom, |
45 | Array1OfInteger from TColStd, |
46 | HArray1OfInteger from TColStd |
47 | |
48 | raises DimensionError from Standard, |
49 | RangeError from Standard |
50 | |
51 | is |
52 | |
53 | |
54 | Create (BasisSurface : BSplineSurface; |
55 | UContinuityRange, VContinuityRange : Integer) |
56 | returns BSplineSurfaceKnotSplitting; |
57 | --- Purpose : Determines the u- and v-isoparametric curves |
58 | -- along which the BSpline surface BasisSurface |
59 | -- should be split in order to obtain patches with a |
60 | -- degree of continuity equal to UContinuityRange in |
61 | -- the u parametric direction, and to |
62 | -- VContinuityRange in the v parametric direction. |
63 | -- These isoparametric curves are defined by |
64 | -- parameters, which are BasisSurface knot values in |
65 | -- the u or v parametric direction. They are identified |
66 | -- by indices in the BasisSurface knots table in the |
67 | -- corresponding parametric direction. |
68 | -- Use the available interrogation functions to access |
69 | -- computed values, followed by the global function |
70 | -- SplitBSplineSurface (provided by the package |
71 | -- GeomConvert) to split the surface. |
72 | -- Exceptions |
73 | -- Standard_RangeError if UContinuityRange or |
74 | -- VContinuityRange is less than zero. |
75 | |
76 | NbUSplits (me) returns Integer is static; |
77 | --- Purpose : Returns the number of u-isoparametric curves |
78 | -- along which the analysed BSpline surface should be |
79 | -- split in order to obtain patches with the continuity |
80 | -- required by this framework. |
81 | -- The parameters which define these curves are knot |
82 | -- values in the corresponding parametric direction. |
83 | -- Note that the four curves which bound the surface are |
84 | -- counted among these splitting curves. |
85 | |
86 | NbVSplits (me) returns Integer is static; |
87 | --- Purpose : Returns the number of v-isoparametric curves |
88 | -- along which the analysed BSpline surface should be |
89 | -- split in order to obtain patches with the continuity |
90 | -- required by this framework. |
91 | -- The parameters which define these curves are knot |
92 | -- values in the corresponding parametric direction. |
93 | -- Note that the four curves which bound the surface are |
94 | -- counted among these splitting curves. |
95 | |
96 | |
97 | Splitting (me; USplit, VSplit : in out Array1OfInteger) |
98 | --- Purpose: Loads the USplit and VSplit tables with the split |
99 | -- knots values computed in this framework. Each value |
100 | -- in these tables is an index in the knots table |
101 | -- corresponding to the u or v parametric direction of |
102 | -- the BSpline surface analysed by this algorithm. |
103 | -- The USplit and VSplit values are given in ascending |
104 | -- order and comprise the indices of the knots which |
105 | -- give the first and last isoparametric curves of the |
106 | -- surface in the corresponding parametric direction. |
107 | -- Use two consecutive values from the USplit table and |
108 | -- two consecutive values from the VSplit table as |
109 | -- arguments of the global function |
110 | -- SplitBSplineSurface (provided by the package |
111 | -- GeomConvert) to split the surface. |
112 | -- Exceptions |
113 | -- Standard_DimensionError if: |
114 | -- - the array USplit was not created with the following bounds: |
115 | -- - 1 , and |
116 | -- - the number of split knots in the u parametric |
117 | -- direction computed in this framework (as given |
118 | -- by the function NbUSplits); or |
119 | -- - the array VSplit was not created with the following bounds: |
120 | -- - 1 , and |
121 | -- - the number of split knots in the v parametric |
122 | -- direction computed in this framework (as given |
123 | -- by the function NbVSplits). |
124 | raises DimensionError |
125 | is static; |
126 | |
127 | |
128 | USplitValue (me; UIndex : Integer) returns Integer |
129 | --- Purpose : Returns the split knot of index UIndex |
130 | -- to the split knots table for the u parametric direction |
131 | -- computed in this framework. The returned value is |
132 | -- an index in the knots table relative to the u |
133 | -- parametric direction of the BSpline surface analysed by this algorithm. |
134 | -- Note: If UIndex is equal to 1, or to the number of split knots for the u |
135 | -- parametric direction computed in |
136 | -- this framework, the corresponding knot gives the |
137 | -- parameter of one of the bounding curves of the surface. |
138 | -- Exceptions |
139 | -- Standard_RangeError if UIndex is less than 1 or greater than the number |
140 | -- of split knots for the u parametric direction computed in this framework. |
141 | raises RangeError |
142 | is static; |
143 | |
144 | |
145 | VSplitValue (me; VIndex : Integer) returns Integer |
146 | --- Purpose : Returns the split knot of index VIndex |
147 | -- to the split knots table for the v parametric direction |
148 | -- computed in this framework. The returned value is |
149 | -- an index in the knots table relative to the v |
150 | -- parametric direction of the BSpline surface analysed by this algorithm. |
151 | -- Note: If UIndex is equal to 1, or to the number of split knots for the v |
152 | -- parametric direction computed in |
153 | -- this framework, the corresponding knot gives the |
154 | -- parameter of one of the bounding curves of the surface. |
155 | -- Exceptions |
156 | -- Standard_RangeError if VIndex is less than 1 or greater than the number |
157 | -- of split knots for the v parametric direction computed in this framework. |
158 | raises RangeError |
159 | is static; |
160 | |
161 | |
162 | |
163 | fields |
164 | |
165 | usplitIndexes : HArray1OfInteger; |
166 | vsplitIndexes : HArray1OfInteger; |
167 | |
168 | end BSplineSurfaceKnotSplitting; |