首页 > 其他分享 >查询点集中到指定面最近的点

查询点集中到指定面最近的点

时间:2023-02-22 11:14:49浏览次数:32  
标签:dist 0.0 tag 指定 double 最近 deltaDist minDistFace 查询

// 查询点集中到指定面最近的点
static tag_t GetMinDistPoint(tag_t face, std::vector<tag_t>& points)
{
double dist = DBL_MAX;
double faceCenter[3] = { 0.0, 0.0, 0.0 };
GetFaceCenter(face, faceCenter);
tag_t minDistFace = NULL_TAG;

for (const auto& it : points)
{
double deltaDist = 0.0;
double pointCoord[3] = { 0.0, 0.0, 0.0 };
UF_CURVE_ask_point_data(it, pointCoord);
UF_VEC3_distance(faceCenter, pointCoord, &deltaDist);
if (deltaDist - dist < -0.001)
{
dist = deltaDist;
minDistFace = it;
}
}
return minDistFace;
}

标签:dist,0.0,tag,指定,double,最近,deltaDist,minDistFace,查询
From: https://www.cnblogs.com/firetuo/p/17143625.html

相关文章