首页 > Windows开发 > 详细

UG OPENAPI 实体求和 求交 求差

时间:2021-03-11 10:25:25      阅读:50      评论:0      收藏:0      [点我收藏+]

tag_t create_block()
{//创建立方体
      double origin[3]={0.0,0.0,0.0};
      char *edge_lens[3]={"1","1","1"};
      tag_t block, feature;
      UF_MODL_create_block1(UF_NULLSIGN,origin,edge_lens,&feature);
      UF_MODL_ask_feat_body(feature,&block);
      return block;
}
tag_t create_cylinder()
{//创建圆柱
      double origin[3]={0.0,0.0,0.0};
      char *height="2.0";
      char *diameter={"1.0"};
      double direction[3]={0.0,0.0,1.0};
      tag_t cylinder, feature;
      UF_MODL_create_cyl1(UF_NULLSIGN,origin,height,diameter,direction,&feature);
      UF_MODL_ask_feat_body(feature,&cylinder);
      return cylinder;

}

void qiuhe()
{
    //两实体求和
    tag_t block, cylinder, *resulting_bodies = NULL;
    int num_results;
    block=create_block();
    cylinder=create_cylinder();
    UF_MODL_unite_bodies(block,cylinder);
    //UF_MODL_unite_bodies_with_retained_options
}
void qiujiao()
{
    //两实体求交
    tag_t block, cylinder, *resulting_bodies = NULL;
    int num_results;
    block=create_block();
    cylinder=create_cylinder();
    UF_MODL_intersect_bodies(block,cylinder,&num_results,&resulting_bodies);
    if (num_results > 0)
        UF_free(resulting_bodies);
    //UF_MODL_intersect_bodies_with_retained_options
}
void qiucha()
{
    //两实体求差
    tag_t block, cylinder, *resulting_bodies = NULL;
    int num_results;
    block=create_block();
    cylinder=create_cylinder();
    UF_MODL_subtract_bodies(block,cylinder,&num_results,&resulting_bodies);
    if (num_results > 0)
        UF_free(resulting_bodies);
    //UF_MODL_subtract_bodies_with_retained_options
}

UG OPENAPI 实体求和 求交 求差

原文:https://www.cnblogs.com/feiyangkf/p/14515568.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!