iCAx开思网

标题: 求助,ug中的投影函数。 [打印本页]

作者: patriotic    时间: 2009-1-15 21:09
标题: 求助,ug中的投影函数。
各位大侠,在ug开发中,我想把空间中的一条样条曲线投影到yz、xy和xz平面上,不知道具体的函数是什么,谁能告诉我,谢谢了!!!
作者: jk5168    时间: 2009-1-17 17:54
#include #include #include #include #include #include #include #define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X))) static int report( char *file, int line, char *call, int irc) { if (irc) { char messg[133]; printf("%s, line %d: %s\n", file, line, call); (UF_get_fail_message(irc, messg)) ? printf(" returned a %d\n", irc) : printf(" returned error %d: %s\n", irc, messg); } return(irc); } static void do_ugopen_api(void) { int along_face = 1; int not_along_face = 0; tag_t arctag; tag_t wcs_tag; tag_t wcs_planetag; tag_t planetag; tag_t proj1tag; tag_t proj2tag; uf_list_p_t curve_refs; uf_list_p_t face1_refs; uf_list_p_t face2_refs; UF_CURVE_arc_t arc_coords; double plan1orig[3] = { 0.0, 0.0, 0.0 }; double plan2orig[3] = { 0.0, 0.0, 3.0 }; double x1axpt[3] = { 1.0, 0.0, 0.0 }; double x2axpt[3] = { 1.0, 0.0, 3.0 }; double plan1pt[3] = { 1.0, 1.0, 0.0 }; double plan2pt[3] = { 0.0, .70710678118655, 3.70710678118655 }; double proj_vector[3] = { 0.0, 0.0, 1.0 }; /* Create planes and arc */ FTN(uf5374)(plan1orig, x1axpt, plan1pt, &wcs_planetag); FTN(uf5374)(plan2orig, x2axpt, plan2pt, &planetag); UF_CALL(UF_CSYS_ask_wcs(&wcs_tag)); UF_CALL(UF_CSYS_ask_matrix_of_object(wcs_tag, &arc_coords.matrix_tag)); arc_coords.start_angle = 0.0; arc_coords.end_angle = 2 * PI; arc_coords.arc_center[0] = 1.0; arc_coords.arc_center[1] = 1.0; arc_coords.arc_center[2] = 6.0; arc_coords.radius = 0.5; UF_CALL(UF_CURVE_create_arc(&arc_coords, &arctag)); UF_CALL(UF_MODL_create_list(&curve_refs)); UF_MODL_create_list(&face1_refs); UF_MODL_create_list(&face2_refs); UF_MODL_put_list_item(curve_refs, arctag); UF_MODL_put_list_item(face1_refs, wcs_planetag); UF_MODL_put_list_item(face2_refs, planetag); UF_CALL(UF_MODL_create_proj_curves(curve_refs, face1_refs, along_face,proj_vector, &proj1tag)); UF_CALL(UF_MODL_create_proj_curves(curve_refs, face2_refs, not_along_face,proj_vector, &proj2tag)); } /*ARGSUSED*/ void ufusr(char *param, int *retcode, int param_len) { if (!UF_CALL(UF_initialize())) { do_ugopen_api(); UF_CALL(UF_terminate()); } } int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }
作者: jk5168    时间: 2009-1-17 17:56
亂了!

在   ug安裝目錄\UGDOC\html_files\ugopen_doc\uf_modl\uf_modl_eg16.c




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