7fd59977 |
1 | -- File: PrincipalProps.cdl |
2 | -- Created: Mon Feb 17 17:50:44 1992 |
3 | -- Author: Jean Claude VAUTHIER |
4 | ---Copyright: Matra Datavision 1992 |
5 | |
6 | |
7 | class PrincipalProps |
8 | |
9 | |
10 | from GProp |
11 | |
12 | ---Purpose: |
13 | -- A framework to present the principal properties of |
14 | -- inertia of a system of which global properties are |
15 | -- computed by a GProp_GProps object. |
16 | -- There is always a set of axes for which the |
17 | -- products of inertia of a geometric system are equal |
18 | -- to 0; i.e. the matrix of inertia of the system is |
19 | -- diagonal. These axes are the principal axes of |
20 | -- inertia. Their origin is coincident with the center of |
21 | -- mass of the system. The associated moments are |
22 | -- called the principal moments of inertia. |
23 | -- This sort of presentation object is created, filled and |
24 | -- returned by the function PrincipalProperties for |
25 | -- any GProp_GProps object, and can be queried to access the result. |
26 | -- Note: The system whose principal properties of |
27 | -- inertia are returned by this framework is referred to |
28 | -- as the current system. The current system, |
29 | -- however, is retained neither by this presentation |
30 | -- framework nor by the GProp_GProps object which activates it. |
31 | uses Vec from gp, |
32 | Pnt from gp |
33 | |
34 | raises UndefinedAxis from GProp |
35 | |
36 | is |
37 | |
38 | |
39 | |
40 | |
41 | Create returns PrincipalProps; |
42 | --- Purpose : creates an undefined PrincipalProps. |
43 | |
44 | |
45 | HasSymmetryAxis (me) returns Boolean is static; |
46 | --- Purpose : |
47 | -- returns true if the geometric system has an axis of symmetry. |
48 | -- For comparing moments relative tolerance 1.e-10 is used. |
49 | -- Usually it is enough for objects, restricted by faces with |
50 | -- analitycal geometry. |
51 | |
52 | HasSymmetryAxis (me; aTol : Real) returns Boolean is static; |
53 | --- Purpose : |
54 | -- returns true if the geometric system has an axis of symmetry. |
55 | -- aTol is relative tolerance for cheking equality of moments |
56 | -- If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I)) |
57 | |
58 | |
59 | HasSymmetryPoint (me) returns Boolean is static; |
60 | --- Purpose : |
61 | -- returns true if the geometric system has a point of symmetry. |
62 | -- For comparing moments relative tolerance 1.e-10 is used. |
63 | -- Usually it is enough for objects, restricted by faces with |
64 | -- analitycal geometry. |
65 | |
66 | HasSymmetryPoint (me; aTol : Real) returns Boolean is static; |
67 | --- Purpose : |
68 | -- returns true if the geometric system has a point of symmetry. |
69 | -- aTol is relative tolerance for cheking equality of moments |
70 | -- If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I)) |
71 | |
72 | |
73 | Moments (me; Ixx, Iyy, Izz: out Real) is static; |
74 | --- Purpose : Ixx, Iyy and Izz return the principal moments of inertia |
75 | -- in the current system. |
76 | -- Notes : |
77 | -- - If the current system has an axis of symmetry, two |
78 | -- of the three values Ixx, Iyy and Izz are equal. They |
79 | -- indicate which eigen vectors define an infinity of |
80 | -- axes of principal inertia. |
81 | -- - If the current system has a center of symmetry, Ixx, |
82 | -- Iyy and Izz are equal. |
83 | |
84 | |
85 | FirstAxisOfInertia (me) returns Vec |
86 | --- Purpose : returns the first axis of inertia. |
87 | raises UndefinedAxis |
88 | --- Purpose : |
89 | -- if the system has a point of symmetry there is an infinity of |
90 | -- solutions. It is not possible to defines the three axis of |
91 | -- inertia. |
92 | ---C++: return const& |
93 | is static; |
94 | |
95 | SecondAxisOfInertia (me) returns Vec |
96 | --- Purpose : returns the second axis of inertia. |
97 | raises UndefinedAxis |
98 | --- Purpose : |
99 | -- if the system has a point of symmetry or an axis of symmetry the |
100 | -- second and the third axis of symmetry are undefined. |
101 | ---C++: return const& |
102 | is static; |
103 | |
104 | |
105 | ThirdAxisOfInertia (me) returns Vec |
106 | --- Purpose : returns the third axis of inertia. |
107 | -- This and the above functions return the first, second or third eigen vector of the |
108 | -- matrix of inertia of the current system. |
109 | -- The first, second and third principal axis of inertia |
110 | -- pass through the center of mass of the current |
111 | -- system. They are respectively parallel to these three eigen vectors. |
112 | -- Note that: |
113 | -- - If the current system has an axis of symmetry, any |
114 | -- axis is an axis of principal inertia if it passes |
115 | -- through the center of mass of the system, and runs |
116 | -- parallel to a linear combination of the two eigen |
117 | -- vectors of the matrix of inertia, corresponding to the |
118 | -- two eigen values which are equal. If the current |
119 | -- system has a center of symmetry, any axis passing |
120 | -- through the center of mass of the system is an axis |
121 | -- of principal inertia. Use the functions |
122 | -- HasSymmetryAxis and HasSymmetryPoint to |
123 | -- check these particular cases, where the returned |
124 | -- eigen vectors define an infinity of principal axis of inertia. |
125 | -- - The Moments function can be used to know which |
126 | -- of the three eigen vectors corresponds to the two |
127 | -- eigen values which are equal. |
128 | raises UndefinedAxis |
129 | --- Purpose : |
130 | -- if the system has a point of symmetry or an axis of symmetry the |
131 | -- second and the third axis of symmetry are undefined. |
132 | ---C++: return const& |
133 | is static; |
134 | |
135 | |
136 | RadiusOfGyration (me; Rxx, Ryy, Rzz : out Real) is static; |
137 | --- Purpose : Returns the principal radii of gyration Rxx, Ryy |
138 | -- and Rzz are the radii of gyration of the current |
139 | -- system about its three principal axes of inertia. |
140 | -- Note that: |
141 | -- - If the current system has an axis of symmetry, |
142 | -- two of the three values Rxx, Ryy and Rzz are equal. |
143 | -- - If the current system has a center of symmetry, |
144 | -- Rxx, Ryy and Rzz are equal. |
145 | |
146 | |
147 | |
148 | |
149 | |
150 | Create (Ixx, Iyy, Izz, Rxx, Ryy, Rzz : Real; Vxx, Vyy, Vzz : Vec; G : Pnt) |
151 | returns PrincipalProps |
152 | is private; |
153 | |
154 | |
155 | |
156 | fields |
157 | |
158 | i1 : Real; |
159 | i2 : Real; |
160 | i3 : Real; |
161 | r1 : Real; |
162 | r2 : Real; |
163 | r3 : Real; |
164 | v1 : Vec; |
165 | v2 : Vec; |
166 | v3 : Vec; |
167 | g : Pnt; |
168 | |
169 | friends |
170 | |
171 | PrincipalProperties from GProps (me) |
172 | |
173 | end PrincipalProps; |