【NX二次开发】分析曲线某位置的信息 UF_MODL_ask_curve_props

分析曲线某位置的信息:点、切线、主副法线、半径等

extern DllExport void ufsta(char *param, int *returnCode, int rlen)
{
    UF_initialize();
    //UF_MODL_ask_curve_props 
    tag_t tagCurveId = 51693;
    double parm = 0.5;
    double point[3];
    double tangent[3];
    double p_norm[3];
    double b_norm[3];
    double  torsion;
    double  rad_of_cur;
    UF_MODL_ask_curve_props(tagCurveId, parm, point, tangent, p_norm, b_norm, &torsion, &rad_of_cur);
    //point 点
    tag_t tagPoint;
    UF_CURVE_create_point(point, &tagPoint);
    //tangent 切线;   切线 主法线 副法线两两垂直
    UF_CURVE_line_t linePoint;
    tag_t tagLine;
    UF_VEC3_copy(point,linePoint.start_point);
    linePoint.end_point[0] = point[0] + tangent[0];
    linePoint.end_point[1] = point[1] + tangent[1];
    linePoint.end_point[2] = point[2] + tangent[2];
    UF_CURVE_create_line(&linePoint, &tagLine);
    //p_norm 单位主法线
    UF_VEC3_copy(point, linePoint.start_point);
    linePoint.end_point[0] = point[0] + p_norm[0];
    linePoint.end_point[1] = point[1] + p_norm[1];
    linePoint.end_point[2] = point[2] + p_norm[2];
    UF_CURVE_create_line(&linePoint, &tagLine);
    //b_norm 单位副法线
    UF_VEC3_copy(point, linePoint.start_point);
    linePoint.end_point[0] = point[0] + b_norm[0];
    linePoint.end_point[1] = point[1] + b_norm[1];
    linePoint.end_point[2] = point[2] + b_norm[2];
    UF_CURVE_create_line(&linePoint, &tagLine);

    //扭转? torsion
    //半径   rad_of_cur

    UF_terminate();
}

extern int ufusr_ask_unload(void)
{
    return (UF_UNLOAD_IMMEDIATELY);
}

效果:

 

posted @ 2020-09-30 14:34  王牌飞行员_里海  阅读(545)  评论(0编辑  收藏  举报