zoukankan      html  css  js  c++  java
  • NX二次开发-UFUN获得两条曲线的交点UF_MODL_intersect_curve_to_curve

    NX9+VS2012
    
    #include <uf.h>
    #include <uf_ui.h>
    #include <uf_modl.h>
    #include <uf_curve.h>
    
    
    UF_initialize();
    
    //创建两条直线
    UF_CURVE_line_t Line_coords1;
    Line_coords1.start_point[0] = 0.0;
    Line_coords1.start_point[1] = 0.0;
    Line_coords1.start_point[2] = 0.0;
    Line_coords1.end_point[0] = 100.0;
    Line_coords1.end_point[1] = 0.0;
    Line_coords1.end_point[2] = 0.0;
    tag_t Line1Tag = NULL_TAG;
    UF_CURVE_create_line(&Line_coords1, &Line1Tag);
    
    UF_CURVE_line_t Line_coords2;
    Line_coords2.start_point[0] = 50.0;
    Line_coords2.start_point[1] = -50.0;
    Line_coords2.start_point[2] = 0.0;
    Line_coords2.end_point[0] = 50.0;
    Line_coords2.end_point[1] = 100.0;
    Line_coords2.end_point[2] = 0.0;
    tag_t Line2Tag = NULL_TAG;
    UF_CURVE_create_line(&Line_coords2, &Line2Tag);
    
    
    //获得两条曲线的交点
    int num_intersections = 0;
    double* data = 0;
    UF_MODL_intersect_curve_to_curve(Line1Tag, Line2Tag, &num_intersections, &data);
    
    //打印交点xyz坐标
    char msg[256];
    sprintf_s(msg, "x:%.2f,y:%.2f,z:%.2f", data[0],data[1],data[2]);
    uc1601(msg,1);
    
    //释放
    UF_free(data);
    
    UF_terminate();
    
    Caesar卢尚宇
    2020年7月5日

  • 相关阅读:
    C# winform 数据库链接
    Second easyui框架学习
    First,映射数据库到项目
    Mybatis随笔
    spring注解简单了解
    SSH Mybatis 框架
    Maven pom.xml
    Spring
    LayaBox 摄像机Unit8Array数据获取、截图
    lvs和keepalived搭建高可用性系统
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/13251483.html
Copyright © 2011-2022 走看看