|
double AskFaceAreasByPK(tag_t face_tag, double tol)7 @( D7 {) f0 r; U5 _
{) p/ l E5 x; K# f3 z4 }
tag_t ps_tag = NULL_TAG;) e5 s5 Y3 e- T' Y* I$ P6 c
double amount[3] = { 0.0, 0.0, 0.0 };
H- a3 {& S; J! \$ q( F double mass[3] = { 0.0, 0.0, 0.0 }; x& m' L! @8 O% |4 P, x1 l
double c_of_g[3] = { 0.0, 0.0, 0.0 };% {. Y, o% ^: U% F0 g" G
double m_of_i[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };. ~9 P/ y6 F/ R+ H
double periphery[3] = { 0.0, 0.0, 0.0 };
6 D4 G5 i/ ~6 N3 w1 Q! @: l double areas = 0.0;
) C! f; S% j8 W0 J! `" @ PK_FACE_t pkFace = 0;
6 Q% }3 N. w6 d1 z7 D& J PK_TOPOL_eval_mass_props_o_t props_o_t; . L4 u6 j) R8 V$ |% ]
if (NULL_TAG == face_tag || UF_PS_ask_ps_tag_of_object(face_tag, &ps_tag))
# l# D! M( h# m6 O) ?% @! u return 0;
$ t6 y+ q) t3 j' B) m; z pkFace = ps_tag;$ j1 K7 H5 M* E( h! r! a) ~' Z
if (tol < 0.99); h$ @: [& g6 v6 X8 i7 ]
tol = 0.99;( f+ o J7 V0 f5 L4 _" y" x
if (tol > 1.0)1 k2 u/ m- }2 V
tol = 1.0;4 j u$ N4 n% n- F, B& r- ?
PK_TOPOL_eval_mass_props_o_m(props_o_t);
+ n# }& z3 V& T8 c8 U$ g props_o_t.mass = PK_mass_c_of_g_c;& @% t4 [! p% s6 }( k$ I
PK_TOPOL_eval_mass_props(1, &pkFace, tol, &props_o_t, amount, mass, c_of_g, m_of_i, periphery);
( t" A* i! P0 e o5 N% F4 I1 w areas = amount[0] * 1000.0 * 1000.0;
9 S& N9 z5 N+ R7 c, _& M return areas;- A1 i* x5 J+ @2 r3 p
}
7 t3 q" H/ [% d( y! q- c$ |
& S+ `& C: t2 G- a, w: } |
|