|
double AskFaceAreasByPK(tag_t face_tag, double tol)8 x, f& X$ L2 G, @9 O% j
{/ q2 d; k: j: r
tag_t ps_tag = NULL_TAG;
7 t3 w a* a, |0 Z5 z; n+ k double amount[3] = { 0.0, 0.0, 0.0 };- D) ^, R8 g( _3 R( x( I% o- [
double mass[3] = { 0.0, 0.0, 0.0 };/ ^4 b3 l$ [9 S: Y2 O: \; i3 \3 ~
double c_of_g[3] = { 0.0, 0.0, 0.0 };
; B- u% S- n. |+ G h, w double m_of_i[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
" c: [ B% n- p4 L/ @0 [ double periphery[3] = { 0.0, 0.0, 0.0 };0 f# _; Z6 @% J
double areas = 0.0;
- [2 G* Z3 Q' m PK_FACE_t pkFace = 0;8 W1 i5 ?* R3 R- a% k/ r0 k+ C
PK_TOPOL_eval_mass_props_o_t props_o_t;
+ M0 q9 N: G* ]' M B+ r if (NULL_TAG == face_tag || UF_PS_ask_ps_tag_of_object(face_tag, &ps_tag))
W" b+ _9 d' }1 ` return 0;0 {- _. {. \3 C) m, w
pkFace = ps_tag;" ?3 b+ u" E# i- ?" S
if (tol < 0.99)
1 E' G( P0 \) @8 w- b tol = 0.99;. z) A* ]0 |4 U) d6 i# G9 U( T
if (tol > 1.0)
+ }1 f5 n9 ~) m7 X tol = 1.0;- D- d6 N& H- C5 |
PK_TOPOL_eval_mass_props_o_m(props_o_t);
' c8 o7 a6 ^" s T2 g' y props_o_t.mass = PK_mass_c_of_g_c;
6 u v% t. S, h: n- R" t PK_TOPOL_eval_mass_props(1, &pkFace, tol, &props_o_t, amount, mass, c_of_g, m_of_i, periphery);
7 H; J# m& D: s* |) Y; @ areas = amount[0] * 1000.0 * 1000.0;7 D& N2 E. w+ J0 [1 h
return areas;+ t* n# `9 A4 O# m1 Z
}9 O: l8 I/ a) w" r5 d
% g2 {, q1 N: o4 L9 C |
|