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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
5f822d8a
Commit
5f822d8a
authored
Nov 15, 2012
by
Basile Sauvage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
courbures maillages : nettoyage commentaires
parent
bbfc4597
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
56 deletions
+4
-56
include/Algo/Geometry/curvature.hpp
include/Algo/Geometry/curvature.hpp
+4
-56
No files found.
include/Algo/Geometry/curvature.hpp
View file @
5f822d8a
...
...
@@ -313,6 +313,7 @@ void computeCurvatureVertex_NormalCycles(
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
// collect the normal cycle tensor
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
neigh
(
map
,
position
,
radius
,
thread
)
;
neigh
.
collectAll
(
dart
)
;
neigh
.
computeArea
()
;
...
...
@@ -321,14 +322,14 @@ void computeCurvatureVertex_NormalCycles(
typename
PFP
::
MATRIX33
tensor
(
0
)
;
//
inside
//
collect edges inside the neighborhood
const
std
::
vector
<
Dart
>&
vd1
=
neigh
.
getInsideEdges
()
;
for
(
std
::
vector
<
Dart
>::
const_iterator
it
=
vd1
.
begin
();
it
!=
vd1
.
end
();
++
it
)
{
const
VEC3
e
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
map
,
*
it
,
position
)
;
tensor
+=
Geom
::
transposed_vectors_mult
(
e
,
e
)
*
edgeangle
[
*
it
]
*
(
1
/
e
.
norm
())
;
}
// border
//
collect edges crossing the neighborhood's
border
const
std
::
vector
<
Dart
>&
vd2
=
neigh
.
getBorder
()
;
for
(
std
::
vector
<
Dart
>::
const_iterator
it
=
vd2
.
begin
();
it
!=
vd2
.
end
();
++
it
)
{
...
...
@@ -340,50 +341,6 @@ void computeCurvatureVertex_NormalCycles(
tensor
/=
neigh
.
getArea
()
;
/*
long int n = 3, lda = 3, info, lwork = 9 ;
char jobz='V', uplo = 'U' ;
float work[9] ;
float w[3] ;
float a[3*3] = {
tensor(0,0), 0.0f, 0.0f,
tensor(1,0), tensor(1,1), 0.0f,
tensor(2,0), tensor(2,1), tensor(2,2)
} ;
// Solve eigenproblem
ssyev_(&jobz, &uplo, (integer*)&n, a, (integer*)&lda, w, work, (integer*)&lwork, (integer*)&info) ;
// Check for convergence
if(info > 0)
std::cerr << "clapack ssyev_ failed to compute eigenvalues : exit with code " << info << std::endl ;
// sort eigen components : w[s[0]] has minimal absolute value ; kmin = w[s[1]] <= w[s[2]] = kmax
int s[3] = {0, 1, 2} ;
int tmp ;
if (abs(w[s[2]]) < abs(w[s[1]])) { tmp = s[1] ; s[1] = s[2] ; s[2] = tmp ; }
if (abs(w[s[1]]) < abs(w[s[0]])) { tmp = s[0] ; s[0] = s[1] ; s[1] = tmp ; }
if (w[s[2]] < w[s[1]]) { tmp = s[1] ; s[1] = s[2] ; s[2] = tmp ; }
kmin[dart] = w[s[1]] ;
kmax[dart] = w[s[2]] ;
VEC3& dirMin = Kmin[dart] ;
dirMin[0] = a[3*s[2]];
dirMin[1] = a[3*s[2]+1];
dirMin[2] = a[3*s[2]+2]; // warning : Kmin and Kmax are switched
VEC3& dirMax = Kmax[dart] ;
dirMax[0] = a[3*s[1]];
dirMax[1] = a[3*s[1]+1];
dirMax[2] = a[3*s[1]+2]; // warning : Kmin and Kmax are switched
VEC3& dirNormal = Knormal[dart] ;
dirNormal[0] = a[3*s[0]];
dirNormal[1] = a[3*s[0]+1];
dirNormal[2] = a[3*s[0]+2];
if (dirNormal * normal[dart] < 0)
dirNormal *= -1; // change orientation
*/
// TEST : lib eigen
// if ( dart == map.begin()) {
// solve eigen problem
Eigen
::
Matrix3f
m3
;
m3
<<
tensor
(
0
,
0
)
,
tensor
(
0
,
1
)
,
tensor
(
0
,
1
)
,
tensor
(
1
,
0
)
,
tensor
(
1
,
1
)
,
tensor
(
1
,
2
)
,
tensor
(
2
,
0
)
,
tensor
(
2
,
1
)
,
tensor
(
2
,
2
)
;
...
...
@@ -398,7 +355,7 @@ void computeCurvatureVertex_NormalCycles(
if
(
abs
(
ev
[
s
[
1
]])
<
abs
(
ev
[
s
[
0
]]))
{
tmp
=
s
[
0
]
;
s
[
0
]
=
s
[
1
]
;
s
[
1
]
=
tmp
;
}
if
(
ev
[
s
[
2
]]
<
ev
[
s
[
1
]])
{
tmp
=
s
[
1
]
;
s
[
1
]
=
s
[
2
]
;
s
[
2
]
=
tmp
;
}
// set eigen components
// set
curvatures from sorted
eigen components
kmin
[
dart
]
=
ev
[
s
[
1
]]
;
kmax
[
dart
]
=
ev
[
s
[
2
]]
;
VEC3
&
dirMin
=
Kmin
[
dart
]
;
...
...
@@ -415,15 +372,6 @@ void computeCurvatureVertex_NormalCycles(
dirNormal
[
2
]
=
evec
(
2
,
s
[
0
]);
if
(
dirNormal
*
normal
[
dart
]
<
0
)
dirNormal
*=
-
1
;
// change orientation
// CGoGNout << ev[s[0]] << "\t" << ev[s[1]] << "\t" << ev[s[2]] << CGoGNendl;
// CGoGNout << "? \t" << kmin[dart] << "\t" << kmax[dart] << CGoGNendl;
//
// CGoGNout << dirNormal << "\n" << dirMin << "\n" << dirMax << "\n" << CGoGNendl;
// CGoGNout << evec.col(s[0]) << "\n" << evec.col(s[2]) << "\n" << evec.col(s[1]) << "\n" << CGoGNendl;
// CGoGNout << solver.eigenvectors() << CGoGNendl;
}
...
...
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