iCAx开思网

标题: 求助。。关于曲面上的曲线偏置 [打印本页]

作者: tommiechen    时间: 2009-3-24 16:10
标题: 求助。。关于曲面上的曲线偏置
利用的是函数UF_CURVE_create_ocf_feature();
函数里面的参数有一个是表示偏置曲线的tag_t类型的参数,还有一个是表示曲面的tag_t类型的参数,但是我将曲线曲面的ID带入,怎么都得不到正确的结果。后来在文档中发现表示偏置曲线tag_t类型的参数必须是一个string,而曲面必须是一个face collector。那么如何将曲线的ID转化为string,还有如何将曲面的ID转化为face collector?
谢谢指导!!!!
代码如下(insect_curve 表示需要偏置曲线的ID,FP_surface表示曲面):
UF_CURVE_ocf_data_p_t  offset_data ;
offset_data =(UF_CURVE_ocf_data_s*)malloc(sizeof(UF_CURVE_ocf_data_s));
memset(offset_data,0,sizeof(UF_CURVE_ocf_data_s));
//*******************************************************//
  UF_CURVE_ocf_string_data_p_t real_string_data;
  real_string_data =(UF_CURVE_ocf_string_data_s*)malloc(sizeof(UF_CURVE_ocf_string_data_s));
  memset(real_string_data,0,sizeof(UF_CURVE_ocf_string_data_s));
  real_string_data->string_tag=insect_curve; // (有问题)   
                                           /* Tag of the string to offset */ //??????
  int real_offset_direction=1;
  real_string_data->offset_direction=real_offset_direction;
                                             /* Flag to indicate the offset direction.
                                           The direction can be either 1 or -1 */ //ok
  int real_num_offset=1;
  real_string_data->num_offsets=real_num_offset;
                                           /* Number of offsets to perform for the given string */ //ok
  UF_CURVE_ocf_values_p_t real_offset_distances;
  real_offset_distances =(UF_CURVE_ocf_values_s *)malloc(sizeof(UF_CURVE_ocf_values_s));
  memset(real_offset_distances,0,sizeof(UF_CURVE_ocf_values_s));
  strcpy(real_offset_distances->string,"40.0");
     (real_string_data->offset_distances)=real_offset_distances;
                                           /* <len:num_offsets>An array that holds the offset values for
                                               each of the offset to perform for the given string */ //ok
  offset_data->string_data=real_string_data;
                              /* <len:num_string_data>  An array of strings to  be offset and the data
                              associated with  them, as described in above string data structure*/
  int real_num_string_data=1;
     offset_data->num_string_data=real_num_string_data; /* Size of the string  array */

  UF_CURVE_ocf_face_data_p_t real_face_data;
  real_face_data =(UF_CURVE_ocf_face_data_s*)malloc(sizeof(UF_CURVE_ocf_face_data_s));
  memset(real_face_data,0,sizeof(UF_CURVE_ocf_face_data_s));
  real_face_data->face_tag=FP_surface;
  offset_data->face_data=real_face_data;       /* Face data */

  offset_data->cross_boundary_mode=UF_CURVE_OCF_CROSS_BOUNDARIES_NONE; /* boundary mode method*/ //OK

     offset_data->offset_method=UF_CURVE_OCF_TANGENTIAL;       /* 相切投影 */ //OK

     offset_data->trim_method=UF_CURVE_OCF_NO_EXTENSION;         /* Trimming options for offset */ //OK

     offset_data->span_method=UF_CURVE_OCF_SPAN_QUILT;         /* spanning options  for offset */ //OK

  double real_dist_tol=0.05;
     offset_data->dist_tol=real_dist_tol;            /* distance tolerance */ //OK

  double real_ang_tol=0;
     offset_data->ang_tol=real_ang_tol;             /* angular  tolerance  */  //?

  double real_string_tol=0;
     offset_data->string_tol=real_string_tol;          /* string tolerance */  //?

     tag_t *offset_curve=NULL;//tag_t *  feature Output : offset curve on face feature  //?
  UF_CURVE_create_ocf_feature (offset_data, offset_curve );




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3