1 -- Created on: 1997-07-11
2 -- Created by: Philippe MANGIN
3 -- Copyright (c) 1997-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.
23 private class CircularBlendFunc from GeomFill
24 inherits SweepFunction from Approx
26 ---Purpose: Circular Blend Function to approximate by
27 -- SweepApproximation from Approx
30 HCurve from Adaptor3d,
31 BSplineCurve from Geom,
32 ParameterisationType from Convert,
34 Array1OfPnt from TColgp,
35 Array1OfVec from TColgp,
36 Array1OfPnt2d from TColgp,
37 Array1OfVec2d from TColgp,
38 Array1OfReal from TColStd,
39 Array1OfInteger from TColStd,
43 raises OutOfRange from Standard
47 Create( Path : HCurve from Adaptor3d;
48 Curve1 : HCurve from Adaptor3d;
49 Curve2 : HCurve from Adaptor3d;
50 Radius : Real from Standard;
51 Polynomial : Boolean = Standard_False)
52 ---Purpose: Create a Blend with a constant radius with 2
53 -- guide-line. <FShape> sets the type of fillet
54 -- surface. The -- default value is Convert_TgtThetaOver2 (classical --
55 -- nurbs -- representation of circles).
56 -- ChFi3d_QuasiAngular -- corresponds to a nurbs
57 -- representation of circles -- which
58 -- parameterisation matches the circle one. --
59 -- ChFi3d_Polynomial corresponds to a polynomial --
60 -- representation of circles.
61 returns CircularBlendFunc from GeomFill;
63 -- To compute Sections and derivatives Sections
70 Poles : out Array1OfPnt from TColgp;
71 Poles2d : out Array1OfPnt2d from TColgp;
72 Weigths : out Array1OfReal from TColStd)
73 ---Purpose: compute the section for v = param
74 returns Boolean is redefined;
79 Poles : out Array1OfPnt from TColgp;
80 DPoles : out Array1OfVec from TColgp;
81 Poles2d : out Array1OfPnt2d from TColgp;
82 DPoles2d : out Array1OfVec2d from TColgp;
83 Weigths : out Array1OfReal from TColStd;
84 DWeigths : out Array1OfReal from TColStd)
85 ---Purpose: compute the first derivative in v direction of the
86 -- section for v = param
93 Poles : out Array1OfPnt from TColgp;
94 DPoles : out Array1OfVec from TColgp;
95 D2Poles : out Array1OfVec from TColgp;
96 Poles2d : out Array1OfPnt2d from TColgp;
97 DPoles2d : out Array1OfVec2d from TColgp;
98 D2Poles2d : out Array1OfVec2d from TColgp;
99 Weigths : out Array1OfReal from TColStd;
100 DWeigths : out Array1OfReal from TColStd;
101 D2Weigths : out Array1OfReal from TColStd)
102 ---Purpose: compute the second derivative in v direction of the
103 -- section for v = param
108 -- General Information On The Function
112 ---Purpose: get the number of 2d curves to approximate.
113 returns Integer is redefined;
115 SectionShape(me; NbPoles : out Integer from Standard;
116 NbKnots : out Integer from Standard;
117 Degree : out Integer from Standard)
118 ---Purpose: get the format of an section
121 Knots(me; TKnots: out Array1OfReal from TColStd)
122 ---Purpose: get the Knots of the section
126 Mults(me; TMults: out Array1OfInteger from TColStd)
127 ---Purpose: get the Multplicities of the section
132 ---Purpose: Returns if the section is rationnal or not
133 returns Boolean is redefined;
138 -- Mangement of continuity
141 NbIntervals(me; S : Shape from GeomAbs)
142 ---Purpose: Returns the number of intervals for continuity
143 -- <S>. May be one if Continuity(me) >= <S>
144 returns Integer is redefined;
146 Intervals(me; T : in out Array1OfReal from TColStd;
147 S : Shape from GeomAbs)
148 ---Purpose: Stores in <T> the parameters bounding the intervals
149 -- of continuity <S>.
151 -- The array must provide enough room to accomodate
152 -- for the parameters. i.e. T.Length() > NbIntervals()
154 OutOfRange from Standard
158 SetInterval(me: mutable; First, Last: Real from Standard)
159 ---Purpose: Sets the bounds of the parametric interval on
161 -- This determines the derivatives in these values if the
162 -- function is not Cn.
167 -- To help computation of Tolerance
169 -- Evaluation of error, in 2d space, or on rational function, is
170 -- dificult. The folowing methodes can help
176 BoundTol, SurfTol, AngleTol : Real;
177 Tol3d : out Array1OfReal)
178 ---Purpose: Returns the tolerance to reach in approximation
180 -- BoundTol error at the Boundary
181 -- AngleTol tangent error at the Boundary (in radian)
182 -- SurfTol error inside the surface.
185 SetTolerance(me : mutable; Tol3d, Tol2d : Real)
186 ---Purpose: Is usfull, if (me) have to be run numerical
187 -- algorithme to perform D0, D1 or D2
191 ---Purpose: Get the barycentre of Surface. An very poor
192 -- estimation is sufficent. This information is usefull
193 -- to perform well conditionned rational approximation.
195 -- Warning: Used only if <me> IsRational
200 MaximalSection(me) returns Real
201 ---Purpose: Returns the length of the maximum section. This
202 -- information is usefull to perform well conditionned rational
205 -- Warning: Used only if <me> IsRational
208 GetMinimalWeight(me; Weigths : out Array1OfReal from TColStd)
209 ---Purpose: Compute the minimal value of weight for each poles
210 -- of all sections. This information is usefull to
211 -- perform well conditionned rational approximation.
213 -- Warning: Used only if <me> IsRational
221 myBary : Pnt from gp;
228 myPath : HCurve from Adaptor3d;
229 myCurve1 : HCurve from Adaptor3d;
230 myCurve2 : HCurve from Adaptor3d;
231 myTPath : HCurve from Adaptor3d;
232 myTCurve1 : HCurve from Adaptor3d;
233 myTCurve2 : HCurve from Adaptor3d;
239 myTConv : ParameterisationType from Convert;
243 end CircularBlendFunc;