基于ACIS的一段代码 请问大神这段代码哪里出了问题?为什么可编译却运行不出结果?
void main()
{
init();
api_start_modeller(0);
api_initialize_faceter();
api_initialize_constructors();
BODY* hoop;
api_make_torus(50, 100, hoop);
SPAbox bx= get_body_box(hoop);
double sd = (bx.high() - bx.low()).len() / 50.0;
REFINEMENT *ref = new REFINEMENT();
ref->set_surf_mode(AF_SURF_ALL);
ref->set_adjust_mode(AF_ADJUST_NONE);
ref->set_triang_mode(AF_TRIANG_ALL);
ref->get_surface_tol();
api_set_default_refinement(ref);
parameter_token ptoken[2];
ptoken[0] = POSITION_TOKEN;
ptoken[1] = NORMAL_TOKEN;
VERTEX_TEMPLATE*v1 = new VERTEX_TEMPLATE(2, ptoken);
api_set_default_vertex_template(v1);
FACE *f = hoop->lump()->shell()->face_list();
while (f) {
POLYGON_POINT_MESH*facets = (POLYGON_POINT_MESH*)NULL;
outcome res;
logical factedflag = 1;
res = api_faceted_face(f, factedflag);
api_get_face_facets(f, facets);
POLYGON*poly;
POLYGON_VERTEX *poly_vtx;
SPAposition vtx_pos;
for (poly = facets->first(); poly != NULL; poly = facets->last()) {
for (poly_vtx = poly->first(); poly_vtx != NULL;
poly_vtx = poly->last()) {
poly_vtx->point(vtx_pos);
printf("Position:%f%f%f\n", vtx_pos.x(), vtx_pos.y(), vtx_pos.z());
}
printf("Face facetted with %d polygons\n", facets->count());
delete facets;
f = f->next_in_list();
}
}
api_terminate_constructors();
api_terminate_faceter();
api_stop_modeller();
printf("chengg");
}