zoukankan      html  css  js  c++  java
  • NX二次开发-UFUN求两个对象最短距离UF_MODL_ask_minimum_dist

     1     NX9+VS2012
     2     
     3     #include <uf.h>
     4     #include <uf_modl.h>
     5     #include <uf_ui.h>
     6 
     7     UF_initialize();
     8 
     9     //创建点1
    10     double PointCoords1[3] = {125.5, 263.2, 135.2};
    11     tag_t Point1Tag = NULL_TAG;
    12     UF_CURVE_create_point(PointCoords1, &Point1Tag);
    13 
    14     //创建点2
    15     double PointCoords2[3] = {65.5, 95.6, 78.6};
    16     tag_t Point2Tag = NULL_TAG;
    17     UF_CURVE_create_point(PointCoords2, &Point2Tag);
    18 
    19     //求两个对象的最短距离
    20     double Guess1[3];
    21     double Guess2[3];
    22     double MinDist;
    23     double PtOnObj1[3];
    24     double PtOnObj2[3];
    25     UF_MODL_ask_minimum_dist(Point1Tag, Point2Tag, 0, Guess1, 0, Guess2, &MinDist, PtOnObj1, PtOnObj2);
    26 
    27     //打印
    28     char msg[256];
    29     sprintf(msg, "%f", MinDist);
    30     UF_UI_open_listing_window();
    31     UF_UI_write_listing_window(msg);
    32 
    33     UF_terminate();

  • 相关阅读:
    最小路径
    零钱兑换
    硬币
    三步问题
    区域和检索
    除数博弈
    URI和URL的辨别
    交叉编译OpenMP
    牛客挑战赛44D-数列的和
    CF1408H. Rainbow Triples
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/10975886.html
Copyright © 2011-2022 走看看