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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
473ec2bb
Commit
473ec2bb
authored
Jan 13, 2013
by
Sauvage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout des normal Cycles projetés
parent
e1413163
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
183 additions
and
0 deletions
+183
-0
include/Algo/Geometry/curvature.h
include/Algo/Geometry/curvature.h
+61
-0
include/Algo/Geometry/curvature.hpp
include/Algo/Geometry/curvature.hpp
+122
-0
No files found.
include/Algo/Geometry/curvature.h
View file @
473ec2bb
...
...
@@ -140,6 +140,39 @@ void normalCycles_SortAndSetEigenComponents(
template
<
typename
PFP
>
void
normalCycles_SortTensor
(
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
&
tensor
,
unsigned
int
thread
=
0
)
;
template
<
typename
PFP
>
void
normalCycles_ProjectTensor
(
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
&
tensor
,
const
typename
PFP
::
VEC3
&
normal_vector
,
unsigned
int
thread
=
0
)
;
template
<
typename
PFP
>
void
computeCurvatureVertices_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
REAL
radius
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
const
FunctorSelect
&
select
=
allDarts
,
unsigned
int
thread
=
0
)
;
template
<
typename
PFP
>
void
computeCurvatureVertex_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
Dart
dart
,
typename
PFP
::
REAL
radius
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
unsigned
int
thread
=
0
)
;
/* normal cycles with collector as a parameter : not usable in parallel */
template
<
typename
PFP
>
...
...
@@ -170,6 +203,34 @@ void computeCurvatureVertex_NormalCycles(
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
unsigned
int
thread
=
0
)
;
template
<
typename
PFP
>
void
computeCurvatureVertices_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
Algo
::
Selection
::
Collector
<
PFP
>
&
neigh
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
const
FunctorSelect
&
select
=
allDarts
,
unsigned
int
thread
=
0
)
;
template
<
typename
PFP
>
void
computeCurvatureVertex_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
Dart
dart
,
Algo
::
Selection
::
Collector
<
PFP
>
&
neigh
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
unsigned
int
thread
=
0
)
;
namespace
Parallel
{
...
...
include/Algo/Geometry/curvature.hpp
View file @
473ec2bb
...
...
@@ -340,6 +340,63 @@ void computeCurvatureVertex_NormalCycles(
// }
}
template
<
typename
PFP
>
void
computeCurvatureVertices_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
typename
PFP
::
REAL
radius
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
const
FunctorSelect
&
select
,
unsigned
int
thread
)
{
TraversorV
<
typename
PFP
::
MAP
>
t
(
map
,
select
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
computeCurvatureVertex_NormalCycles_Projected
<
PFP
>
(
map
,
d
,
radius
,
position
,
normal
,
edgeangle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
,
thread
)
;
}
template
<
typename
PFP
>
void
computeCurvatureVertex_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
Dart
dart
,
typename
PFP
::
REAL
radius
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
unsigned
int
thread
)
{
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
Geom
::
Matrix
<
3
,
3
,
REAL
>
MATRIX
;
typedef
Eigen
::
Matrix
<
REAL
,
3
,
1
>
E_VEC3
;
typedef
Eigen
::
Matrix
<
REAL
,
3
,
3
,
Eigen
::
RowMajor
>
E_MATRIX
;
// collect the normal cycle tensor
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
neigh
(
map
,
position
,
radius
,
thread
)
;
neigh
.
collectAll
(
dart
)
;
MATRIX
tensor
(
0
)
;
neigh
.
computeNormalCyclesTensor
(
position
,
edgeangle
,
tensor
);
// project the tensor
normalCycles_ProjectTensor
<
PFP
>
(
tensor
,
normal
[
dart
],
thread
);
// solve eigen problem
Eigen
::
SelfAdjointEigenSolver
<
E_MATRIX
>
solver
(
Utils
::
convertRef
<
E_MATRIX
>
(
tensor
));
const
VEC3
&
ev
=
Utils
::
convertRef
<
VEC3
>
(
solver
.
eigenvalues
());
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
);
}
template
<
typename
PFP
>
void
computeCurvatureVertices_NormalCycles
(
typename
PFP
::
MAP
&
map
,
...
...
@@ -393,6 +450,61 @@ void computeCurvatureVertex_NormalCycles(
normalCycles_SortAndSetEigenComponents
<
PFP
>
(
ev
,
evec
,
kmax
[
dart
],
kmin
[
dart
],
Kmax
[
dart
],
Kmin
[
dart
],
Knormal
[
dart
],
normal
[
dart
],
thread
);
}
template
<
typename
PFP
>
void
computeCurvatureVertices_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
Algo
::
Selection
::
Collector
<
PFP
>
&
neigh
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
const
FunctorSelect
&
select
,
unsigned
int
thread
)
{
TraversorV
<
typename
PFP
::
MAP
>
t
(
map
,
select
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
computeCurvatureVertex_NormalCycles_Projected
<
PFP
>
(
map
,
d
,
neigh
,
position
,
normal
,
edgeangle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
,
thread
)
;
}
template
<
typename
PFP
>
void
computeCurvatureVertex_NormalCycles_Projected
(
typename
PFP
::
MAP
&
map
,
Dart
dart
,
Algo
::
Selection
::
Collector
<
PFP
>
&
neigh
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
normal
,
const
EdgeAttribute
<
typename
PFP
::
REAL
>&
edgeangle
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmax
,
VertexAttribute
<
typename
PFP
::
REAL
>&
kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmax
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Kmin
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
Knormal
,
unsigned
int
thread
)
{
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
Geom
::
Matrix
<
3
,
3
,
REAL
>
MATRIX
;
typedef
Eigen
::
Matrix
<
REAL
,
3
,
1
>
E_VEC3
;
typedef
Eigen
::
Matrix
<
REAL
,
3
,
3
,
Eigen
::
RowMajor
>
E_MATRIX
;
// collect the normal cycle tensor
neigh
.
collectAll
(
dart
)
;
MATRIX
tensor
(
0
)
;
neigh
.
computeNormalCyclesTensor
(
position
,
edgeangle
,
tensor
);
// project the tensor
normalCycles_ProjectTensor
<
PFP
>
(
tensor
,
normal
[
dart
],
thread
);
// solve eigen problem
Eigen
::
SelfAdjointEigenSolver
<
E_MATRIX
>
solver
(
Utils
::
convertRef
<
E_MATRIX
>
(
tensor
));
const
VEC3
&
ev
=
Utils
::
convertRef
<
VEC3
>
(
solver
.
eigenvalues
());
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
);
}
template
<
typename
PFP
>
void
normalCycles_SortAndSetEigenComponents
(
...
...
@@ -466,6 +578,16 @@ void normalCycles_SortTensor( Geom::Matrix<3,3,typename PFP::REAL> & tensor, uns
tensor
=
tensor
*
e_vec
.
transposed
();
}
template
<
typename
PFP
>
void
normalCycles_ProjectTensor
(
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
&
tensor
,
const
typename
PFP
::
VEC3
&
normal_vector
,
unsigned
int
thread
=
0
)
{
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
proj
;
proj
.
identity
();
proj
-=
Geom
::
transposed_vectors_mult
(
normal_vector
,
normal_vector
);
tensor
=
proj
*
tensor
*
proj
;
}
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