忘了说了,上面的程序有问题,下面的程序处理U形的情况没问题,只有一个side_string1
手工选择两个side_string1的情况就有问题了
tag_t CreateBridgeFace(tag_t* bridge_faces,tag_t* bridge_edges,std::vector<tag_t> side_string)
{
int sum_edge = side_string.size();
//tag_t bridge_faces[2];
//tag_t bridge_edges[2];
UF_STRING_t side_string1;
UF_MODL_init_string_list(&side_string1);
UF_MODL_create_string_list(1,sum_edge,&side_string1);
int i=0;
side_string1.string = i+1;
side_string1.dir = UF_MODL_CURVE_START_FROM_BEGIN;
side_string1.id = side_string;
while(i<(sum_edge-1))
{
Edge* edge1 = trans<Edge*>(side_string);
Edge* edge2 = trans<Edge*>(side_string[++i]);
side_string1.string = i+1;
side_string1.dir = UF_MODL_CURVE_START_FROM_BEGIN;
side_string1.id = side_string;
};
UF_STRING_t side_string2;
UF_MODL_init_string_list(&side_string2);
UF_MODL_create_string_list(0,0,&side_string2);
tag_t side_faces[2];
side_faces[0] = NULL_TAG;
side_faces[1] = NULL_TAG;
tag_t side_edges[2];
side_edges[0] = NULL_TAG;
side_edges[1] = NULL_TAG;
int primary_edges_dir[2]={1,1};
tag_t bridge;
int error = UF_MODL_create_bridge_face(1,1,bridge_faces,bridge_edges,primary_edges_dir,&side_string1,&side_string2,side_faces,side_edges,&bridge);
if(error!=0)
{
char msg[133];
UF_get_fail_message(error,msg);
uc1601(msg,1);
}
//UF_MODL_free_string_list(&side_string1);
//UF_MODL_free_string_list(&side_string2);
return bridge;
} |