0024784: Move documentation in CDL files to proper location
[occt.git] / src / CSLib / CSLib.cdl
CommitLineData
b311480e 1-- Created on: 1991-09-09
2-- Created by: Michel Chauvat
3-- Copyright (c) 1991-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
b311480e 16
7fd59977 17-- JCV Decembre 1991
7fd59977 18
19
20
21
22package CSLib
23
24 ---Purpose: This package implements functions for basis geometric
25 -- computation on curves and surfaces.
26 -- The tolerance criterions used in this package are
27 -- Resolution from package gp and RealEpsilon from class
28 -- Real of package Standard.
29
30uses gp,
31 TColgp,
32 TColStd,
33 math
34
35
36is
37
38 enumeration DerivativeStatus is
39 Done, D1uIsNull, D1vIsNull, D1IsNull, D1uD1vRatioIsNull,
40 D1vD1uRatioIsNull, D1uIsParallelD1v;
41
42 --- Purpose :
43 --
44 -- D1uIsNull : ||D1U|| <= Resolution
45 --
46 -- D1vIsNull : ||D1V|| <= Resolution
47 --
48 -- D1IsNull : the first derivatives in the U and V parametric
49 -- directions have null length :
50 -- ||D1U|| <= Resolution and ||D1V|| <= Resolution
51 --
52 -- D1uD1vRatioIsNull : the first derivative in the U direction has
53 -- null length by comparison with the derivative
54 -- in the V direction
55 -- ||D1U|| / ||D1V|| <= RealEpsilon
56 --
57 -- D1vD1uRatioIsNull : the first derivative in the V direction has
58 -- null length by comparison with the derivative
59 -- in the U direction
60 -- ||D1V|| / ||D1U|| <= RealEpsilon
61 --
62 -- D1uIsParallelD1v : the angle between the derivatives in the U and
63 -- V direction is null (tolerance criterion given
64 -- as input data)
65
66
67 enumeration NormalStatus is
68 Singular,Defined,InfinityOfSolutions, D1NuIsNull, D1NvIsNull, D1NIsNull,
69 D1NuNvRatioIsNull, D1NvNuRatioIsNull, D1NuIsParallelD1Nv;
70
71 --- Purpose :
72 --
73 -- if N is the normal
74 --
75 -- InfinityOfSolutions : ||DN/du||>Resolution, ||DN/dv||>Resolution
76 --
77 -- D1NuIsNull : ||DN/du|| <= Resolution
78 --
79 -- D1NvIsNull : ||DN/dv|| <= Resolution
80 --
81 -- D1NIsNull : ||DN/du||<=Resolution, ||DN/dv||<=Resolution
82 --
83 -- D1NuNvRatioIsNull : ||D1Nu|| / ||D1Nv|| <= RealEpsilon
84 --
85 -- D1NvNuRatioIsNull : ||D1Nu|| / ||D1Nv|| <= RealEpsilon
86 --
87 -- D1NuIsParallelD1Nv : The angle between D1Nu and D1Nv is Null.
88
ff8178ef 89 class Class2d;
7fd59977 90
7fd59977 91 private class NormalPolyDef;
92 --- Purpose :
93 -- The following functions computes the normal to a surface
94 -- inherits FunctionWithDerivative from math
95 --
96 Normal (D1U, D1V: Vec from gp; SinTol: Real;
97 Status: out DerivativeStatus;
98 Normal: out Dir from gp);
99
100 --- Purpose :
101 -- Computes the normal direction of a surface as the cross product
102 -- between D1U and D1V.
103 -- If D1U has null length or D1V has null length or D1U and D1V are
104 -- parallel the normal is undefined.
105 -- To check that D1U and D1V are colinear the sinus of the angle
106 -- between D1U and D1V is computed and compared with SinTol.
107 -- The normal is computed if Status == Done else the Status gives the
108 -- reason why the computation has failed.
109
110
111
112 Normal (D1U, D1V, D2U, D2V, D2UV: Vec from gp; SinTol: Real;
113 Done : out Boolean; Status : out NormalStatus;
114 Normal: out Dir from gp);
115 --- Purpose :
116 -- If there is a singularity on the surface the previous method
117 -- cannot compute the local normal.
118 -- This method computes an approched normal direction of a surface.
119 -- It does a limited development and needs the second derivatives
120 -- on the surface as input data.
121 -- It computes the normal as follow :
122 -- N(u, v) = D1U ^ D1V
123 -- N(u0+du,v0+dv) = N0 + DN/du(u0,v0) * du + DN/dv(u0,v0) * dv + Eps
124 -- with Eps->0 so we can have the equivalence N ~ dN/du + dN/dv.
125 -- DNu = ||DN/du|| and DNv = ||DN/dv||
126 --
127 -- . if DNu IsNull (DNu <= Resolution from gp) the answer Done = True
128 -- the normal direction is given by DN/dv
129 -- . if DNv IsNull (DNv <= Resolution from gp) the answer Done = True
130 -- the normal direction is given by DN/du
131 -- . if the two directions DN/du and DN/dv are parallel Done = True
132 -- the normal direction is given either by DN/du or DN/dv.
133 -- To check that the two directions are colinear the sinus of the
134 -- angle between these directions is computed and compared with
135 -- SinTol.
136 -- . if DNu/DNv or DNv/DNu is lower or equal than Real Epsilon
137 -- Done = False, the normal is undefined
138 -- . if DNu IsNull and DNv is Null Done = False, there is an
139 -- indetermination and we should do a limited developpement at
140 -- order 2 (it means that we cannot omit Eps).
141 -- . if DNu Is not Null and DNv Is not Null Done = False, there are
142 -- an infinity of normals at the considered point on the surface.
143
144 Normal (D1U, D1V: Vec from gp; MagTol: Real;
145 Status: out NormalStatus;
146 Normal: out Dir from gp);
147
148 --- Purpose :
149 -- Computes the normal direction of a surface as the cross product
150 -- between D1U and D1V.
151 --
152 Normal (MaxOrder : Integer ; DerNUV : Array2OfVec from TColgp; MagTol: Real;
153 U , V , Umin , Umax , Vmin , Vmax : Real; Status: out NormalStatus;
154 Normal : out Dir from gp; OrderU , OrderV : out Integer);
155 --- Purpose : find the first order k0 of deriviative of NUV
156 -- where: foreach order < k0 all the derivatives of NUV are
157 -- null all the derivatives of NUV corresponding to the order
158 -- k0 are collinear and have the same sens.
159 -- In this case, normal at U,V is unique.
160
161 DNNUV ( Nu , Nv : Integer; DerSurf : Array2OfVec from TColgp )
162 returns Vec from gp;
163 ---Purpose : -- Computes the derivative of order Nu in the --
164 -- direction U and Nv in the direction V of the not --
165 -- normalized normal vector at the point P(U,V) The
166 -- array DerSurf contain the derivative (i,j) of the surface
167 -- for i=0,Nu+1 ; j=0,Nv+1
168
169
170 DNNUV (Nu,Nv : Integer ; DerSurf1 : Array2OfVec from TColgp;
171 DerSurf2 : Array2OfVec from TColgp )
172 returns Vec from gp;
173 ---Purpose : Computes the derivatives of order Nu in the direction Nu
174 -- and Nv in the direction Nv of the not normalized vector
175 -- N(u,v) = dS1/du * dS2/dv (cases where we use an osculating surface)
176 -- DerSurf1 are the derivatives of S1
177
178 DNNormal( Nu , Nv : Integer; DerNUV : Array2OfVec from TColgp ;
179 Iduref : Integer = 0; Idvref : Integer = 0 )
180 returns Vec from gp;
181 ---Purpose : -- Computes the derivative of order Nu in the --
182 -- direction U and Nv in the direction V of the
183 -- normalized normal vector at the point P(U,V) array
184 -- DerNUV contain the derivative (i+Iduref,j+Idvref)
185 -- of D1U ^ D1V for i=0,Nu ; j=0,Nv Iduref and Idvref
186 -- correspond to a derivative of D1U ^ D1V which can
187 -- be used to compute the normalized normal vector.
188 -- In the regular cases , Iduref=Idvref=0.
189
190end CSLib;
191
192
193
194
195