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
735e431d
Commit
735e431d
authored
Jul 10, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve bug of vertex normal with degenerated face
parent
455dc609
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
include/Algo/Geometry/normal.hpp
include/Algo/Geometry/normal.hpp
+10
-2
No files found.
include/Algo/Geometry/normal.hpp
View file @
735e431d
...
...
@@ -85,6 +85,8 @@ typename V_ATT::DATA_TYPE faceNormal(typename PFP::MAP& map, Face f, const V_ATT
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
vertexNormal
(
typename
PFP
::
MAP
&
map
,
Vertex
v
,
const
V_ATT
&
position
)
{
CHECK_ATTRIBUTEHANDER_ORBIT_TYPE
(
V_ATT
,
VERTEX
);
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
VEC3
N
(
0
)
;
...
...
@@ -96,15 +98,21 @@ typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V
{
VEC3
v1
=
vectorOutOfDart
<
PFP
>
(
map
,
f
.
dart
,
position
)
;
VEC3
v2
=
vectorOutOfDart
<
PFP
>
(
map
,
map
.
phi_1
(
f
),
position
)
;
n
*=
convexFaceArea
<
PFP
>
(
map
,
f
,
position
)
/
(
v1
.
norm2
()
*
v2
.
norm2
())
;
typename
VEC3
::
DATA_TYPE
l
=
(
v1
.
norm2
()
*
v2
.
norm2
());
if
(
l
>
(
typename
VEC3
::
DATA_TYPE
(
0.0
))
)
{
n
*=
convexFaceArea
<
PFP
>
(
map
,
f
,
position
)
/
l
;
N
+=
n
;
}
}
});
N
.
normalize
()
;
return
N
;
}
template
<
typename
PFP
,
typename
V_ATT
>
typename
V_ATT
::
DATA_TYPE
vertexBorderNormal
(
typename
PFP
::
MAP
&
map
,
Vertex
v
,
const
V_ATT
&
position
)
{
...
...
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