PK获取面积
2024-10-21 13:02:04
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
最新文章
- js Date学习
- BIEE 11g 安装
- Longest Common Subsequence (LCS)
- 包装类(Wrapper Class)
- 【HDOJ】【1512】Monkey King
- Java SE ---数据类型
- Java [leetcode 34]Search for a Range
- rmi 与 远程代理复习
- poj3233之经典矩阵乘法
- Java Swing 日期控件(转载)
- bzoj1176: [Balkan2007]Mokia【cdq分治】
- Object-Relational Structural Patterns
- 常用的 css reset,基本的base.css
- 回收 PV - 每天5分钟玩转 Docker 容器技术(152)
- iOS中 UIToolBar 技术分享
- 【Idea】好的插件集合,持续更新
- 插入mysql失败,因为java数据类型是个实体类,加上.id就好了
- OO第一单元总结
- 归并排序python实现
- 《React Native 精解与实战》书籍连载「React 与 React Native 简介」
热门文章
- vue3 | shallowReactive 、shallowRef、triggerRef
- eigen的简单用法汇总
- 微信小程序项目中使用icon图标
- 【USACO 2021 US Open, Platinum】United Cows of Farmer John
- PDO使用返回结果集的方法输出数据库里面的单个值
- 操作系统复习(updating)
- nodejs npm错误Error:UNKNOWN:unknown error,mkdir &#39;D:\Develop\nodejs\node_global&#39;at Error(可行)
- 使用Shapefile C Library读取shp文件并使用OpenGL绘制
- K8S 1.20 弃用 Docker 评估之 Docker 和 OCI 镜像格式的差别
- pat乙级1023 组个最小数