Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hurstel
CGoGN
Commits
6c6cad56
Commit
6c6cad56
authored
Nov 15, 2013
by
Pierre Kraemer
Browse files
update import mesh to handle non-manifold edges with a pair number of faces
parent
7de130a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/Algo/Import/importMesh.hpp
View file @
6c6cad56
...
...
@@ -92,6 +92,8 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
}
}
bool
needBijectiveCheck
=
false
;
// reconstruct neighbourhood
unsigned
int
nbBoundaryEdges
=
0
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
...
...
@@ -103,27 +105,31 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
unsigned
int
embd
=
map
.
template
getEmbedding
<
VERTEX
>(
d
);
Dart
good_dart
=
NIL
;
bool
firstOK
=
true
;
for
(
typename
std
::
vector
<
Dart
>::
iterator
it
=
vec
.
begin
();
it
!=
vec
.
end
()
&&
good_dart
==
NIL
;
++
it
)
{
if
(
map
.
template
getEmbedding
<
VERTEX
>(
map
.
phi1
(
*
it
))
==
embd
)
good_dart
=
*
it
;
}
if
(
good_dart
!=
NIL
)
{
if
(
good_dart
==
map
.
phi2
(
good_dart
))
{
map
.
sewFaces
(
d
,
good_dart
,
false
);
m
.
unmarkOrbit
<
EDGE
>
(
d
);
}
else
{
++
nbBoundaryEdges
;
good_dart
=
*
it
;
if
(
good_dart
==
map
.
phi2
(
good_dart
))
{
map
.
sewFaces
(
d
,
good_dart
,
false
);
m
.
unmarkOrbit
<
EDGE
>
(
d
);
}
else
{
good_dart
=
NIL
;
firstOK
=
false
;
}
}
}
else
if
(
!
firstOK
)
needBijectiveCheck
=
true
;
if
(
good_dart
==
NIL
)
{
m
.
unmark
(
d
);
m
.
unmark
Orbit
<
EDGE
>
(
d
);
++
nbBoundaryEdges
;
}
}
...
...
@@ -133,6 +139,10 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
{
unsigned
int
nbH
=
map
.
closeMap
();
CGoGNout
<<
"Map closed ("
<<
nbBoundaryEdges
<<
" boundary edges / "
<<
nbH
<<
" holes)"
<<
CGoGNendl
;
}
if
(
needBijectiveCheck
)
{
// ensure bijection between topo and embedding
map
.
template
bijectiveOrbitEmbedding
<
VERTEX
>();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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