PK创建块和圆柱还是挺常用的,比如胚料和水路,包容柱和包容块,创建速度比UF快好多倍
bool PK_create_Block(double org[3],double dir[3][3],double dis[3],tag_t &body_tag)//dir[3][3]其实只用到了x和z,你可以改一下传参
{
tag_t partition;
UF_PS_ask_current_partition(&partition);
PK_AXIS2_sf_t basis_set;
UF_VEC3_scale(0.001,org,basis_set.location.coord);
UF_VEC3_copy(dir[2],basis_set.axis.coord);
UF_VEC3_copy(dir[0],basis_set.ref_direction.coord);
PK_BODY_t pkBody;
if(PK_BODY_create_solid_block(dis[0]*0.001,dis[1]*0.001,dis[2]*0.001,&basis_set,&pkBody)){return 0;}
PK_BODY_change_partition(pkBody,&partition);
UF_PS_create_obj_from_ps_tag(pkBody,&body_tag);
UF_DISP_add_item_to_display(body_tag);//不加入显示看不到
return 1;
}
bool PK_create_Cyl(double org[3],double dir_z[3],double diam,double height,tag_t &body_tag)
{
doulbe mtx3[9];
UF_MTX3_initialize_z(dir_z,mtx3);
tag_t partition;
UF_PS_ask_current_partition(&partition);
PK_AXIS