Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
9d4f77b6
Commit
9d4f77b6
authored
Dec 01, 2012
by
Sauvage
Browse files
amélioration du code EdgeSelector_NormalArea
parent
4ed93813
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Algo/Decimation/edgeSelector.h
View file @
9d4f77b6
...
...
@@ -32,6 +32,7 @@
#include
"Utils/qem.h"
#include
"Utils/quadricRGBfunctions.h"
#include
"Algo/Geometry/curvature.h"
#include
"Algo/Geometry/area.h"
namespace
CGoGN
{
...
...
@@ -297,6 +298,7 @@ private:
void
initEdgeInfo
(
Dart
d
)
;
void
updateEdgeInfo
(
Dart
d
)
;
void
computeEdgeInfo
(
Dart
d
,
EdgeInfo
&
einfo
)
;
void
computeEdgeMatrix
(
Dart
d
)
;
// void recomputeQuadric(const Dart d, const bool recomputeNeighbors = false) ;
public:
...
...
include/Algo/Decimation/edgeSelector.hpp
View file @
9d4f77b6
...
...
@@ -795,10 +795,11 @@ bool EdgeSelector_NormalArea<PFP>::init()
TraversorE
<
MAP
>
travE
(
m
);
for
(
Dart
dit
=
travE
.
begin
()
;
dit
!=
travE
.
end
()
;
dit
=
travE
.
next
())
{
const
VEC3
e
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
m
,
dit
,
this
->
m_position
)
;
edgeMatrix
[
dit
].
identity
();
edgeMatrix
[
dit
]
*=
e
.
norm2
();
edgeMatrix
[
dit
]
-=
Geom
::
transposed_vectors_mult
(
e
,
e
)
;
computeEdgeMatrix
(
dit
);
// const VEC3 e = Algo::Geometry::vectorOutOfDart<PFP>(m, dit, this->m_position) ;
// edgeMatrix[dit].identity();
// edgeMatrix[dit] *= e.norm2();
// edgeMatrix[dit] -= Geom::transposed_vectors_mult(e,e) ;
}
for
(
Dart
dit
=
travE
.
begin
()
;
dit
!=
travE
.
end
()
;
dit
=
travE
.
next
())
...
...
@@ -874,10 +875,7 @@ void EdgeSelector_NormalArea<PFP>::updateAfterCollapse(Dart d2, Dart dd2)
Traversor2VE
<
MAP
>
te
(
m
,
d2
);
for
(
Dart
dit
=
te
.
begin
()
;
dit
!=
te
.
end
()
;
dit
=
te
.
next
())
{
const
VEC3
e
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
m
,
dit
,
this
->
m_position
)
;
edgeMatrix
[
dit
].
identity
();
edgeMatrix
[
dit
]
*=
e
.
norm2
();
edgeMatrix
[
dit
]
-=
Geom
::
transposed_vectors_mult
(
e
,
e
)
;
computeEdgeMatrix
(
dit
);
}
// update the multimap
...
...
@@ -968,10 +966,35 @@ void EdgeSelector_NormalArea<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
REAL
err
=
av1
*
(
M1
*
av1
)
+
av2
*
(
M2
*
av2
);
/*
// TODO : test to normalize by area
// TODO : not border-safe
REAL area = 0.0;
Traversor2EEaV<MAP> ta (m,d);
for (Dart dita = ta.begin(); dita != ta.end(); dita=ta.next())
{
area += Algo::Geometry::triangleArea<PFP>(m,dita,this->m_position);
}
err /= area ; // résultats sensiblment identiques à ceux sans pris en compte de l'aire.
// err /= area*area ; // ca favorise la contraction des gros triangles : maillages très in-homogènes et qualité géométrique mauvaise
*/
einfo
.
it
=
edges
.
insert
(
std
::
make_pair
(
err
,
d
))
;
einfo
.
valid
=
true
;
}
template
<
typename
PFP
>
void
EdgeSelector_NormalArea
<
PFP
>::
computeEdgeMatrix
(
Dart
d
)
{
const
VEC3
e
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
this
->
m_map
,
d
,
this
->
m_position
)
;
edgeMatrix
[
d
].
identity
();
edgeMatrix
[
d
]
*=
e
.
norm2
();
edgeMatrix
[
d
]
-=
Geom
::
transposed_vectors_mult
(
e
,
e
)
;
// TODO : test : try to normalize by area
// edgeMatrix[d] /= e.norm2(); // pas d'amélioration significative par rapport à la version sans normalisation
// edgeMatrix[d] /= e.norm2() * e.norm2(); // étonnament bon : sur certains maillages équivalant à la QEMml
}
/************************************************************************************
* CURVATURE *
************************************************************************************/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment