• PK获取面积


    BOOL PK_AskFaceAreas(tag_t face_tag, double tol, double &areas)
    {//获得面积
        tag_t      ps_tag = NULL_TAG;
        double     amount[3] = { 0.0, 0.0, 0.0 };
        double     mass[3] = { 0.0, 0.0, 0.0 };
        double     c_of_g[3] = { 0.0, 0.0, 0.0 };
        double     m_of_i[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
        double       periphery[3] = { 0.0, 0.0, 0.0 };
        PK_FACE_t  pkFace = 0;
        PK_TOPOL_eval_mass_props_o_t props_o_t;
    
        areas = 0.0;
        if (NULL_TAG == face_tag
            || UF_PS_ask_ps_tag_of_object(face_tag, &ps_tag))
            return FALSE;
        pkFace = ps_tag;
        if (tol < 0.99)
            tol = 0.99;
        if (tol > 1.0)
            tol = 1.0;
        PK_TOPOL_eval_mass_props_o_m(props_o_t);
        props_o_t.mass = PK_mass_c_of_g_c;
        PK_TOPOL_eval_mass_props(1, &pkFace, tol, &props_o_t, amount, mass, c_of_g, m_of_i, periphery);
        areas = amount[0] * 1000.0 * 1000.0;
        return TRUE;
    }
    
    BOOL PK_AskFaceAreas(CUIntArray &tFaceTags, double tol, double &areas)
    {//获得面积
        int        i = 0;
        tag_t      ps_tag = NULL_TAG;
        double     amount[3] = { 0.0, 0.0, 0.0 };
        double     mass[3] = { 0.0, 0.0, 0.0 };
        double     c_of_g[3] = { 0.0, 0.0, 0.0 };
        double     m_of_i[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
        double       periphery[3] = { 0.0, 0.0, 0.0 };
        PK_FACE_t  *pkFaces = NULL;
        CUIntArray temps;
        PK_TOPOL_eval_mass_props_o_t props_o_t;
    
        areas = 0.0;
        if (0 == tFaceTags.GetSize())
            return FALSE;
        for (i = 0; i < tFaceTags.GetSize(); i++)
        {
            if (!UF_PS_ask_ps_tag_of_object(tFaceTags[i], &ps_tag))
            {
                temps.Add(ps_tag);
            }
        }
        if (0 == temps.GetSize())
            return FALSE;
        pkFaces = new PK_FACE_t[temps.GetSize()];
        for (i = 0; i < temps.GetSize(); i++)
        {
            pkFaces[i] = temps[i];
        }
        if (tol < 0.99)
            tol = 0.99;
        if (tol > 1.0)
            tol = 1.0;
        PK_TOPOL_eval_mass_props_o_m(props_o_t);
        props_o_t.mass = PK_mass_c_of_g_c;
        PK_TOPOL_eval_mass_props(temps.GetSize(), pkFaces, tol, &props_o_t, amount, mass, c_of_g, m_of_i, periphery);
        areas = amount[0] * 1000.0 * 1000.0;
        delete pkFaces;
        pkFaces = NULL;
        return TRUE;
    }


    ————————————————
    版权声明:本文为CSDN博主「梅雷」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/raley66/article/details/100764229

  • 相关阅读:
    第二次作业——结对项目之需求分析与原型模型设计
    第三次作业——结对编程
    采用PowerDesigner 设计数据库
    关于Android开发环境的演变
    广东地区DNS再次瘫痪
    SQL Server 2005 TSQL 中的OUTPUT子句语法
    Visual Studio 里的版本兼容问题
    Javascript 对象扩展积累
    IBatisNet.DataMapper 升级到 1.6.2 之后报错
    ExtJs Extender controls 不错的例子
  • 原文地址:https://www.cnblogs.com/liuxiaoqing1/p/15840832.html
Copyright © 2020-2023  润新知