1 -- Created on: 1993-07-12
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1993-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 class MakeFace from BRepLib inherits MakeShape from BRepLib
25 ---Purpose: Provides methods to build faces.
27 -- A face may be built :
31 -- - Elementary surface from gp.
33 -- - Surface from Geom.
35 -- * From a surface and U,V values.
39 -- - Find the surface automatically if possible.
41 -- * From a surface and a wire.
43 -- - A flag Inside is given, when this flag is True
44 -- the wire is oriented to bound a finite area on
47 -- * From a face and a wire.
49 -- - The new wire is a perforation.
60 FaceError from BRepLib
70 returns MakeFace from BRepLib;
72 Create(F : Face from TopoDS)
73 ---Purpose: Load a face. Usefull to add wires.
75 returns MakeFace from BRepLib;
77 ----------------------------------------------
79 ----------------------------------------------
81 Create(P : Pln from gp)
82 ---Purpose: Make a face from a plane.
84 returns MakeFace from BRepLib;
86 Create(C : Cylinder from gp)
87 ---Purpose: Make a face from a cylinder.
89 returns MakeFace from BRepLib;
91 Create(C : Cone from gp)
92 ---Purpose: Make a face from a cone.
94 returns MakeFace from BRepLib;
96 Create(S : Sphere from gp)
97 ---Purpose: Make a face from a sphere.
99 returns MakeFace from BRepLib;
101 Create(C : Torus from gp)
102 ---Purpose: Make a face from a torus.
104 returns MakeFace from BRepLib;
106 Create(S : Surface from Geom; TolDegen : Real)
107 ---Purpose: Make a face from a Surface. Accepts tolerance value (TolDegen)
108 -- for resolution of degenerated edges.
110 returns MakeFace from BRepLib;
112 ----------------------------------------------
113 -- From a surface and U,V values
114 ----------------------------------------------
116 Create(P : Pln from gp; UMin, UMax, VMin, VMax : Real)
117 ---Purpose: Make a face from a plane.
119 returns MakeFace from BRepLib;
121 Create(C : Cylinder from gp; UMin, UMax, VMin, VMax : Real)
122 ---Purpose: Make a face from a cylinder.
124 returns MakeFace from BRepLib;
126 Create(C : Cone from gp; UMin, UMax, VMin, VMax : Real)
127 ---Purpose: Make a face from a cone.
129 returns MakeFace from BRepLib;
131 Create(S : Sphere from gp; UMin, UMax, VMin, VMax : Real)
132 ---Purpose: Make a face from a sphere.
134 returns MakeFace from BRepLib;
136 Create(C : Torus from gp; UMin, UMax, VMin, VMax : Real)
137 ---Purpose: Make a face from a torus.
139 returns MakeFace from BRepLib;
141 Create(S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : Real)
142 ---Purpose: Make a face from a Surface. Accepts min & max parameters
143 -- to construct the face's bounds. Also accepts tolerance value (TolDegen)
144 -- for resolution of degenerated edges.
146 returns MakeFace from BRepLib;
148 ----------------------------------------------
150 ----------------------------------------------
152 Create(W : Wire from TopoDS;
153 OnlyPlane : Boolean from Standard = Standard_False)
154 ---Purpose: Find a surface from the wire and make a face.
155 -- if <OnlyPlane> is true, the computed surface will be
156 -- a plane. If it is not possible to find a plane, the
157 -- flag NotDone will be set.
159 returns MakeFace from BRepLib;
161 ----------------------------------------------
162 -- From a surface and a wire
163 ----------------------------------------------
165 Create(P : Pln from gp; W : Wire from TopoDS;
166 Inside : Boolean = Standard_True)
167 ---Purpose: Make a face from a plane and a wire.
169 returns MakeFace from BRepLib;
171 Create(C : Cylinder from gp; W : Wire from TopoDS;
172 Inside : Boolean = Standard_True)
173 ---Purpose: Make a face from a cylinder and a wire.
175 returns MakeFace from BRepLib;
177 Create(C : Cone from gp; W : Wire from TopoDS;
178 Inside : Boolean = Standard_True)
179 ---Purpose: Make a face from a cone and a wire.
181 returns MakeFace from BRepLib;
183 Create(S : Sphere from gp; W : Wire from TopoDS;
184 Inside : Boolean = Standard_True)
185 ---Purpose: Make a face from a sphere and a wire.
187 returns MakeFace from BRepLib;
189 Create(C : Torus from gp; W : Wire from TopoDS;
190 Inside : Boolean = Standard_True)
191 ---Purpose: Make a face from a torus and a wire.
193 returns MakeFace from BRepLib;
195 Create(S : Surface from Geom; W : Wire from TopoDS;
196 Inside : Boolean = Standard_True)
197 ---Purpose: Make a face from a Surface and a wire.
199 returns MakeFace from BRepLib;
201 ----------------------------------------------
202 -- From face and wire.
203 ----------------------------------------------
205 Create(F : Face from TopoDS; W : Wire from TopoDS)
206 ---Purpose: Adds the wire <W> in the face <F>
208 returns MakeFace from BRepLib;
210 ----------------------------------------------
212 ----------------------------------------------
214 Init(me : in out; F : Face from TopoDS)
215 ---Purpose: Load the face.
219 Init(me : in out; S : Surface from Geom; Bound : Boolean; TolDegen : Real)
220 ---Purpose: Creates the face from the surface. If Bound is
221 -- True a wire is made from the natural bounds.
222 -- Accepts tolerance value (TolDegen) for resolution
223 -- of degenerated edges.
227 Init(me : in out; S : Surface from Geom; UMin, UMax, VMin, VMax, TolDegen : Real)
228 ---Purpose: Creates the face from the surface and the min-max
229 -- values. Accepts tolerance value (TolDegen) for resolution
230 -- of degenerated edges.
234 Add(me : in out; W : Wire from TopoDS)
235 ---Purpose: Adds the wire <W> in the current face.
239 ----------------------------------------------
241 ----------------------------------------------
243 CheckInside(me : in out)
244 ---Purpose: Reorient the current face if the boundary is not
249 ----------------------------------------------
251 ----------------------------------------------
253 Error(me) returns FaceError from BRepLib
257 Face(me) returns Face from TopoDS
258 ---Purpose: Returns the new face.
260 ---C++: return const &
261 ---C++: alias "Standard_EXPORT operator TopoDS_Face() const;"
268 myError : FaceError from BRepLib;