|
UF_SF_find_minimum_distance这个函数怎么用啊?有没有例子。
7 g0 R2 R& D6 z我创建了两个正方体,来求两个实体的最小距离,好像不行,且我已经把,feature转换成body的tag了。代码如下:! r3 c$ ^& K* Z/ d: n
int ret;
' q( n8 N2 y# {! f, i: X tag_t body_tag_1;
/ _5 b9 L6 J/ ]2 s! Q& s tag_t body_tag_2;" }, g1 V) s5 \' X$ r a, m
tag_t cyl_tag;
7 [' ]+ q' l/ q" }' b u# L* b char *edge_lens[3]={"10","10","10"};; X3 q$ w$ v4 @
ret=UF_MODL_create_block1(UF_UNITE ,origin,edge_lens,&cyl_tag);
4 g. |5 V' ^0 n8 x# Q) K( `- w tag_t part_1;
% s" Q( H$ F7 |( K double origin1[3]={0,0,20};8 V3 @% V" t0 h* e" ~. e0 P& K' T
char h1[256]="20";; {" [9 q& N' `
char d1[256]="40";/ g0 O1 p% {' o. o0 F
4 G" h3 K/ B* r& g4 G6 m
ret=UF_MODL_create_block1(UF_UNITE ,origin1,edge_lens,&part_1);
6 ]5 ` r1 T1 Z( M' lUF_MODL_ask_feat_body(cyl_tag,&body_tag_1);% }/ i6 `6 ]/ l- h2 B
UF_MODL_ask_feat_body(part_1,&body_tag_2);8 o$ [, k$ ]: @, m7 v% [7 E
double point[3],point1[3];
4 G5 a8 I2 k8 P data.value.real=3.14;: J5 Y s* Y" F# D8 {
double min_dist;3 P# b7 _" [7 A; H( B
UF_SF_find_minimum_distance(body_tag_1,body_tag_2,&min_dist,point,point1);, o2 {) P- F/ Q# z J- H' d
data.value.real=min_dist;
" @+ P9 w0 f$ ? x UF_STYLER_set_value(dialog_id,&data);
+ E& N( f& A8 P; B, s. m# ]0 p谢谢!!!! |
|