|
UF_SF_find_minimum_distance这个函数怎么用啊?有没有例子。
( \* p1 e, R5 {& X( s! G% a我创建了两个正方体,来求两个实体的最小距离,好像不行,且我已经把,feature转换成body的tag了。代码如下:
* d Z* [) x5 t2 m int ret;
1 x7 h* ]9 J: }9 f tag_t body_tag_1;
% Q G$ r' `/ i6 [ tag_t body_tag_2;, n- J3 g) ?5 O! |4 G) J
tag_t cyl_tag; ' M' d, `8 v6 \+ f5 m. m
char *edge_lens[3]={"10","10","10"};
5 y: g+ [+ R' j2 b2 G1 W ret=UF_MODL_create_block1(UF_UNITE ,origin,edge_lens,&cyl_tag);" i. }+ h7 M3 `' g. q1 l: L' c$ l
tag_t part_1;) K1 a i: A$ l. c4 q" H3 u
double origin1[3]={0,0,20};+ s+ Q" e, A! v0 v. [! V5 }
char h1[256]="20";
3 z; Y O- G! u9 N0 ` char d1[256]="40";: y+ I4 H' q( H9 j. V* L/ B/ \$ a
U% ^$ n- C* ~. H& n: H ret=UF_MODL_create_block1(UF_UNITE ,origin1,edge_lens,&part_1);
0 T m9 ~% s' B9 d0 |1 [: y- NUF_MODL_ask_feat_body(cyl_tag,&body_tag_1);6 A9 R, H0 ^3 O q8 Z- C9 ~
UF_MODL_ask_feat_body(part_1,&body_tag_2);
! |* j8 O2 E' L1 `- w* D double point[3],point1[3];4 Y; V" s$ j* t- E
data.value.real=3.14;9 V6 U+ q' {& q* z% r2 h/ K
double min_dist;( A9 J8 w! ?+ B
UF_SF_find_minimum_distance(body_tag_1,body_tag_2,&min_dist,point,point1);' ^, G6 s# ]; R' Z
data.value.real=min_dist;
. u% O0 u$ ]# }2 X4 U7 C UF_STYLER_set_value(dialog_id,&data); : q1 {" z; ~2 O1 R8 N; e
谢谢!!!! |
|