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
eeb7e0de
Commit
eeb7e0de
authored
Dec 08, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug closeMap GMap2 + correction cylinder polyhedron
parent
6ed3fb3a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
56 deletions
+33
-56
Apps/Examples/simpleGMap2.cpp
Apps/Examples/simpleGMap2.cpp
+5
-5
Apps/Examples/simpleGMap3.cpp
Apps/Examples/simpleGMap3.cpp
+7
-7
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+3
-30
include/Algo/Modelisation/primitives3d.hpp
include/Algo/Modelisation/primitives3d.hpp
+9
-7
include/Algo/Modelisation/subdivision3.hpp
include/Algo/Modelisation/subdivision3.hpp
+3
-3
src/Topology/gmap/gmap2.cpp
src/Topology/gmap/gmap2.cpp
+6
-4
No files found.
Apps/Examples/simpleGMap2.cpp
View file @
eeb7e0de
...
...
@@ -37,20 +37,20 @@ SimpleGMap2::SimpleGMap2()
position
[
myMap
.
phi_1
(
d
)]
=
VEC3
(
10
,
20
,
15
);
position
[
myMap
.
phi_1
(
myMap
.
phi2
(
d
))]
=
VEC3
(
0
,
0
,
30
);
VEC3
mid
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
VEC3
mid
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
myMap
.
cutEdge
(
d
);
position
[
myMap
.
phi1
(
d
)]
=
mid
;
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
poly
(
myMap
,
position
);
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
poly
(
myMap
,
position
);
d
=
poly
.
cylinder_topo
(
5
,
1
,
false
,
false
);
d
=
poly
.
cylinder_topo
(
5
,
1
,
false
,
false
);
poly
.
embedCylinder
(
10
,
10
,
5
);
poly
.
embedCylinder
(
10
,
10
,
5
);
d
=
myMap
.
phi1
(
d
);
Dart
dd
=
myMap
.
beta2
(
d
);
myMap
.
unsewFaces
(
d
);
myMap
.
sewFaces
(
d
,
dd
);
myMap
.
sewFaces
(
d
,
dd
);
position
[
d
][
1
]
+=
3.0
f
;
}
...
...
Apps/Examples/simpleGMap3.cpp
View file @
eeb7e0de
...
...
@@ -32,7 +32,7 @@
SimpleGMap3
::
SimpleGMap3
()
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"
position
"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"
normal
"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
2
,
1
,
1
);
...
...
@@ -43,33 +43,33 @@ SimpleGMap3::SimpleGMap3()
DartMarker
markOrient
(
myMap
);
std
::
vector
<
Dart
>
orient
;
FunctorStore
fs
(
orient
);
myMap
.
foreach_dart_of_oriented_volume
(
d
,
fs
);
myMap
.
foreach_dart_of_oriented_volume
(
d
,
fs
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
orient
.
begin
()
;
it
!=
orient
.
end
()
;
++
it
)
markOrient
.
mark
(
*
it
);
SelectorMarked
sm
(
markOrient
);
Algo
::
Modelisation
::
catmullClarkVol
<
PFP
,
PFP
::
TVEC3
,
PFP
::
VEC3
>
(
myMap
,
position
,
sm
);
Algo
::
Modelisation
::
catmullClarkVol
<
PFP
,
PFP
::
TVEC3
,
PFP
::
VEC3
>
(
myMap
,
position
,
sm
);
for
(
unsigned
int
i
=
position
.
begin
()
;
i
!=
position
.
end
()
;
position
.
next
(
i
))
position
[
i
]
+=
VEC3
(
2
,
0
,
0
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
d
=
prim
.
hexaGrid_topo
(
2
,
2
,
1
);
prim
.
embedHexaGrid
(
1
,
1
,
1
);
Dart
d1
=
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi2
(
myMap
.
phi1
(
myMap
.
phi1
(
d
)))));
VEC3
mid0
=
(
position
[
d1
]
+
position
[
myMap
.
phi1
(
d1
)])
/
2.0
f
;
VEC3
mid0
=
(
position
[
d1
]
+
position
[
myMap
.
phi1
(
d1
)])
/
2.0
f
;
myMap
.
cutEdge
(
d1
);
position
[
myMap
.
phi1
(
d1
)]
=
mid0
;
VEC3
mid1
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
VEC3
mid1
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
myMap
.
cutEdge
(
d
);
position
[
myMap
.
phi1
(
d
)]
=
mid1
;
d
=
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi2
(
myMap
.
phi1
(
myMap
.
phi1
(
d
)))));
VEC3
mid
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
VEC3
mid
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
myMap
.
cutEdge
(
d
);
position
[
myMap
.
phi1
(
d
)]
=
mid
;
...
...
include/Algo/Modelisation/polyhedron.hpp
View file @
eeb7e0de
...
...
@@ -415,28 +415,15 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
if
(
bottom_closed
)
{
Dart
d
=
m_tableVertDarts
[
0
];
if
(
m_map
.
closeHole
(
d
,
false
))
if
(
m_map
.
closeHole
(
d
,
false
))
{
d
=
m_map
.
phi2
(
d
);
if
(
m_map
.
faceDegree
(
d
)
>
3
)
{
Algo
::
Modelisation
::
trianguleFace
<
PFP
>
(
m_map
,
d
);
Algo
::
Modelisation
::
trianguleFace
<
PFP
>
(
m_map
,
d
);
m_tableVertDarts
.
push_back
(
m_map
.
phi_1
(
d
));
}
}
// // create bottom
// Dart d = triangleFan_topo<PFP>(m_map,n);
// // store center vertex dart
// m_tableVertDarts.push_back(m_map.phi_1(d));
//
// // sew it
// for (int i=0; i<n; ++i)
// {
// Dart e = m_tableVertDarts[i];
// m_map.sewFaces(d,e);
// d = precDV(d);
// }
}
else
m_map
.
closeHole
(
m_tableVertDarts
[
0
]);
...
...
@@ -449,24 +436,10 @@ Dart Polyhedron<PFP>::cylinder_topo(unsigned int n, unsigned int z, bool top_clo
d
=
m_map
.
phi2
(
d
);
if
(
m_map
.
faceDegree
(
d
)
>
3
)
{
Algo
::
Modelisation
::
trianguleFace
<
PFP
>
(
m_map
,
d
);
Algo
::
Modelisation
::
trianguleFace
<
PFP
>
(
m_map
,
d
);
m_tableVertDarts
.
push_back
(
m_map
.
phi_1
(
d
));
}
}
// // create bottom
// Dart d = triangleFan_topo<PFP>(m_map,n);
// // store center vertex dart
// m_tableVertDarts.push_back(m_map.phi_1(d));
//
// // sew it
// for (int i=0; i<n; ++i)
// {
// Dart e = m_tableVertDarts[n*z+i];
// e = m_map.phi_1(e);
// m_map.sewFaces(d,e);
// d = nextDV(d);
// }
}
else
m_map
.
closeHole
(
m_map
.
phi_1
(
m_tableVertDarts
[
n
*
z
]));
...
...
include/Algo/Modelisation/primitives3d.hpp
View file @
eeb7e0de
...
...
@@ -75,7 +75,7 @@ Dart Primitive3D<PFP>::HexaGrid1Topo(unsigned int nx)
{
Dart
d2
=
createHexa
();
m_tableVertDarts
.
push_back
(
d2
);
m_map
.
sewVolumes
(
d1
,
d2
);
m_map
.
sewVolumes
(
d1
,
d2
,
false
);
d1
=
m_map
.
template
phi
<
2112
>(
d2
);
}
...
...
@@ -102,7 +102,7 @@ Dart Primitive3D<PFP>::HexaGrid2Topo(unsigned int nx, unsigned int ny)
// couture des deux lignes de cubes
for
(
unsigned
int
i
=
0
;
i
<
nx
;
++
i
)
{
m_map
.
sewVolumes
(
d1
,
d3
);
m_map
.
sewVolumes
(
d1
,
d3
,
false
);
d1
=
m_map
.
template
phi
<
11232
>(
d1
);
d3
=
m_map
.
template
phi
<
11232
>(
d3
);
}
...
...
@@ -116,12 +116,12 @@ Dart Primitive3D<PFP>::HexaGrid2Topo(unsigned int nx, unsigned int ny)
for
(
unsigned
int
i
=
0
;
i
<
nx
;
++
i
)
{
Dart
dd
=
m_tableVertDarts
[
index
++
];
dd
=
m_map
.
template
phi
<
112
>(
dd
);
dd
=
m_map
.
template
phi
<
112
>(
dd
);
m_tableVertDarts
.
push_back
(
dd
);
}
// warning last vertex of row has not same dart
Dart
dd
=
m_tableVertDarts
[
index
++
];
dd
=
m_map
.
template
phi
<
211
>(
dd
);
dd
=
m_map
.
template
phi
<
211
>(
dd
);
m_tableVertDarts
.
push_back
(
dd
);
return
d0
;
...
...
@@ -137,13 +137,13 @@ Dart Primitive3D<PFP>::hexaGrid_topo(unsigned int nx, unsigned int ny, unsigned
m_tableVertDarts
.
clear
();
m_tableVertDarts
.
reserve
((
nx
+
1
)
*
(
ny
+
1
)
*
(
nz
+
1
));
Dart
d0
=
HexaGrid2Topo
(
nx
,
ny
);
Dart
d0
=
HexaGrid2Topo
(
nx
,
ny
);
Dart
d1
=
m_map
.
template
phi
<
12
>(
d0
);
for
(
unsigned
int
i
=
1
;
i
<
nz
;
++
i
)
{
// creation grille suivante
Dart
d2
=
HexaGrid2Topo
(
nx
,
ny
);
Dart
d2
=
HexaGrid2Topo
(
nx
,
ny
);
Dart
d3
=
m_map
.
phi2
(
m_map
.
phi_1
(
d2
));
// couture des deux grilles 2D de cubes
...
...
@@ -153,7 +153,7 @@ Dart Primitive3D<PFP>::hexaGrid_topo(unsigned int nx, unsigned int ny, unsigned
Dart
db
=
d3
;
for
(
unsigned
int
k
=
0
;
k
<
nx
;
++
k
)
{
m_map
.
sewVolumes
(
da
,
db
);
m_map
.
sewVolumes
(
da
,
db
,
false
);
da
=
m_map
.
template
phi
<
11232
>(
da
);
db
=
m_map
.
template
phi
<
11232
>(
db
);
}
...
...
@@ -176,6 +176,8 @@ Dart Primitive3D<PFP>::hexaGrid_topo(unsigned int nx, unsigned int ny, unsigned
m_tableVertDarts
.
push_back
(
dd
);
}
m_map
.
closeMap
()
;
return
d0
;
}
...
...
include/Algo/Modelisation/subdivision3.hpp
View file @
eeb7e0de
...
...
@@ -94,8 +94,8 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
CellMarkerNoUnmark
me
(
map
,
EDGE
);
CellMarker
mf
(
map
,
FACE
);
AutoAttributeHandler
<
EMB
>
attBary
(
map
,
VOLUME
);
CellMarker
vol
(
map
,
VOLUME
);
AutoAttributeHandler
<
EMB
>
attBary
(
map
,
VOLUME
);
CellMarker
vol
(
map
,
VOLUME
);
//pre-computation : compute the centroid of all volume
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
...
...
@@ -103,7 +103,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
if
(
selected
(
d
)
&&
!
vol
.
isMarked
(
d
))
{
vol
.
mark
(
d
);
attBary
[
d
]
=
Algo
::
Geometry
::
volumeCentroidGen
<
PFP
,
EMBV
,
EMB
>
(
map
,
d
,
attributs
);
attBary
[
d
]
=
Algo
::
Geometry
::
volumeCentroidGen
<
PFP
,
EMBV
,
EMB
>
(
map
,
d
,
attributs
);
}
}
...
...
src/Topology/gmap/gmap2.cpp
View file @
eeb7e0de
...
...
@@ -864,13 +864,14 @@ unsigned int GMap2::closeHole(Dart d, bool forboundary)
beta2sew
(
d
,
beta0
(
first
));
// sew the new edge to the hole
beta2sew
(
first
,
beta0
(
d
));
Dart
prev
=
first
;
Dart
dNext
=
d
;
// Turn around the hole
Dart
dPhi1
;
// to complete the face
do
{
dPhi1
=
phi1
(
dNext
)
;
dNext
=
beta2
(
dPhi1
)
;
while
(
dNext
!=
dPhi1
)
while
(
dNext
!=
dPhi1
&&
dPhi1
!=
d
)
{
dPhi1
=
beta1
(
dNext
)
;
// Search and put in dNext
dNext
=
beta2
(
dPhi1
)
;
// the next dart of the hole
...
...
@@ -880,14 +881,15 @@ unsigned int GMap2::closeHole(Dart d, bool forboundary)
{
Dart
next
=
newEdge
();
// Add a new edge there and link it to the face
++
countEdges
;
Dart
tmp
=
phi1
(
first
)
;
beta1sew
(
beta0
(
first
),
next
);
// the edge is linked to the face
beta1sew
(
beta0
(
next
),
tmp
)
;
beta1sew
(
beta0
(
next
),
prev
);
// the edge is linked to the face
prev
=
next
;
beta2sew
(
dNext
,
beta0
(
next
));
// the face is linked to the hole
beta2sew
(
next
,
beta0
(
dNext
));
}
}
while
(
dPhi1
!=
d
);
beta1sew
(
prev
,
beta0
(
first
))
;
if
(
forboundary
)
boundaryMarkOrbit
(
FACE
,
phi2
(
d
));
...
...
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