b311480e |
1 | -- Created on: 1995-11-02 |
2 | -- Created by: Jing Cheng MEI |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class FindPlane from BRepBuilderAPI |
24 | |
25 | ---Purpose: Describes functions to find the plane in which the edges |
26 | -- of a given shape are located. |
27 | -- A FindPlane object provides a framework for: |
28 | -- - extracting the edges of a given shape, |
29 | -- - implementing the construction algorithm, and |
30 | -- - consulting the result. |
31 | |
32 | uses |
33 | |
34 | Shape from TopoDS, |
35 | Plane from Geom |
36 | |
37 | raises |
38 | |
39 | NoSuchObject from Standard |
40 | |
41 | is |
42 | |
43 | Create |
44 | returns FindPlane from BRepBuilderAPI; |
45 | ---Purpose: Initializes an empty algorithm. The function Init is then used to define the shape. |
46 | |
47 | Create (S : Shape from TopoDS; |
48 | Tol : Real from Standard = -1) |
49 | returns FindPlane from BRepBuilderAPI; |
50 | ---Purpose: Constructs the plane containing the edges of the shape S. |
51 | -- A plane is built only if all the edges are within a distance |
52 | -- of less than or equal to tolerance from a planar surface. |
53 | -- This tolerance value is equal to the larger of the following two values: |
54 | -- - Tol, where the default value is negative, or |
55 | -- - the largest of the tolerance values assigned to the individual edges of S. |
56 | -- Use the function Found to verify that a plane is built. |
57 | -- The resulting plane is then retrieved using the function Plane. |
58 | |
59 | Init (me : in out; |
60 | S : Shape from TopoDS; |
61 | Tol : Real from Standard = -1); |
62 | ---Purpose: Constructs the plane containing the edges of the shape S. |
63 | -- A plane is built only if all the edges are within a distance |
64 | -- of less than or equal to tolerance from a planar surface. |
65 | -- This tolerance value is equal to the larger of the following two values: |
66 | -- - Tol, where the default value is negative, or |
67 | -- - the largest of the tolerance values assigned to the individual edges of S. |
68 | -- Use the function Found to verify that a plane is built. |
69 | -- The resulting plane is then retrieved using the function Plane. |
70 | |
71 | Found(me) |
72 | returns Boolean from Standard; |
73 | ---Purpose: Returns true if a plane containing the edges of the |
74 | -- shape is found and built. Use the function Plane to consult the result. |
75 | Plane(me) |
76 | returns mutable Plane from Geom; |
77 | ---Purpose: Returns the plane containing the edges of the shape. |
78 | -- Warning |
79 | -- Use the function Found to verify that the plane is built. If |
80 | -- a plane is not found, Plane returns a null handle. |
81 | |
82 | fields |
83 | |
84 | myPlane : Plane from Geom; |
85 | |
86 | end FindPlane; |