Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
190b5f75
Commit
190b5f75
authored
Dec 16, 2012
by
Sauvage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
normalCycles_SortTensor
parent
cf73c21c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
include/Algo/Geometry/curvature.hpp
include/Algo/Geometry/curvature.hpp
+31
-9
No files found.
include/Algo/Geometry/curvature.hpp
View file @
190b5f75
...
@@ -317,7 +317,6 @@ void computeCurvatureVertex_NormalCycles(
...
@@ -317,7 +317,6 @@ void computeCurvatureVertex_NormalCycles(
// collect the normal cycle tensor
// collect the normal cycle tensor
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
neigh
(
map
,
position
,
radius
,
thread
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
neigh
(
map
,
position
,
radius
,
thread
)
;
// Algo::Selection::Collector_OneRing<PFP> neigh(map, thread) ;
neigh
.
collectAll
(
dart
)
;
neigh
.
collectAll
(
dart
)
;
MATRIX
tensor
(
0
)
;
MATRIX
tensor
(
0
)
;
...
@@ -329,6 +328,16 @@ void computeCurvatureVertex_NormalCycles(
...
@@ -329,6 +328,16 @@ void computeCurvatureVertex_NormalCycles(
const
MATRIX
&
evec
=
Utils
::
convertRef
<
MATRIX
>
(
solver
.
eigenvectors
());
const
MATRIX
&
evec
=
Utils
::
convertRef
<
MATRIX
>
(
solver
.
eigenvectors
());
normalCycles_SortAndSetEigenComponents
<
PFP
>
(
ev
,
evec
,
kmax
[
dart
],
kmin
[
dart
],
Kmax
[
dart
],
Kmin
[
dart
],
Knormal
[
dart
],
normal
[
dart
],
thread
);
normalCycles_SortAndSetEigenComponents
<
PFP
>
(
ev
,
evec
,
kmax
[
dart
],
kmin
[
dart
],
Kmax
[
dart
],
Kmin
[
dart
],
Knormal
[
dart
],
normal
[
dart
],
thread
);
// if (dart.index % 15000 == 0)
// {
// CGoGNout << solver.eigenvalues() << CGoGNendl;
// CGoGNout << solver.eigenvectors() << CGoGNendl;
// normalCycles_SortTensor<PFP>(tensor);
// solver.compute(Utils::convertRef<E_MATRIX>(tensor));
// CGoGNout << solver.eigenvalues() << CGoGNendl;
// CGoGNout << solver.eigenvectors() << CGoGNendl;
// }
}
}
template
<
typename
PFP
>
template
<
typename
PFP
>
...
@@ -398,12 +407,12 @@ void normalCycles_SortAndSetEigenComponents(
...
@@ -398,12 +407,12 @@ void normalCycles_SortAndSetEigenComponents(
unsigned
int
thread
=
0
)
unsigned
int
thread
=
0
)
{
{
// sort eigen components : ev[inormal] has minimal absolute value ; kmin = ev[imin] <= ev[imax] = kmax
// sort eigen components : ev[inormal] has minimal absolute value ; kmin = ev[imin] <= ev[imax] = kmax
int
inormal
=
0
,
imin
,
imax
,
tmp
;
int
inormal
=
0
,
imin
,
imax
;
if
(
abs
(
e_val
[
1
])
<
abs
(
e_val
[
inormal
]))
inormal
=
1
;
if
(
abs
(
e_val
[
1
])
<
abs
(
e_val
[
inormal
]))
inormal
=
1
;
if
(
abs
(
e_val
[
2
])
<
abs
(
e_val
[
inormal
]))
inormal
=
2
;
if
(
abs
(
e_val
[
2
])
<
abs
(
e_val
[
inormal
]))
inormal
=
2
;
imin
=
(
inormal
+
1
)
%
3
;
imin
=
(
inormal
+
1
)
%
3
;
imax
=
(
inormal
+
2
)
%
3
;
imax
=
(
inormal
+
2
)
%
3
;
if
(
e_val
[
imax
]
<
e_val
[
imin
])
{
tmp
=
imin
;
imin
=
imax
;
imax
=
tmp
;
}
if
(
e_val
[
imax
]
<
e_val
[
imin
])
{
int
tmp
=
imin
;
imin
=
imax
;
imax
=
tmp
;
}
// set curvatures from sorted eigen components
// set curvatures from sorted eigen components
// warning : Kmin and Kmax are switched w.r.t. kmin and kmax
// warning : Kmin and Kmax are switched w.r.t. kmin and kmax
...
@@ -424,7 +433,6 @@ void normalCycles_SortAndSetEigenComponents(
...
@@ -424,7 +433,6 @@ void normalCycles_SortAndSetEigenComponents(
Kmax
[
2
]
=
e_vec
(
2
,
imin
);
Kmax
[
2
]
=
e_vec
(
2
,
imin
);
}
}
/*
template
<
typename
PFP
>
template
<
typename
PFP
>
void
normalCycles_SortTensor
(
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
&
tensor
,
unsigned
int
thread
=
0
)
void
normalCycles_SortTensor
(
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
&
tensor
,
unsigned
int
thread
=
0
)
{
{
...
@@ -436,13 +444,27 @@ void normalCycles_SortTensor( Geom::Matrix<3,3,typename PFP::REAL> & tensor, uns
...
@@ -436,13 +444,27 @@ void normalCycles_SortTensor( Geom::Matrix<3,3,typename PFP::REAL> & tensor, uns
// compute eigen components
// compute eigen components
Eigen
::
SelfAdjointEigenSolver
<
E_MATRIX
>
solver
(
Utils
::
convertRef
<
E_MATRIX
>
(
tensor
));
Eigen
::
SelfAdjointEigenSolver
<
E_MATRIX
>
solver
(
Utils
::
convertRef
<
E_MATRIX
>
(
tensor
));
const VEC3& ev = Utils::convertRef<VEC3>(solver.eigenvalues());
const
VEC3
&
e_val
=
Utils
::
convertRef
<
VEC3
>
(
solver
.
eigenvalues
());
const MATRIX& evec = Utils::convertRef<MATRIX>(solver.eigenvectors());
const
MATRIX
&
e_vec
=
Utils
::
convertRef
<
MATRIX
>
(
solver
.
eigenvectors
());
// switch kmin and kmax
// switch kmin and kmax w.r.t. Kmin and Kmax
int
inormal
=
0
,
imin
,
imax
;
if
(
abs
(
e_val
[
1
])
<
abs
(
e_val
[
inormal
]))
inormal
=
1
;
if
(
abs
(
e_val
[
2
])
<
abs
(
e_val
[
inormal
]))
inormal
=
2
;
imin
=
(
inormal
+
1
)
%
3
;
imax
=
(
inormal
+
2
)
%
3
;
if
(
e_val
[
imax
]
<
e_val
[
imin
])
{
int
tmp
=
imin
;
imin
=
imax
;
imax
=
tmp
;
}
tensor
=
e_vec
;
int
i
;
REAL
v
;
i
=
inormal
;
v
=
e_val
[
inormal
];
tensor
(
0
,
i
)
*=
v
;
tensor
(
1
,
i
)
*=
v
;
tensor
(
2
,
i
)
*=
v
;
i
=
imin
;
v
=
e_val
[
imax
];
tensor
(
0
,
i
)
*=
v
;
tensor
(
1
,
i
)
*=
v
;
tensor
(
2
,
i
)
*=
v
;
i
=
imax
;
v
=
e_val
[
imin
];
tensor
(
0
,
i
)
*=
v
;
tensor
(
1
,
i
)
*=
v
;
tensor
(
2
,
i
)
*=
v
;
tensor
=
tensor
*
e_vec
.
transposed
();
}
}
*/
namespace
Parallel
namespace
Parallel
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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