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
Hurstel
CGoGN
Commits
f6b54806
Commit
f6b54806
authored
Jul 12, 2011
by
Basile Sauvage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction du filtre de Taubin
parent
21f73349
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
include/Algo/Filtering/functors.h
include/Algo/Filtering/functors.h
+5
-5
include/Algo/Filtering/taubin.h
include/Algo/Filtering/taubin.h
+10
-6
No files found.
include/Algo/Filtering/functors.h
View file @
f6b54806
...
@@ -71,14 +71,14 @@ protected:
...
@@ -71,14 +71,14 @@ protected:
T
sum
;
T
sum
;
unsigned
int
count
;
unsigned
int
count
;
public:
public:
FunctorAverageOnSphereBorder
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
>&
a
,
const
AttributeHandler
<
VEC3
>&
p
,
VEC3
&
c
=
VEC3
(
0
),
typename
PFP
::
REAL
r
=
0
)
:
FunctorAverageOnSphereBorder
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
T
>&
a
,
const
AttributeHandler
<
VEC3
>&
p
)
:
FunctorMap
<
typename
PFP
::
MAP
>
(
map
),
attr
(
a
),
position
(
p
),
center
(
c
),
radius
(
r
),
sum
(
0
),
count
(
0
)
FunctorMap
<
typename
PFP
::
MAP
>
(
map
),
attr
(
a
),
position
(
p
),
sum
(
0
),
count
(
0
)
{}
{
center
=
VEC3
(
0
);
radius
=
0
;
}
bool
operator
()(
Dart
d
)
bool
operator
()(
Dart
d
)
{
{
typename
PFP
::
REAL
alpha
=
0
;
typename
PFP
::
REAL
alpha
=
0
;
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
center
,
radius
,
d
,
position
,
alpha
);
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
m
_m
ap
,
center
,
radius
,
d
,
position
,
alpha
);
sum
+=
(
1
-
alpha
)
*
attr
[
d
]
+
alpha
*
attr
[
this
->
map
.
phi1
(
d
)]
;
sum
+=
(
1
-
alpha
)
*
attr
[
d
]
+
alpha
*
attr
[
this
->
m
_m
ap
.
phi1
(
d
)]
;
++
count
;
++
count
;
return
false
;
return
false
;
}
}
...
...
include/Algo/Filtering/taubin.h
View file @
f6b54806
...
@@ -94,6 +94,7 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
...
@@ -94,6 +94,7 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
const
float
lambda
=
0.6307
;
const
float
lambda
=
0.6307
;
const
float
mu
=
-
0.6732
;
const
float
mu
=
-
0.6732
;
FunctorAverageOnSphereBorder
<
PFP
,
typename
PFP
::
VEC3
>
fa1
(
map
,
position
,
position
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
c1
(
map
,
position
,
radius
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
c1
(
map
,
position
,
radius
)
;
CellMarkerNoUnmark
mv
(
map
,
VERTEX
)
;
CellMarkerNoUnmark
mv
(
map
,
VERTEX
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
...
@@ -103,16 +104,19 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
...
@@ -103,16 +104,19 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
mv
.
mark
(
d
);
mv
.
mark
(
d
);
c1
.
collectBorder
(
d
)
;
c1
.
collectBorder
(
d
)
;
VEC3
center
=
position
[
d
]
;
VEC3
center
=
position
[
d
]
;
FunctorAverageOnSphereBorder
<
PFP
,
typename
PFP
::
VEC3
>
fa
(
map
,
position
,
position
,
center
,
radius
)
;
fa1
.
reset
(
center
,
radius
)
;
c1
.
applyOnBorder
(
fa
)
;
VEC3
displ
=
fa
.
getAverage
()
-
center
;
c1
.
applyOnBorder
(
fa1
)
;
VEC3
displ
=
fa1
.
getAverage
()
-
center
;
displ
*=
lambda
;
displ
*=
lambda
;
position2
[
d
]
=
center
+
displ
;
position2
[
d
]
=
center
+
displ
;
}
}
}
}
// unshrinking step
// unshrinking step
FunctorAverageOnSphereBorder
<
PFP
,
typename
PFP
::
VEC3
>
fa2
(
map
,
position2
,
position2
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
c2
(
map
,
position2
,
radius
)
;
Algo
::
Selection
::
Collector_WithinSphere
<
PFP
>
c2
(
map
,
position2
,
radius
)
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
{
...
@@ -122,9 +126,9 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
...
@@ -122,9 +126,9 @@ void filterTaubin_modified(typename PFP::MAP& map, typename PFP::TVEC3& position
c2
.
collectBorder
(
d
)
;
c2
.
collectBorder
(
d
)
;
VEC3
center
=
position2
[
d
]
;
VEC3
center
=
position2
[
d
]
;
FunctorAverageOnSphereBorder
<
PFP
,
typename
PFP
::
VEC3
>
fa
(
map
,
position2
,
position2
,
center
,
radius
)
;
fa2
.
reset
(
center
,
radius
)
;
c2
.
applyOnBorder
(
fa
)
;
c2
.
applyOnBorder
(
fa
2
)
;
VEC3
displ
=
fa
.
getAverage
()
-
center
;
VEC3
displ
=
fa
2
.
getAverage
()
-
center
;
displ
*=
mu
;
displ
*=
mu
;
position
[
d
]
=
center
+
displ
;
position
[
d
]
=
center
+
displ
;
}
}
...
...
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