|
double AskFaceAreasByPK(tag_t face_tag, double tol)
" s" d5 ^0 i* l0 L* b# ~{
* A P6 i. @/ n- B; Z tag_t ps_tag = NULL_TAG;/ R% b' i% Q' r0 z" @/ }5 Y
double amount[3] = { 0.0, 0.0, 0.0 };4 R' [% W8 j( p! {' L) O
double mass[3] = { 0.0, 0.0, 0.0 };+ P4 E1 k6 r* s: H+ ?# Z! X
double c_of_g[3] = { 0.0, 0.0, 0.0 };+ T0 C6 n0 f6 b# R. W
double m_of_i[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };$ j- p$ P6 ^* y. C/ K' ~% E, L( M0 Y
double periphery[3] = { 0.0, 0.0, 0.0 };% X* C: K% a7 M
double areas = 0.0;
: q }( ~* X( o, R! |) h PK_FACE_t pkFace = 0;4 ~, y1 Z2 d( r9 _; o% N: w$ P
PK_TOPOL_eval_mass_props_o_t props_o_t; 9 `8 E" c" q- B
if (NULL_TAG == face_tag || UF_PS_ask_ps_tag_of_object(face_tag, &ps_tag))
& f8 a. _( Z! ?$ u" L return 0;
8 E2 G8 |( h! R pkFace = ps_tag;
! F. f0 k& p+ ]; n. L0 S if (tol < 0.99)
+ f" Q/ q& k! F tol = 0.99;4 r# t' f1 {6 K9 h$ T" |
if (tol > 1.0)/ x- g Y, }) t. z+ _! t, v5 H
tol = 1.0;1 b( ~ I6 p: J9 k6 I
PK_TOPOL_eval_mass_props_o_m(props_o_t);* G* w9 `8 V" j
props_o_t.mass = PK_mass_c_of_g_c;( u+ K+ r! T4 `( p0 Y5 s* A
PK_TOPOL_eval_mass_props(1, &pkFace, tol, &props_o_t, amount, mass, c_of_g, m_of_i, periphery);8 U) b2 ]! Y6 s; k* I) r9 ~6 y- V) W
areas = amount[0] * 1000.0 * 1000.0;
8 A" m [+ u) {2 c' {: P return areas;+ |; \3 b6 x2 T: U2 k* M2 t3 `
}
- j0 c9 m6 N( {- p9 z. f, G A3 L2 U
|
|