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
62c1194a
Commit
62c1194a
authored
Nov 09, 2012
by
Jund Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction particle2d et particle2dmemo
parent
4b06724c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
24 deletions
+45
-24
include/Algo/Export/exportPov.h
include/Algo/Export/exportPov.h
+2
-2
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+13
-0
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
+29
-22
include/Geometry/orientation.hpp
include/Geometry/orientation.hpp
+1
-0
No files found.
include/Algo/Export/exportPov.h
View file @
62c1194a
...
...
@@ -55,10 +55,10 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, VertexAttribute
Dart
dd
=
d
;
do
{
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
1
]
<<
","
<<
position
[
dd
][
2
]
<<
">,"
<<
std
::
endl
;
out
<<
"<"
<<
position
[
dd
][
0
]
<<
","
<<
position
[
dd
][
2
]
<<
","
<<
position
[
dd
][
1
]
<<
">,"
<<
std
::
endl
;
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
out
<<
"<"
<<
position
[
d
][
0
]
<<
","
<<
position
[
d
][
1
]
<<
","
<<
position
[
d
][
2
]
<<
">"
<<
std
::
endl
;
out
<<
"<"
<<
position
[
d
][
0
]
<<
","
<<
position
[
d
][
2
]
<<
","
<<
position
[
d
][
1
]
<<
">"
<<
std
::
endl
;
out
<<
"}"
<<
std
::
endl
;
}
}
...
...
include/Algo/MovingObjects/particle_cell_2D.hpp
View file @
62c1194a
...
...
@@ -96,6 +96,19 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
}
else
{
//checking : case with 3 orthogonal darts and point on an edge
do
{
if
(
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
positionAttribut
,
goal
)
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
this
->
m
.
phi2
(
d
),
positionAttribut
,
goal
))
{
edgeState
(
goal
)
;
return
;
}
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
goal
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
this
->
setState
(
VERTEX
)
;
this
->
ParticleBase
<
PFP
>
::
move
(
goal
)
;
return
;
...
...
include/Algo/MovingObjects/particle_cell_2D_memo.hpp
View file @
62c1194a
...
...
@@ -40,34 +40,41 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current)
else
{
//orientation step
if
(
this
->
positionAttribut
[
this
->
d
][
0
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
0
]
&&
this
->
positionAttribut
[
this
->
d
][
1
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
1
])
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
if
(
this
->
positionAttribut
[
this
->
d
][
0
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
0
]
&&
this
->
positionAttribut
[
this
->
d
][
1
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
1
])
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
if
(
this
->
getOrientationEdge
(
current
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
)
{
Dart
dd_vert
=
this
->
d
;
do
{
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
if
(
this
->
positionAttribut
[
this
->
d
][
0
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
0
]
&&
this
->
positionAttribut
[
this
->
d
][
1
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
1
])
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
current
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
if
(
this
->
positionAttribut
[
this
->
d
][
0
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
0
]
&&
this
->
positionAttribut
[
this
->
d
][
1
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
1
])
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
current
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
if
(
dd_vert
==
this
->
d
)
{
//orbit with 2 edges : point on one edge
if
(
this
->
m
.
phi2_1
(
this
->
m
.
phi2_1
(
this
->
d
))
==
this
->
d
)
{
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
if
(
!
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
else
{
//checking : case with 3 orthogonal darts and point on an edge
do
{
if
(
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
)
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
m
.
phi2
(
this
->
d
),
this
->
positionAttribut
,
current
))
{
this
->
edgeState
(
current
)
;
return
;
}
this
->
d
=
this
->
m
.
phi2_1
(
this
->
d
)
;
}
while
(
this
->
getOrientationEdge
(
current
,
this
->
m
.
phi2_1
(
this
->
d
))
!=
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
;
this
->
ParticleBase
<
PFP
>::
move
(
current
)
;
this
->
setState
(
VERTEX
)
;
return
;
...
...
@@ -80,19 +87,17 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current)
while
(
this
->
getOrientationEdge
(
current
,
this
->
d
)
==
Geom
::
RIGHT
&&
dd_vert
!=
this
->
d
)
{
this
->
d
=
this
->
m
.
phi12
(
this
->
d
)
;
if
(
this
->
positionAttribut
[
this
->
d
][
0
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
0
]
&&
this
->
positionAttribut
[
this
->
d
][
1
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
1
])
this
->
d
=
this
->
m
.
phi12
(
this
->
d
)
;
if
(
this
->
positionAttribut
[
this
->
d
][
0
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
0
]
&&
this
->
positionAttribut
[
this
->
d
][
1
]
==
this
->
positionAttribut
[
this
->
m
.
phi1
(
this
->
d
)][
1
])
this
->
d
=
this
->
m
.
phi12
(
this
->
d
)
;
}
}
//displacement step
if
(
detect_vertex
)
memo_cross
.
push_back
(
this
->
d
)
;
if
(
detect_vertex
)
memo_cross
.
push_back
(
this
->
d
)
;
if
(
this
->
getOrientationEdge
(
current
,
this
->
d
)
==
Geom
::
ALIGNED
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
this
->
m
,
this
->
d
,
this
->
positionAttribut
,
current
))
edgeState
(
current
)
;
else
{
...
...
@@ -108,7 +113,9 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, Geom::Orientation2D
#ifdef DEBUG
CGoGNout
<<
"edgeState"
<<
d
<<
CGoGNendl
;
#endif
if
(
detect_edge
)
memo_cross
.
push_back
(
this
->
d
)
;
if
(
detect_edge
)
memo_cross
.
push_back
(
this
->
d
)
;
assert
(
std
::
isfinite
(
current
[
0
])
&&
std
::
isfinite
(
current
[
1
])
&&
std
::
isfinite
(
current
[
2
]))
;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
...
...
include/Geometry/orientation.hpp
View file @
62c1194a
...
...
@@ -38,6 +38,7 @@ Orientation2D testOrientation2D(const VEC3& P, const VEC3& Pa, const VEC3& Pb)
// const T min = std::numeric_limits<T>::min()*T(100);
const
T
min
=
0.0001
;
// T wsof = (Pa[0]-P[0])*(P[1]-Pb[1])-(P[0]-Pb[0])*(Pa[1]-P[1]);
T
wsof
=
(
P
[
0
]
-
Pa
[
0
])
*
(
Pb
[
1
]
-
Pa
[
1
])
-
(
Pb
[
0
]
-
Pa
[
0
])
*
(
P
[
1
]
-
Pa
[
1
]);
...
...
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