Mesh: [skip ci] implement initial guess of cylinder axis
This commit is contained in:
@@ -1079,6 +1079,26 @@ std::vector<Base::Vector3f> MeshKernel::CalcVertexNormals() const
|
||||
return normals;
|
||||
}
|
||||
|
||||
std::vector<Base::Vector3f> MeshKernel::GetFacetNormals(const std::vector<unsigned long>& facets) const
|
||||
{
|
||||
std::vector<Base::Vector3f> normals;
|
||||
normals.reserve(facets.size());
|
||||
|
||||
for (std::vector<unsigned long>::const_iterator it = facets.begin(); it != facets.end(); ++it) {
|
||||
const MeshFacet& face = _aclFacetArray[*it];
|
||||
|
||||
const Base::Vector3f& p1 = _aclPointArray[face._aulPoints[0]];
|
||||
const Base::Vector3f& p2 = _aclPointArray[face._aulPoints[1]];
|
||||
const Base::Vector3f& p3 = _aclPointArray[face._aulPoints[2]];
|
||||
|
||||
Base::Vector3f n = (p2 - p1) % (p3 - p1);
|
||||
n.Normalize();
|
||||
normals.emplace_back(n);
|
||||
}
|
||||
|
||||
return normals;
|
||||
}
|
||||
|
||||
// Evaluation
|
||||
float MeshKernel::GetSurface() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user