|
|
|
|
@ -5714,7 +5714,8 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
@@ -5714,7 +5714,8 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果夹角小于45度(cos(45°) ≈ 0.7071),则计入覆盖
|
|
|
|
|
float fAngleThreshold = 0.7071; // 0.7071f
|
|
|
|
|
float fAngleThreshold1 = 0.671; // 0.7071f
|
|
|
|
|
float fAngleThreshold2 = 0.8071; // 0.7071f
|
|
|
|
|
|
|
|
|
|
// 初始化数据结构
|
|
|
|
|
std::vector<bool> processedFaces(faces.size(), false); |
|
|
|
|
@ -5796,10 +5797,15 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
@@ -5796,10 +5797,15 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
|
|
|
|
|
const Normal& faceNormal = scene.mesh.faceNormals[idxFace]; |
|
|
|
|
const float cosAngle = cameraForward.dot(Point3f(faceNormal.x, faceNormal.y, faceNormal.z)); |
|
|
|
|
|
|
|
|
|
if (cosAngle > fAngleThreshold) |
|
|
|
|
{ // 45度阈值
|
|
|
|
|
if (cosAngle > fAngleThreshold2) |
|
|
|
|
{ |
|
|
|
|
coverageCount++; |
|
|
|
|
|
|
|
|
|
// viewData.faceToIndexMap[idxFace] = idxFace;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (cosAngle > fAngleThreshold1) |
|
|
|
|
{ |
|
|
|
|
viewData.faceToIndexMap[idxFace] = idxFace; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -6006,13 +6012,14 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
@@ -6006,13 +6012,14 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
|
|
|
|
|
|
|
|
|
|
IIndexArr filteredCams; |
|
|
|
|
|
|
|
|
|
int nHitCount = 0; |
|
|
|
|
int nMaxHit = 400; |
|
|
|
|
int nMaxViewCoverage = 0; |
|
|
|
|
int nHit = 0; |
|
|
|
|
int nHitMax = 1; |
|
|
|
|
int nViewCoverage = 0; |
|
|
|
|
int nViewCoverageMax = -1; |
|
|
|
|
for (const auto& [viewIdx, coverageCount] : viewCoverage) { |
|
|
|
|
if (nMaxViewCoverage>12) |
|
|
|
|
if (nHitCount>nMaxHit) |
|
|
|
|
break; |
|
|
|
|
if (nViewCoverage>=nViewCoverageMax) |
|
|
|
|
// if (nHit>nHitMax)
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
auto it_view = mapViewCoverageData.find(viewIdx); |
|
|
|
|
if (it_view == mapViewCoverageData.end()) { |
|
|
|
|
@ -6047,14 +6054,14 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
@@ -6047,14 +6054,14 @@ bool MeshTexture::CreateVirtualFaces64(FaceDataViewArr& facesDatas, FaceDataView
|
|
|
|
|
if (!scene.is_face_delete_edge2(strName, virtualFaceCenterFaceID)) |
|
|
|
|
{ |
|
|
|
|
filteredCams.push_back(viewIdx); |
|
|
|
|
++nHitCount; |
|
|
|
|
++nHit; |
|
|
|
|
|
|
|
|
|
if (nHitCount>nMaxHit) |
|
|
|
|
break; |
|
|
|
|
// if (nHit>=nHitMax)
|
|
|
|
|
// break;
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
++nMaxViewCoverage; |
|
|
|
|
++nViewCoverage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (filteredCams.empty()) { |
|
|
|
|
|