当前位置: 首页 > news >正文

视频搜索网站建设微信小程序模板免费下载

视频搜索网站建设,微信小程序模板免费下载,大型网站系统解决方案,跨境电商的网络营销方式一、概述 最近体验许多外挂#xff0c;包括胡波外挂、星空外挂及模圣等都有抽取面的中心线#xff0c;由于刚刚学习#xff0c;我尝试看看能不能做出来#xff0c;本博客代码没有封装函数#xff0c;代码有待改进#xff0c;但基本可以实现相应的功能。 二、案例实现的功…一、概述 最近体验许多外挂包括胡波外挂、星空外挂及模圣等都有抽取面的中心线由于刚刚学习我尝试看看能不能做出来本博客代码没有封装函数代码有待改进但基本可以实现相应的功能。 二、案例实现的功能 1、可以抽取平面的中心线主要利用面上的UV线 2、可以抽取柱面的中心线这里方法有很多我的思路是识别柱面上的两个圆弧获得两段圆弧的中心坐标然后连线。 3、适用范围目前有三类 图1 平面类型 图2 圆柱面类型 图3 标准圆弧类型 非标准圆弧类型目前只想到用抽取虚拟曲线来实现下一篇博客写 三、代码说明以及详细注解 //NXOpen_CreateFaceCentreLine// Mandatory UF Includes #include uf.h #include uf_object_types.h// Internal Includes #include NXOpen/ListingWindow.hxx #include NXOpen/NXMessageBox.hxx #include NXOpen/UI.hxx// InternalExternal Includes #include NXOpen/Annotations.hxx #include NXOpen/Assemblies_Component.hxx #include NXOpen/Assemblies_ComponentAssembly.hxx #include NXOpen/Body.hxx #include NXOpen/BodyCollection.hxx #include NXOpen/Face.hxx #include NXOpen/Line.hxx #include NXOpen/NXException.hxx #include NXOpen/NXObject.hxx #include NXOpen/Part.hxx #include NXOpen/PartCollection.hxx #include NXOpen/Session.hxx// Std C Includes #include iostream #include sstream//用户定义 #include uf_all.h #include vector using namespace NXOpen; using std::string; using std::exception; using std::stringstream; using std::endl; using std::cout; using std::cerr;static int init_proc(UF_UI_selection_p_t select, void *user_data) {int errorCode 0;int num_triples 1; //选择类型 数量UF_UI_mask_t mask_triples[1] { { UF_face_type , 0,0 } //定义选择面类型};errorCode UF_UI_set_sel_mask(select,UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,num_triples,mask_triples);if (errorCode 0){return UF_UI_SEL_SUCCESS;}else{return UF_UI_SEL_FAILURE;} } //------------------------------------------------------------------------------ // NXOpen c test class //------------------------------------------------------------------------------ class MyClass {// class members public:static Session *theSession;static UI *theUI;MyClass();~MyClass();void do_it();void print(const NXString );void print(const string );void print(const char*);private:BasePart *workPart, *displayPart;NXMessageBox *mb;ListingWindow *lw;LogFile *lf; };//------------------------------------------------------------------------------ // Initialize static variables //------------------------------------------------------------------------------ Session *(MyClass::theSession) NULL; UI *(MyClass::theUI) NULL;//------------------------------------------------------------------------------ // Constructor //------------------------------------------------------------------------------ MyClass::MyClass() {// Initialize the NX Open C API environmentMyClass::theSession NXOpen::Session::GetSession();MyClass::theUI UI::GetUI();mb theUI-NXMessageBox();lw theSession-ListingWindow();lf theSession-LogFile();workPart theSession-Parts()-BaseWork();displayPart theSession-Parts()-BaseDisplay();}//------------------------------------------------------------------------------ // Destructor //------------------------------------------------------------------------------ MyClass::~MyClass() { }//------------------------------------------------------------------------------ // Print string to listing window or stdout //------------------------------------------------------------------------------ void MyClass::print(const NXString msg) {if(! lw-IsOpen() ) lw-Open();lw-WriteLine(msg); } void MyClass::print(const string msg) {if(! lw-IsOpen() ) lw-Open();lw-WriteLine(msg); } void MyClass::print(const char * msg) {if(! lw-IsOpen() ) lw-Open();lw-WriteLine(msg); }//------------------------------------------------------------------------------ // Do something //------------------------------------------------------------------------------ void MyClass::do_it() {// TODO: add your code hereL10:// TODO: add your code hereint response 0;tag_t object NULL_TAG;double cursor[3];tag_t view NULL_TAG;UF_UI_select_with_single_dialog(提示请选择面, 选择面, UF_UI_SEL_SCOPE_WORK_PART, init_proc, NULL, response, object, cursor, view);if (response UF_UI_OK || response UF_UI_OBJECT_SELECTED || response UF_UI_OBJECT_SELECTED_BY_NAME){UF_DISP_set_highlight(object, 0);//判断面的类型int faceType 0;UF_MODL_ask_face_type(object, faceType);if (faceType UF_MODL_CYLINDRICAL_FACE){//面找边uf_list_p_t list;tag_t edge1Tag NULL_TAG;tag_t edge1Tag2 NULL_TAG;UF_CURVE_line_t line1;tag_t line1TAG NULL_TAG;int count 0;UF_MODL_ask_face_edges(object, list);//得到面的边UF_MODL_ask_list_count(list, count);//查询链表数量std::vectortag_t edgeTAG;for (int j 0; j count; j){UF_MODL_ask_list_item(list, j, edge1Tag);//得到边的tag//判断边的类型int edge_type;UF_MODL_ask_edge_type(edge1Tag, edge_type);if (edge_type UF_MODL_CIRCULAR_EDGE){/*****************************************UF_MODL_LINEAR_EDGE 线性边UF_MODL_CIRCULAR_EDGE 圆形边UF_MODL_ELLIPTICAL_EDGE 椭圆形边 UF_MODL_INTERSECTION_EDGE 相交边UF_MODL_SPLINE_EDGE 样条边UF_MODL_SP_CURVE_EDGE 曲线边UF_MODL_FOREIGN_EDGE 外边缘UF_MODL_CONST_PARAMETER_EDGE 参数边UF_MODL_TRIMMED_CURVE_EDGE 裁剪曲线边******************************************/edgeTAG.push_back(edge1Tag);} if (edgeTAG.size() 2){//UF_CURVE_ask_centroid(edgeTAG[0], centroid1);//得到第一条边的中心坐标//UF_CURVE_ask_centroid(edgeTAG[1], centroid2);//得到第二条边的中心坐标UF_CURVE_arc_t arc_coords1, arc_coords2;UF_CURVE_ask_arc_data(edgeTAG[0], arc_coords1);UF_CURVE_ask_arc_data(edgeTAG[1], arc_coords2);double douMatrixValue1[9];UF_CSYS_ask_matrix_values(arc_coords1.matrix_tag, douMatrixValue1);double douPoint1[3];UF_MTX3_vec_multiply_t(arc_coords1.arc_center, douMatrixValue1, douPoint1);double douMatrixValue2[9];UF_CSYS_ask_matrix_values(arc_coords2.matrix_tag, douMatrixValue2);double douPoint2[3];UF_MTX3_vec_multiply_t(arc_coords2.arc_center, douMatrixValue2, douPoint2);//画直线line1.start_point[0] douPoint1[0];line1.start_point[1] douPoint1[1];line1.start_point[2] douPoint1[2];line1.end_point[0] douPoint2[0];line1.end_point[1] douPoint2[1];line1.end_point[2] douPoint2[2];UF_CURVE_create_line(line1, line1TAG);UF_OBJ_set_color(line1TAG, 186);UF_OBJ_set_font(line1TAG, UF_OBJ_FONT_CENTERLINE);//移动放置图层UF_OBJ_set_layer(line1TAG, 5); }}UF_free(list);goto L10;}else if (faceType UF_MODL_PLANAR_FACE){double uv_min_max1[4];UF_MODL_ask_face_uv_minmax(object, uv_min_max1);double parameter1 (uv_min_max1[0] uv_min_max1[1]) / 2;double parameter2 (uv_min_max1[2] uv_min_max1[3]) / 2;tag_t * isocurve_id1, *isocurve_id2;int isocurve_cnt1 0;int isocurve_cnt2 0;UF_MODL_create_isocurve(object, 1, parameter1, 0.01, isocurve_id1, isocurve_cnt1);UF_MODL_create_isocurve(object, 2, parameter2, 0.01, isocurve_id2, isocurve_cnt2);UF_OBJ_set_color(isocurve_id1[0], 186);UF_OBJ_set_color(isocurve_id2[0], 186);UF_OBJ_set_font(isocurve_id1[0], UF_OBJ_FONT_CENTERLINE);UF_OBJ_set_font(isocurve_id2[0], UF_OBJ_FONT_CENTERLINE);//移动放置图层UF_OBJ_set_layer(isocurve_id1[0], 5);UF_OBJ_set_layer(isocurve_id2[0], 5);UF_free(isocurve_id1);UF_free(isocurve_id2);double param[2] { 0 };param[0] parameter1;param[1] parameter2;double point[3] { 0 };double u1[3] { 0 };double v1[3] { 0 };double u2[3] { 0 };double v2[3] { 0 };double unit_norm[3] { 0 };double radii[2] { 0 };UF_MODL_ask_face_props(object, param, point, u1, v1, u2, v2, unit_norm, radii);tag_t facePoint;UF_CURVE_create_point(point, facePoint);goto L10;}else{uc1601(请正确选择面, 1);goto L10;}} }//------------------------------------------------------------------------------ // Entry point(s) for unmanaged internal NXOpen C/C programs //------------------------------------------------------------------------------ // Explicit Execution extern C DllExport void ufusr( char *parm, int *returnCode, int rlen ) {UF_initialize();try{// Create NXOpen C class instanceMyClass *theMyClass;theMyClass new MyClass();theMyClass-do_it();delete theMyClass;}catch (const NXException e1){UI::GetUI()-NXMessageBox()-Show(NXException, NXOpen::NXMessageBox::DialogTypeError, e1.Message());}catch (const exception e2){UI::GetUI()-NXMessageBox()-Show(Exception, NXOpen::NXMessageBox::DialogTypeError, e2.what());}catch (...){UI::GetUI()-NXMessageBox()-Show(Exception, NXOpen::NXMessageBox::DialogTypeError, Unknown Exception.);}UF_terminate(); }//------------------------------------------------------------------------------ // Unload Handler //------------------------------------------------------------------------------ extern C DllExport int ufusr_ask_unload() {return (int)NXOpen::Session::LibraryUnloadOptionImmediately; }
http://www.pierceye.com/news/351964/

