青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 2092|回复: 1

[疑难] 求助。。关于曲面上的曲线偏置

[复制链接]
发表于 2009-2-17 10:34 | 显示全部楼层 |阅读模式
利用的是函数UF_CURVE_create_ocf_feature();# N4 y: H+ k# ^+ R) Z. M$ L7 l' N
函数里面的参数有一个是表示偏置曲线的tag_t类型的参数,还有一个是表示曲面的tag_t类型的参数,但是我将曲线曲面的ID带入,怎么都得不到正确的结果。后来在文档中发现表示偏置曲线tag_t类型的参数必须是一个string,而曲面必须是一个face collector。那么如何将曲线的ID转化为string,还有如何将曲面的ID转化为face collector?$ N. n0 J6 V( w7 T
谢谢指导!!!!2 e2 v2 F2 p) s, I4 w$ u
代码如下(insect_curve 表示需要偏置曲线的ID,FP_surface表示曲面):
; f/ \! z3 _3 u3 q6 | UF_CURVE_ocf_data_p_t  offset_data ;$ W/ [2 [6 d& s2 [8 C0 b( d
offset_data =(UF_CURVE_ocf_data_s*)malloc(sizeof(UF_CURVE_ocf_data_s));
# U+ ~  `: \, M/ X memset(offset_data,0,sizeof(UF_CURVE_ocf_data_s));, E# n7 h9 G# i" r, G. i6 `* W
//*******************************************************//
8 Y. u3 e0 D; z' T  UF_CURVE_ocf_string_data_p_t real_string_data;
# h5 x4 A, c2 M" n- z5 I6 l( T  real_string_data =(UF_CURVE_ocf_string_data_s*)malloc(sizeof(UF_CURVE_ocf_string_data_s));
9 l/ v5 ]" i. T  memset(real_string_data,0,sizeof(UF_CURVE_ocf_string_data_s));
( c7 H( L/ R+ k( s  real_string_data->string_tag=insect_curve; // (有问题)    ' Z) t1 D" K# M7 K
                                           /* Tag of the string to offset */ //??????
9 Z7 D8 A: s) H4 W1 C! I  int real_offset_direction=1;# T- a" S! R# x
  real_string_data->offset_direction=real_offset_direction;
# c+ H  Y* l0 ]8 l                                             /* Flag to indicate the offset direction. 0 m5 t- B; u( H8 `5 H
                                           The direction can be either 1 or -1 */ //ok& W* [% {& }7 Q# Q0 t& t- U
  int real_num_offset=1;
, h) v, f8 `8 I  real_string_data->num_offsets=real_num_offset;
8 f) |4 I! e& B8 r7 l# D                                           /* Number of offsets to perform for the given string */ //ok
4 s8 x: i0 h; Q7 K. ?1 i9 s  UF_CURVE_ocf_values_p_t real_offset_distances;2 n; H; X6 D+ k' d
  real_offset_distances =(UF_CURVE_ocf_values_s *)malloc(sizeof(UF_CURVE_ocf_values_s));2 F( F/ h6 n3 E: V6 u$ n8 H/ L' L
  memset(real_offset_distances,0,sizeof(UF_CURVE_ocf_values_s));
- R" \; p. g: \; ]! R  strcpy(real_offset_distances->string,"40.0");
; r' p- z& W; N6 H1 l     (real_string_data->offset_distances)=real_offset_distances;
: w6 Z- u! E7 V+ a( E7 T                                           /* <len:num_offsets>An array that holds the offset values for8 t! ~0 ~) w- J. Y" U$ {
                                               each of the offset to perform for the given string */ //ok
2 W( y/ y' b9 o: w! H  offset_data->string_data=real_string_data;
! [2 @, t: n; K0 C: ~                              /* <len:num_string_data>  An array of strings to  be offset and the data
1 b& S2 x) P" {0 P1 f9 ^7 {% y                              associated with  them, as described in above string data structure*/. `$ {- P5 G% R' \' c
  int real_num_string_data=1;" c: l; k$ M+ j
     offset_data->num_string_data=real_num_string_data; /* Size of the string  array */6 O7 L* l/ F% x3 s

0 q) O6 T- u: E+ u4 v/ [9 Z# d/ |  UF_CURVE_ocf_face_data_p_t real_face_data;6 V8 j9 p" F+ J7 c
  real_face_data =(UF_CURVE_ocf_face_data_s*)malloc(sizeof(UF_CURVE_ocf_face_data_s));
) Q! T& v2 E: S2 d  memset(real_face_data,0,sizeof(UF_CURVE_ocf_face_data_s));% n7 D: [- m( B  ^# N, n& l
  real_face_data->face_tag=FP_surface;
9 j+ K1 @* r% z+ }5 h  offset_data->face_data=real_face_data;       /* Face data */0 {# R# `* j. z3 f
. v; o9 M! x" A- x
  offset_data->cross_boundary_mode=UF_CURVE_OCF_CROSS_BOUNDARIES_NONE; /* boundary mode method*/ //OK
7 p% T  ~4 o( w6 G+ @+ K. H, p% ~- u& e6 H/ s  x  t
     offset_data->offset_method=UF_CURVE_OCF_TANGENTIAL;       /* 相切投影 */ //OK, b( V, e/ \% |1 T) x2 v

+ D/ R" C! s4 J6 R9 s! g; R6 g     offset_data->trim_method=UF_CURVE_OCF_NO_EXTENSION;         /* Trimming options for offset */ //OK2 h# ]5 {: [& l/ P" l* o4 h
$ i/ n. e. u+ D/ b
     offset_data->span_method=UF_CURVE_OCF_SPAN_QUILT;         /* spanning options  for offset */ //OK
1 R$ s; q' i5 z1 A7 w, {
4 [9 J' X2 ?3 O4 a  double real_dist_tol=0.05;. s4 C0 T; Y5 @, v5 {
     offset_data->dist_tol=real_dist_tol;            /* distance tolerance */ //OK4 f1 s5 [" U  S* ]

- H1 D8 f+ }" T3 u3 r  double real_ang_tol=0;: ]) o0 S. A) ?. x: n0 H9 U
     offset_data->ang_tol=real_ang_tol;             /* angular  tolerance  */  //?
+ }- w+ f. F# m) `. {9 L, u7 |. y( K, e2 m% A! ~
  double real_string_tol=0;
3 @7 N8 }; \% i* |8 B( Q8 M8 b     offset_data->string_tol=real_string_tol;          /* string tolerance */  //?
; Y1 U; o, o; `) ]- P/ p8 f& [( W5 W$ [, U
3 {3 _# h' x" H7 d     tag_t *offset_curve=NULL;//tag_t *  feature Output : offset curve on face feature  //?' L* \$ Y3 I) [) K: ?9 h
  UF_CURVE_create_ocf_feature (offset_data, offset_curve );
 楼主| 发表于 2009-2-17 13:41 | 显示全部楼层
或者谁能给个关于曲线在曲面上偏置的源代码。。。。
4 m6 e! e: T3 @1 t, sthank you 。。。。。
: I+ i3 e. `9 o借鉴一下。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-5-10 13:46 , Processed in 0.571488 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表