zoukankan      html  css  js  c++  java
  • 【NX二次开发】拉伸的偏置方向猜想与验证

     结论:偏置的方向为曲线方向与拉伸方向的向量叉乘。


    在UF_MODL_create_extrusion帮助中有这么一句话:Note that the offset direction is determined by the cross product of the direction vector of the first profile segment and the extrusion direction vector.偏移方向由“第一剖面段的方向向量”和“拉伸方向向量”的叉积决定。

    猜想一下:

     向量叉乘的右手定则:

     

    验证1:

     

     验证2:

      

     验证3:

      

      

     测试源码:

    //拉伸生成片体 UF_MODL_ask_extrusion
    extern DllExport void ufusr(char *param, int *returnCode, int rlen)
    {
        UF_initialize();
        uc1601("拉伸", 1);
        //tag_t tagLine = 45256;
        tag_t tagLine = 45950;
    
        double douAngle = 0.0;
        char cTaperAngle[256] = "";
        sprintf(cTaperAngle, "%f", douAngle);
    
        double douLimit0 = 0.0;
        double douLimit1 = 10.0;
        char Limit0[256] = "";
        sprintf(Limit0, "%f", douLimit0);
        char Limit1[256] = "";
        sprintf(Limit1, "%f", douLimit1);
    
        tag_t objects[1] = { tagLine };
        int object_count = 1;
        char *taper_angle = cTaperAngle;
        char *Limit[2] = { Limit0,Limit1 };
        char * offsets[2] = { "20","0" }; 
        double Point2[3] = { 0.0, 0.0, 0.0 };
        double douDir[3] = { 0.0, 0.0, 1.0 };//拉伸方向
        UF_FEATURE_SIGN Sign1 = UF_NULLSIGN;
        tag_t *outObjects = NULL;
        int iFeaturesCount = 0;
        UF_MODL_create_extrusion(objects, object_count, NULL, taper_angle, Limit, offsets, Point2, false, false, douDir, Sign1, &outObjects, &iFeaturesCount);
    
        UF_terminate();
    }
    
    extern int ufusr_ask_unload(void)
    {
        return (UF_UNLOAD_IMMEDIATELY);
    }
  • 相关阅读:
    error: readline/readline.h: No such file or directory
    ImportError: No module named setuptools
    ImportError: No module named argparse
    为python安装pip
    yum源安装配置
    n元一维向量向左循环移位i的几种算法
    以空间换时间编程策略的细节问题以及解决方案
    Hash(散列函数)简单应用引出解决散列冲突的四种方法
    随机取样
    排序问题
  • 原文地址:https://www.cnblogs.com/KMould/p/14312795.html
Copyright © 2011-2022 走看看