青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

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

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

[复制链接]
发表于 2009-2-17 10:34 | 显示全部楼层 |阅读模式
利用的是函数UF_CURVE_create_ocf_feature();
* N! ~6 h; S: d9 @8 r3 P. B8 k函数里面的参数有一个是表示偏置曲线的tag_t类型的参数,还有一个是表示曲面的tag_t类型的参数,但是我将曲线曲面的ID带入,怎么都得不到正确的结果。后来在文档中发现表示偏置曲线tag_t类型的参数必须是一个string,而曲面必须是一个face collector。那么如何将曲线的ID转化为string,还有如何将曲面的ID转化为face collector?( X  S; ?% `9 p5 T% s6 R
谢谢指导!!!!% j7 k# `2 M5 F3 _% C) _
代码如下(insect_curve 表示需要偏置曲线的ID,FP_surface表示曲面):) m5 B9 }' d3 N6 M8 _. k- l
UF_CURVE_ocf_data_p_t  offset_data ;- k# s& F. A- {! j* U
offset_data =(UF_CURVE_ocf_data_s*)malloc(sizeof(UF_CURVE_ocf_data_s));* a) z- Z/ t% {6 k
memset(offset_data,0,sizeof(UF_CURVE_ocf_data_s));) U" l' I) R0 t1 y8 I& {2 N
//*******************************************************//
! b, |( e* n6 k- a5 u* I  UF_CURVE_ocf_string_data_p_t real_string_data;
  g1 S$ X, C: _  L+ i2 ~  real_string_data =(UF_CURVE_ocf_string_data_s*)malloc(sizeof(UF_CURVE_ocf_string_data_s));
% r$ [. @5 f, O, @2 R  memset(real_string_data,0,sizeof(UF_CURVE_ocf_string_data_s));- J4 o" }; R5 n; ^
  real_string_data->string_tag=insect_curve; // (有问题)    7 v: W7 w3 d7 N
                                           /* Tag of the string to offset */ //??????
' ~9 X8 F, N* l! A4 \  int real_offset_direction=1;
4 e! H5 y0 j, {3 {. v  real_string_data->offset_direction=real_offset_direction; 3 V9 Q. V  c, o" a5 S% L
                                             /* Flag to indicate the offset direction.
* ]  l! ^/ t/ c& L. X- X1 _                                           The direction can be either 1 or -1 */ //ok& U; Z7 V/ S, q) j0 B6 X
  int real_num_offset=1;
1 R' c0 H, ^3 d  real_string_data->num_offsets=real_num_offset;
% E0 }* C! f! E4 M6 @                                           /* Number of offsets to perform for the given string */ //ok- D7 f( c* \" W" G. {" w8 r8 H- \
  UF_CURVE_ocf_values_p_t real_offset_distances;
$ y+ f, I. d- D. r6 q7 M4 K1 y8 p  real_offset_distances =(UF_CURVE_ocf_values_s *)malloc(sizeof(UF_CURVE_ocf_values_s));6 @* W0 P8 d+ y- |8 A' E( c
  memset(real_offset_distances,0,sizeof(UF_CURVE_ocf_values_s));6 s5 O. S) r4 P$ M/ [% l+ q
  strcpy(real_offset_distances->string,"40.0");
( }4 Q: p/ g9 Y8 I     (real_string_data->offset_distances)=real_offset_distances; " W: Y5 W7 Y' R4 ~; T
                                           /* <len:num_offsets>An array that holds the offset values for& v6 X7 b7 B1 S' Y5 O, R& H
                                               each of the offset to perform for the given string */ //ok
" H1 R4 U- @' l+ G  offset_data->string_data=real_string_data;% @4 k- @4 N2 b" v9 d
                              /* <len:num_string_data>  An array of strings to  be offset and the data
" L- ~  T, y2 V& b                              associated with  them, as described in above string data structure*/! ?6 o8 J) i8 L! Q* @1 J
  int real_num_string_data=1;3 K6 Z5 f: f: p; k# ~
     offset_data->num_string_data=real_num_string_data; /* Size of the string  array */
% \6 \1 H0 D6 Q- Z+ l
5 j$ [  D& P6 Y8 }. c% s# O" v  UF_CURVE_ocf_face_data_p_t real_face_data;
5 O2 A  H  S/ G9 h  real_face_data =(UF_CURVE_ocf_face_data_s*)malloc(sizeof(UF_CURVE_ocf_face_data_s));
; J5 H& L. u- v3 q2 |  memset(real_face_data,0,sizeof(UF_CURVE_ocf_face_data_s));
  O  H) g6 R; y. `1 S- C6 s: x; m8 ~  real_face_data->face_tag=FP_surface;
# c# c6 A! F/ h1 \: n6 Z/ I  offset_data->face_data=real_face_data;       /* Face data */
2 h) c( ?9 W7 a+ J; W2 S9 x+ h1 n$ V5 s) M5 A
  offset_data->cross_boundary_mode=UF_CURVE_OCF_CROSS_BOUNDARIES_NONE; /* boundary mode method*/ //OK
1 R4 U' S1 O2 |, X
9 y7 A( H$ s5 I5 O     offset_data->offset_method=UF_CURVE_OCF_TANGENTIAL;       /* 相切投影 */ //OK# r8 H- q( s7 e- K0 K

. q) v8 F% e& c     offset_data->trim_method=UF_CURVE_OCF_NO_EXTENSION;         /* Trimming options for offset */ //OK, y2 C; j( ?3 @9 B6 k' k# x

2 N/ V- }  @- o/ `; X     offset_data->span_method=UF_CURVE_OCF_SPAN_QUILT;         /* spanning options  for offset */ //OK  l! j' [% N/ F. `9 K- [2 m0 U

, w3 U  H, f; L! \/ J  double real_dist_tol=0.05;- D2 J$ a6 a$ Q+ O" U% a* m1 C
     offset_data->dist_tol=real_dist_tol;            /* distance tolerance */ //OK
/ P' @. C2 G/ r+ [9 h# }! z; P
: X& Y1 a1 a: b  double real_ang_tol=0;( s+ y6 ^' l  H/ r9 l* P. [  r7 l$ O
     offset_data->ang_tol=real_ang_tol;             /* angular  tolerance  */  //?1 N) s  V( M4 z! h3 _3 Z
1 k  N! Z7 w0 h6 g' o. a
  double real_string_tol=0;1 B: C2 A8 z( I2 o- [; i2 `  g
     offset_data->string_tol=real_string_tol;          /* string tolerance */  //?
4 w6 y2 J% W0 X; Y
4 `# a+ b$ Y% y* `& y     tag_t *offset_curve=NULL;//tag_t *  feature Output : offset curve on face feature  //?  w# I* }" ]5 t
  UF_CURVE_create_ocf_feature (offset_data, offset_curve );
 楼主| 发表于 2009-2-17 13:41 | 显示全部楼层
或者谁能给个关于曲线在曲面上偏置的源代码。。。。
' D" C' @- m/ rthank you 。。。。。" P* [: z9 S. a8 {3 a
借鉴一下。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-28 01:41 , Processed in 0.067212 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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