1 -- Created on: 1993-02-22
2 -- Created by: Remi LEQUETTE
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 class Surface from BRepAdaptor inherits Surface from Adaptor3d
19 ---Purpose: The Surface from BRepAdaptor allows to use a Face
20 -- of the BRep topology look like a 3D surface.
22 -- It has the methods of the class Surface from
25 -- It is created or initialized with a Face. It takes
26 -- into account the local coordinates system.
28 -- The u,v parameter range is the minmax value for
29 -- the restriction, unless the flag restriction is
34 SurfaceType from GeomAbs,
35 HSurface from Adaptor3d,
36 HCurve from Adaptor3d,
37 Surface from GeomAdaptor,
39 BezierSurface from Geom,
40 BSplineSurface from Geom,
51 Array1OfReal from TColStd
56 OutOfRange from Standard,
57 DomainError from Standard,
58 NoSuchObject from Standard
62 Create returns Surface from BRepAdaptor;
63 ---Purpose: Creates an undefined surface with no face loaded.
65 Create(F : Face from TopoDS;
66 R : Boolean = Standard_True)
67 returns Surface from BRepAdaptor;
68 ---Purpose: Creates a surface to access the geometry of <F>.
69 -- If <Restriction> is true the parameter range is
70 -- the parameter range in the UV space of the
73 Initialize(me : in out; F : Face from TopoDS;
74 Restriction : Boolean = Standard_True)
75 ---Purpose: Sets the surface to the geometry of <F>.
78 Surface(me) returns Surface from GeomAdaptor
79 ---Purpose: Returns the surface.
81 ---C++: return const &
84 ChangeSurface(me : in out) returns Surface from GeomAdaptor
85 ---Purpose: Returns the surface.
90 Trsf(me) returns Trsf from gp
91 ---Purpose: Returns the surface coordinate system.
93 ---C++: return const &
96 Face(me) returns Face from TopoDS
97 ---Purpose: Returns the face.
99 ---C++: return const &
102 Tolerance(me) returns Real
103 ---Purpose: Returns the face tolerance.
108 -- Methods of Surface from GeomAdaptor
111 FirstUParameter(me) returns Real
115 LastUParameter(me) returns Real
119 FirstVParameter(me) returns Real
123 LastVParameter(me) returns Real
127 UContinuity(me) returns Shape from GeomAbs
131 VContinuity(me) returns Shape from GeomAbs
135 NbUIntervals(me; S : Shape from GeomAbs) returns Integer
136 ---Purpose: If necessary, breaks the surface in U intervals of
137 -- continuity <S>. And returns the number of
142 NbVIntervals(me; S : Shape from GeomAbs) returns Integer
143 ---Purpose: If necessary, breaks the surface in V intervals of
144 -- continuity <S>. And returns the number of
149 UIntervals(me; T : in out Array1OfReal from TColStd;
150 S : Shape from GeomAbs )
151 ---Purpose: Returns the intervals with the requested continuity
152 -- in the U direction.
154 OutOfRange from Standard -- if the Length of the array does
155 -- have enought slots to accomodate
159 VIntervals(me; T : in out Array1OfReal from TColStd;
160 S : Shape from GeomAbs )
161 ---Purpose: Returns the intervals with the requested continuity
162 -- in the V direction.
164 OutOfRange from Standard -- if the Length of the array does
165 -- have enought slots to accomodate
169 UTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
170 ---Purpose: Returns a surface trimmed in the U direction
171 -- equivalent of <me> between
172 -- parameters <First> and <Last>. <Tol> is used to
173 -- test for 3d points confusion.
175 OutOfRange from Standard
176 ---Purpose: If <First> >= <Last>
177 is redefined static ;
179 VTrim(me; First, Last, Tol : Real) returns HSurface from Adaptor3d
180 ---Purpose: Returns a surface trimmed in the V direction between
181 -- parameters <First> and <Last>. <Tol> is used to
182 -- test for 3d points confusion.
184 OutOfRange from Standard
185 ---Purpose: If <First> >= <Last>
186 is redefined static ;
188 IsUClosed(me) returns Boolean
192 IsVClosed(me) returns Boolean
196 IsUPeriodic(me) returns Boolean
200 UPeriod(me) returns Real
202 DomainError from Standard -- if the curve is not periodic
206 IsVPeriodic(me) returns Boolean
210 VPeriod(me) returns Real
213 DomainError from Standard -- if the curve is not periodic
216 Value (me; U, V : Real) returns Pnt from gp
217 --- Purpose : Computes the point of parameters U,V on the surface.
220 D0 (me; U, V : Real; P : out Pnt from gp)
221 --- Purpose : Computes the point of parameters U,V on the surface.
226 D1U, D1V : out Vec from gp)
227 --- Purpose : Computes the point and the first derivatives on
230 DomainError from Standard
231 --- Purpose : Raised if the continuity of the current
232 -- intervals is not C1.
237 D1U, D1V, D2U, D2V, D2UV : out Vec from gp)
238 --- Purpose : Computes the point, the first and second
239 -- derivatives on the surface.
241 DomainError from Standard
242 --- Purpose : Raised if the continuity of the current
243 -- intervals is not C2.
246 D3 (me; U, V : Real; P : out Pnt from gp;
247 D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV : out Vec from gp)
248 --- Purpose : Computes the point, the first, second and third
249 -- derivatives on the surface.
251 DomainError from Standard
252 --- Purpose : Raised if the continuity of the current
253 -- intervals is not C3.
256 DN (me; U, V : Real; Nu, Nv : Integer) returns Vec from gp
257 --- Purpose : Computes the derivative of order Nu in the direction
258 -- U and Nv in the direction V at the point P(U, V).
260 DomainError from Standard,
261 --- Purpose : Raised if the current U interval is not not CNu
262 -- and the current V interval is not CNv.
263 OutOfRange from Standard
264 --- Purpose : Raised if Nu + Nv < 1 or Nu < 0 or Nv < 0.
267 UResolution(me; R3d : Real ) returns Real
268 ---Purpose : Returns the parametric U resolution corresponding
269 -- to the real space resolution <R3d>.
274 VResolution(me; R3d : Real ) returns Real
275 ---Purpose : Returns the parametric V resolution corresponding
276 -- to the real space resolution <R3d>.
281 GetType(me) returns SurfaceType from GeomAbs
282 ---Purpose: Returns the type of the surface : Plane, Cylinder,
283 -- Cone, Sphere, Torus, BezierSurface,
284 -- BSplineSurface, SurfaceOfRevolution,
285 -- SurfaceOfExtrusion, OtherSurface
289 Plane(me) returns Pln from gp
290 raises NoSuchObject from Standard
294 Cylinder(me) returns Cylinder from gp
295 raises NoSuchObject from Standard
298 Cone(me) returns Cone from gp
299 raises NoSuchObject from Standard
302 Sphere(me) returns Sphere from gp
303 raises NoSuchObject from Standard
306 Torus(me) returns Torus from gp
307 raises NoSuchObject from Standard
311 UDegree(me) returns Integer
312 raises NoSuchObject from Standard
316 NbUPoles(me) returns Integer
317 raises NoSuchObject from Standard
321 VDegree(me) returns Integer
322 raises NoSuchObject from Standard
326 NbVPoles(me) returns Integer
327 raises NoSuchObject from Standard
332 NbUKnots(me) returns Integer
334 NoSuchObject from Standard
339 NbVKnots(me) returns Integer
341 NoSuchObject from Standard
346 IsURational(me) returns Boolean
348 NoSuchObject from Standard
352 IsVRational(me) returns Boolean
354 NoSuchObject from Standard
359 Bezier(me) returns BezierSurface from Geom
361 --Warning : this will make a copy of the
362 -- Bezier Surface since it applies
363 -- to it the myTsrf transformation
364 -- Be Carefull when using this method
367 NoSuchObject from Standard
370 BSpline(me) returns BSplineSurface from Geom
372 -- Warning : this will make a copy of the
373 -- BSpline Surface since it applies
374 -- to it the myTsrf transformation
375 -- Be Carefull when using this method
378 NoSuchObject from Standard
381 AxeOfRevolution(me) returns Ax1 from gp
383 NoSuchObject from Standard -- only for SurfaceOfRevolution
386 Direction(me) returns Dir from gp
388 NoSuchObject from Standard -- only for SurfaceOfExtrusion
391 BasisCurve(me) returns HCurve from Adaptor3d
393 NoSuchObject from Standard
394 ---Purpose: only for SurfaceOfExtrusion and SurfaceOfRevolution
395 -- Warning: this will make a copy of the underlying curve
396 -- since it applies to it the transformation
397 -- myTrsf. Be carefull when using this method.
400 BasisSurface(me) returns HSurface from Adaptor3d
402 NoSuchObject from Standard -- only for Offset Surface
405 OffsetValue(me) returns Real from Standard
407 NoSuchObject from Standard -- only for Offset Surface
412 mySurf : Surface from GeomAdaptor;
413 myTrsf : Trsf from gp;
414 myFace : Face from TopoDS;