|
UF_SF_find_minimum_distance这个函数怎么用啊?有没有例子。
: I% s: l$ y* A! u$ s我创建了两个正方体,来求两个实体的最小距离,好像不行,且我已经把,feature转换成body的tag了。代码如下:; M( D. T0 O1 s3 I, t- A
int ret;
, ` t9 V6 y3 h0 U# S tag_t body_tag_1;
% L6 K5 J' p; B. } tag_t body_tag_2;
7 }. H9 ?" U" v5 B5 h tag_t cyl_tag; $ {# e3 ?6 q3 V! t* b8 r
char *edge_lens[3]={"10","10","10"};" C+ P) @0 N. ^
ret=UF_MODL_create_block1(UF_UNITE ,origin,edge_lens,&cyl_tag);
$ C# r9 @3 _; l1 x$ M6 f tag_t part_1;
( y& a0 [& X. N* @0 o double origin1[3]={0,0,20};
, z4 E8 w* W- h3 ^" W7 O: ~ char h1[256]="20";
# ]* F* Y' o8 N" Q3 J3 ?2 J char d1[256]="40";
0 D U' Z. n3 c) C' q' R& J: x& L: Q* V- F( t5 j/ z/ g
ret=UF_MODL_create_block1(UF_UNITE ,origin1,edge_lens,&part_1);
- ]! B8 F. l) O$ o) ?! G9 lUF_MODL_ask_feat_body(cyl_tag,&body_tag_1);4 I: Q/ W6 k) ~5 H. G2 P
UF_MODL_ask_feat_body(part_1,&body_tag_2);
5 }3 n6 X. u) P5 L+ K double point[3],point1[3];
& C# L; o' Q' B1 b/ p- m2 q data.value.real=3.14;: u- D$ g8 t3 S( _3 M- g" m& w
double min_dist;! h/ @" g [$ x2 w
UF_SF_find_minimum_distance(body_tag_1,body_tag_2,&min_dist,point,point1);# w% V" i1 a( p, p
data.value.real=min_dist;; b* H; b w: D8 V3 \1 ]) f
UF_STYLER_set_value(dialog_id,&data); - F* v/ U% M9 R4 {- r
谢谢!!!! |
|