相关文章:

  • 企业网站的布局类型网站移动页面怎么做的
  • 人是用什么做的视频网站吗wordpress如何设水印图片
  • 蛋糕店的网站建设咋写深圳市宝安区邮政编码
  • 东莞横沥网站建设杭州网站制作排名
  • 百合怎么做网站网站开发语
  • 网站搭建哪里找最好天津市建设工程信息网站
  • 有免费注册网站吗做教育网站还挣钱吗
  • 网站做百度推广需要哪些条件店铺推广软文范例
  • 台州企业网站搭建特点迅美网站建设
  • 做营销网站推广官方网站建设方法
  • 网页设计精选网站网站查询功能怎么做
  • 重庆专业网站推广流程建立平台的步骤
  • 舟山市普陀区建设局网站net网站开发 兼职
  • 网站备案流程阿里云南宁网站建设官网
  • h5网站制作介绍简单的静态 新闻 asp 网站源码
  • 济南seo网站推广公司帮别人做彩票网站吗
  • 郑州市网站建设怎么样wordpress wp editor
  • 台州网站建设 推广公司网络营销课程总结范文
  • 网站 外包 版权杭州做官网的有哪些公司
  • 微信网站html5中山平面设计公司
  • 建站网站教程视频世界网站排名
  • 做小程序的流程seo 整站优化
  • 网站前台代码国内网站主机
  • 网站后台asp源码高明顺德网站建设
  • 网站建设推广软文网络规划设计师考试全程指导(第2版) pdf
  • 备案网站多少钱支持wordpress的空间
  • 哈尔滨网页模板建站wordpress网页设定
  • 哔哩哔哩网站怎么做视频软件进入公众号会不会泄露个人信息
  • 域名过期做的网站怎么办wap网站前景
  • 网站设计公司 宁波少儿编程课