Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
taglut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Marie Favreau
taglut
Commits
3fbe806b
Commit
3fbe806b
authored
14 years ago
by
Jean-Marie Favreau
Browse files
Options
Downloads
Patches
Plain Diff
Correct several bugs
parent
23d01fd4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/meshCutUsingNLoops.py
+1
-1
1 addition, 1 deletion
python/meshCutUsingNLoops.py
src/tiling/MTiling.cpp
+25
-17
25 additions, 17 deletions
src/tiling/MTiling.cpp
src/tiling/MTiling.h
+3
-0
3 additions, 0 deletions
src/tiling/MTiling.h
with
29 additions
and
18 deletions
python/meshCutUsingNLoops.py
+
1
−
1
View file @
3fbe806b
...
...
@@ -160,7 +160,7 @@ def main():
mtiling
.
adjustQuads
()
mapping
=
mtiling
.
parameterize
()
print
"
Save mapping (
"
+
outputFileParam
+
"
)...
"
mapping
.
save
(
outputFile
)
mapping
.
save
(
outputFile
Param
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
src/tiling/MTiling.cpp
+
25
−
17
View file @
3fbe806b
...
...
@@ -59,22 +59,28 @@ void MTile::addNeighbour(const MTile & mtile) {
MTiling
::
MTiling
(
Mesh
&
m
)
:
mesh
(
m
)
{
std
::
deque
<
MeshPart
>
cc
=
m
.
getConnectedComponents
();
unsigned
int
i
=
1
;
unsigned
int
i
=
0
;
// build the connected components
for
(
std
::
deque
<
MeshPart
>::
iterator
c
=
cc
.
begin
();
c
!=
cc
.
end
();
++
c
,
++
i
)
mtiles
.
push_back
(
MTile
(
*
c
,
i
));
// set the flags according to the CC
mesh
.
setPointFlag
(
-
1
);
MeshManipulator
mManip
(
mesh
);
mManip
.
computeFlagsUsingCC
();
for
(
std
::
vector
<
MTile
>::
const_iterator
t
=
mtiles
.
begin
();
t
!=
mtiles
.
end
();
++
t
)
{
assert
(
mesh
.
point
((
*
t
).
getInsidePoint
()).
getFlag
()
==
-
1
);
mManip
.
computeCCUsingPointsSimple
((
*
t
).
getInsidePoint
(),
-
1
,
(
*
t
).
getId
());
}
// compute multipoints
std
::
map
<
Coord3D
,
std
::
vector
<
VertexID
>
,
Coord3D
::
ltCoord
>
mPoints
=
mesh
.
computeMultiPointsByCoords
();
// add multipoints and neighbours to the tiles
for
(
std
::
map
<
Coord3D
,
std
::
vector
<
VertexID
>
,
Coord3D
::
ltCoord
>::
const_iterator
mpl
=
mPoints
.
begin
();
mpl
!=
mPoints
.
end
();
++
mpl
)
{
for
(
std
::
vector
<
VertexID
>::
const_iterator
mp
=
(
*
mpl
).
second
.
begin
();
mp
!=
(
*
mpl
).
second
.
end
();
++
mp
)
for
(
std
::
vector
<
VertexID
>::
const_iterator
mp
=
(
*
mpl
).
second
.
begin
();
mp
!=
(
*
mpl
).
second
.
end
();
++
mp
)
{
assert
(
mtiles
[
mesh
.
point
(
*
mp
).
getFlag
()].
getId
()
==
(
unsigned
int
)(
mesh
.
point
(
*
mp
).
getFlag
()));
mtiles
[
mesh
.
point
(
*
mp
).
getFlag
()].
addMultiPoint
(
*
mp
);
}
setNeighbourConnections
((
*
mpl
).
second
);
}
...
...
@@ -96,7 +102,7 @@ void MTiling::setNeighbourConnections(const std::vector<VertexID> & mPoints) {
}
// then check if the other multipoints have same location
for
(
std
::
vector
<
VertexID
>::
const_iterator
pp
=
p
+
1
;
p
!=
mPoints
.
end
();
++
p
)
{
for
(
std
::
vector
<
VertexID
>::
const_iterator
pp
=
p
+
1
;
p
p
!=
mPoints
.
end
();
++
p
p
)
{
for
(
std
::
deque
<
VertexID
>::
const_iterator
nbPP
=
mesh
.
point
(
*
pp
).
getNeighbours
().
begin
();
nbPP
!=
mesh
.
point
(
*
pp
).
getNeighbours
().
end
();
++
nbPP
)
{
const
Point3D
&
nPPC
=
mesh
.
point
(
*
nbPP
);
...
...
@@ -118,15 +124,10 @@ void MTiling::adjustQuads() {
Mapping2D3D
MTiling
::
parameterize
()
{
Mapping2D3D
mapping
(
mesh
);
std
::
deque
<
MeshPart
>
cc
=
mesh
.
getConnectedComponents
();
assert
(
cc
.
size
()
==
mtiles
.
size
());
std
::
deque
<
MeshPart
>::
iterator
c
=
cc
.
begin
();
std
::
vector
<
MTile
>::
const_iterator
t
=
mtiles
.
begin
();
for
(;
c
!=
cc
.
end
();
++
c
,
++
t
)
{
Mesh
ccMesh
=
(
*
c
).
buildCropMesh
();
MeshPart
::
IDTranslator
idTranslator
(
*
c
);
for
(
std
::
vector
<
MTile
>::
const_iterator
t
=
mtiles
.
begin
();
t
!=
mtiles
.
end
();
++
t
)
{
MeshPart
mPart
(
mesh
,
(
*
t
).
getInsidePoint
());
Mesh
ccMesh
=
mPart
.
buildCropMesh
();
MeshPart
::
IDTranslator
idTranslator
(
mPart
);
if
(((
*
t
).
getGenus
()
!=
0
)
||
(
*
t
).
getNbBoundaries
()
!=
1
)
throw
Exception
(
"Wrong topology configuration"
);
...
...
@@ -134,11 +135,15 @@ Mapping2D3D MTiling::parameterize() {
Mapping2D3D
rMapping
(
ccMesh
);
if
((
*
t
).
getNbMultiPoints
()
==
4
)
{
QuadParameterizationFloater
mParam
;
assert
(
mPart
.
hasPoint
((
*
t
).
getMultiPoint
(
0
)));
assert
(
mPart
.
hasPoint
((
*
t
).
getMultiPoint
(
1
)));
assert
(
mPart
.
hasPoint
((
*
t
).
getMultiPoint
(
2
)));
assert
(
mPart
.
hasPoint
((
*
t
).
getMultiPoint
(
3
)));
rMapping
=
mParam
.
parameterize
(
ccMesh
,
(
*
t
).
getMultiPoint
(
0
),
(
*
t
).
getMultiPoint
(
1
),
(
*
t
).
getMultiPoint
(
2
),
(
*
t
).
getMultiPoint
(
3
));
idTranslator
.
g2l
(
(
*
t
).
getMultiPoint
(
0
)
)
,
idTranslator
.
g2l
(
(
*
t
).
getMultiPoint
(
1
)
)
,
idTranslator
.
g2l
(
(
*
t
).
getMultiPoint
(
2
)
)
,
idTranslator
.
g2l
(
(
*
t
).
getMultiPoint
(
3
))
)
;
}
else
{
DiscParameterizationFloater
mParam
;
...
...
@@ -150,6 +155,9 @@ Mapping2D3D MTiling::parameterize() {
mapping
[
idTranslator
.
l2g
(
lID
)]
=
*
p2D
;
}
// the mesh is flatten
mapping
.
isFlatten
();
return
mapping
;
}
This diff is collapsed.
Click to expand it.
src/tiling/MTiling.h
+
3
−
0
View file @
3fbe806b
...
...
@@ -71,6 +71,9 @@ namespace Taglut {
/** add a neighbour tile */
void
addNeighbour
(
const
MTile
&
mtile
);
/** accessor */
inline
VertexID
getInsidePoint
()
const
{
return
v
;
}
/** accessor */
inline
unsigned
int
getId
()
const
{
return
id
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment