added parameters in GetPolyTemplatePos to force isotropy
This commit is contained in:
parent
a974f13258
commit
d8a7e0069f
|
@ -412,7 +412,9 @@ void getBaseTemplatePolygon(int N,
|
|||
//described by "Static Aware Grid Shells" by Pietroni et Al.
|
||||
template<class PolygonType>
|
||||
void GetPolyTemplatePos(const PolygonType &F,
|
||||
std::vector<typename PolygonType::CoordType> &TemplatePos)
|
||||
std::vector<typename PolygonType::CoordType> &TemplatePos,
|
||||
typename PolygonType::ScalarType TargetArea=-1,
|
||||
bool force_isotropy=false)
|
||||
{
|
||||
typedef typename PolygonType::FaceType FaceType;
|
||||
typedef typename PolygonType::CoordType CoordType;
|
||||
|
@ -433,6 +435,13 @@ void GetPolyTemplatePos(const PolygonType &F,
|
|||
CoordType dirY=PCA[1];
|
||||
CoordType dirZ=PCA[2];
|
||||
|
||||
if (force_isotropy)
|
||||
{
|
||||
dirX.Normalize();
|
||||
dirY.Normalize();
|
||||
dirZ.Normalize();
|
||||
}
|
||||
|
||||
///set the Rotation matrix
|
||||
ToPCA.SetColumn(0,dirX);
|
||||
ToPCA.SetColumn(1,dirY);
|
||||
|
@ -455,6 +464,11 @@ void GetPolyTemplatePos(const PolygonType &F,
|
|||
ScalarType AreaTemplate=Area(TemplatePos);
|
||||
ScalarType AreaUniform=Area(UniformPos);
|
||||
|
||||
// if (TargetArea>0)
|
||||
// {
|
||||
// AreaUniform*=(AreaUniform/TargetArea);
|
||||
// }
|
||||
|
||||
ScalarType Scale=sqrt(AreaTemplate/AreaUniform);
|
||||
|
||||
for (size_t i=0;i<UniformPos.size();i++)
|
||||
|
|
Loading…
Reference in New Issue