Skip to content

Refactor FillHoles metrics#287

Merged
Fedr merged 4 commits intomasterfrom
Refactor_FillHoles_metrics
Jul 19, 2022
Merged

Refactor FillHoles metrics#287
Fedr merged 4 commits intomasterfrom
Refactor_FillHoles_metrics

Conversation

@Grantim
Copy link
Contributor

@Grantim Grantim commented Jul 19, 2022

No description provided.

@Grantim Grantim requested a review from Fedr July 19, 2022 13:33
/// 0.0
MRMESH_API virtual double getEdgeMetric( const VertId&, const VertId&, const VertId&, const VertId& ) const override;
};
/// This struct provides complex metric which fines new triangles for: \n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct->function, fines->penalizes

Grant Karapetyan added 2 commits July 19, 2022 18:36

/// computes dihedral angle between leftNorm and rightNorm, with sign
template <typename T>
T dihedralAngle( const Vector3<T>& leftNorm, const Vector3<T>& rightNorm, const Vector3<T>& edgeVec );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better put in MRTriMath.h

}

constexpr int maxStepsNum = 20;
constexpr int maxStepsNum = 100;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we change it now? It is worth converting it in a parameter later.

if ( metrics.triangleMetric )
{
auto triMetric = metrics.triangleMetric( aVert, topology.org( loop[v] ), bVert );
weight = metrics.combineMetric( weight, triMetric );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we support if (!combineMetric)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metrics.combineMetric and one of metrics.edgeMetric metrics.triangleMetric are always set

Vector3d bP = Vector3d( mesh.points[b] );
Vector3d cP = Vector3d( mesh.points[c] );
if ( dot( norm, cross( bP - aP, cP - aP ) ) < 0.0 )
return BadTriangulationMetric; // DBL_MAX break any triangulation, just return big value to be allow some bad meshes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be allow -> to allow

// Big value, but less then DBL_MAX, to be able to pass some bad triangulations instead of breaking it
constexpr double BadTriangulationMetric = 1e100;
// This constant modifier was born empirically
constexpr double TriangleAreaModifier = 1e2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it appear only now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was moved from MRE fill hole metrics (they were moved to this files)

@Fedr Fedr merged commit 6a3b099 into master Jul 19, 2022
@Fedr Fedr deleted the Refactor_FillHoles_metrics branch July 19, 2022 16:00
gzubova-sdc pushed a commit that referenced this pull request Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants