|
UF_SF_find_minimum_distance这个函数怎么用啊?有没有例子。7 `! P9 w6 R4 Z2 l
我创建了两个正方体,来求两个实体的最小距离,好像不行,且我已经把,feature转换成body的tag了。代码如下:
. I' f0 N, o5 j% ?$ N" K6 M/ H int ret;+ I. R, I5 D' _5 ~7 `3 z: ]4 }
tag_t body_tag_1;& z3 b( _, P: N, y8 ]
tag_t body_tag_2;: j" z* V0 i# V) e6 ?! n+ g
tag_t cyl_tag;
( @6 R! p/ G6 G) L Q+ Z% x2 a# p char *edge_lens[3]={"10","10","10"};
% ^! `# M& r8 `' c0 V! i/ F ret=UF_MODL_create_block1(UF_UNITE ,origin,edge_lens,&cyl_tag);
( s8 F: D* D, i: t' @, K! N tag_t part_1;
8 K; U- [7 I" U. Q double origin1[3]={0,0,20};; g3 [; z& e' `7 t$ I
char h1[256]="20";( l# B8 g6 s {/ \( a6 j
char d1[256]="40";, M! j3 R7 v K2 B' A
0 F$ W+ h% v, a, @$ r' V( Q ret=UF_MODL_create_block1(UF_UNITE ,origin1,edge_lens,&part_1);
- |; V7 _8 u' {3 z3 }# eUF_MODL_ask_feat_body(cyl_tag,&body_tag_1);3 E U1 q& B; J! f5 l
UF_MODL_ask_feat_body(part_1,&body_tag_2);
5 d' a1 r' k2 ` H% Y double point[3],point1[3];
8 N/ k' H0 o" D: n! R+ l data.value.real=3.14;
0 o- @- a9 q3 q$ ^. r' U- K r double min_dist;
/ g9 T5 _8 _* v3 ]1 S+ p( S UF_SF_find_minimum_distance(body_tag_1,body_tag_2,&min_dist,point,point1);7 V- k; S) @4 m/ `: V
data.value.real=min_dist;
6 o w$ U: b& T4 v UF_STYLER_set_value(dialog_id,&data);
' Q+ ?- c! V2 }4 _0 I谢谢!!!! |
|