1 -- Created on: 1993-06-16
2 -- Created by: Isabelle GRIGNON
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 PEquation from GProp
19 ---Purpose: A framework to analyze a collection - or cloud
20 -- - of points and to verify if they are coincident,
21 -- collinear or coplanar within a given precision. If
22 -- so, it also computes the mean point, the mean
23 -- line or the mean plane of the points. If not, it
24 -- computes the minimal box which includes all the points.
32 Array1OfPnt from TColgp
35 raises NoSuchObject from Standard
39 Create(Pnts: Array1OfPnt;Tol : Real from Standard)
40 returns PEquation from GProp;
41 ---Purpose: Constructs a framework to analyze the
42 -- collection of points Pnts and computes:
43 -- - the mean point if the points in question are
44 -- considered to be coincident within the precision Tol, or
45 -- - the mean line if they are considered to be
46 -- collinear within the precision Tol, or
47 -- - the mean plane if they are considered to be
48 -- coplanar within the precision Tol, or
49 -- - the minimal box which contains all the points. Use :
50 -- - the functions IsPoint, IsLinear, IsPlanar
51 -- and IsSpace to find the result of the analysis, and
52 -- - the function Point, Line, Plane or Box to
53 -- access the computed result.
55 IsPlanar(me) returns Boolean
56 ---Purpose: Returns true if, according to the given
57 -- tolerance, the points analyzed by this framework are coplanar.
58 -- Use the function Plane to access the computed result.
61 IsLinear(me) returns Boolean
62 ---Purpose: Returns true if, according to the given
63 -- tolerance, the points analyzed by this framework are colinear.
64 -- Use the function Line to access the computed result.
67 IsPoint(me) returns Boolean
68 ---Purpose: Returns true if, according to the given
69 -- tolerance, the points analyzed by this framework are coincident.
70 -- Use the function Point to access the computed result.
73 IsSpace(me) returns Boolean
74 ---Purpose: Returns true if, according to the given
75 -- tolerance value, the points analyzed by this
76 -- framework are neither coincident, nor collinear, nor coplanar.
77 -- Use the function Box to query the smallest box
78 -- that includes the collection of points.
81 Plane(me) returns Pln from gp
83 ---Purpose: Returns the mean plane passing near all the
84 -- points analyzed by this framework if, according
85 -- to the given precision, the points are considered to be coplanar.
87 -- Standard_NoSuchObject if, according to the
88 -- given precision value, the points analyzed by
89 -- this framework are considered to be:
95 Line(me) returns Lin from gp
97 ---Purpose: Returns the mean line passing near all the
98 -- points analyzed by this framework if, according
99 -- to the given precision value, the points are considered to be collinear.
101 -- Standard_NoSuchObject if, according to the
102 -- given precision, the points analyzed by this
103 -- framework are considered to be:
108 Point(me) returns Pnt from gp
110 ---Purpose: Returns the mean point of all the points
111 -- analyzed by this framework if, according to the
112 -- given precision, the points are considered to be coincident.
114 -- Standard_NoSuchObject if, according to the
115 -- given precision, the points analyzed by this
116 -- framework are not considered to be coincident.
119 Box(me; P : out Pnt from gp; V1,V2,V3 : out Vec from gp)
120 ---Purpose: Returns the definition of the smallest box which
121 -- contains all the points analyzed by this
122 -- framework if, according to the given precision
123 -- value, the points are considered to be neither
124 -- coincident, nor collinear and nor coplanar.
125 -- This box is centered on the barycenter P of the
126 -- collection of points. Its sides are parallel to the
127 -- three vectors V1, V2 and V3, the length of
128 -- which is the length of the box in the corresponding direction.
129 -- Note: Vectors V1, V2 and V3 are parallel to
130 -- the three axes of principal inertia of the system
131 -- composed of the collection of points where each point is of equal mass.
133 -- Standard_NoSuchObject if, according to the given precision,
134 -- the points analyzed by this framework are considered to be coincident, collinear or coplanar.
139 type : EquaType from GProp;