Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
091b59ab
Commit
091b59ab
authored
13 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
added a test case for samtech examples
parent
47bd12c9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/GEdgeLoop.cpp
+39
-25
39 additions, 25 deletions
Geo/GEdgeLoop.cpp
benchmarks/2d/coin.geo
+2
-1
2 additions, 1 deletion
benchmarks/2d/coin.geo
with
41 additions
and
26 deletions
Geo/GEdgeLoop.cpp
+
39
−
25
View file @
091b59ab
...
...
@@ -60,7 +60,7 @@ GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire)
GVertex
*
v2
=
ge
->
getEndVertex
();
if
(
v1
==
gv
)
return
GEdgeSigned
(
1
,
ge
);
if
(
v2
==
gv
)
return
GEdgeSigned
(
-
1
,
ge
);
Msg
::
Error
(
"Something wrong in edge loop"
);
Msg
::
Error
(
"Something wrong in edge loop
1
"
);
thisOne
->
print
();
}
++
it
;
...
...
@@ -77,7 +77,7 @@ GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire)
GVertex
*
v2
=
ge
->
getEndVertex
();
if
(
v1
==
gv
)
return
GEdgeSigned
(
1
,
ge
);
if
(
v2
==
gv
)
return
GEdgeSigned
(
-
1
,
ge
);
Msg
::
Error
(
"Something wrong in edge loop"
);
Msg
::
Error
(
"Something wrong in edge loop
2
"
);
thisOne
->
print
();
}
++
it
;
...
...
@@ -99,6 +99,38 @@ int GEdgeLoop::count(GEdge* ge) const
return
count
;
}
static
void
loopTheLoop
(
std
::
list
<
GEdge
*>
&
wire
,
std
::
list
<
GEdgeSigned
>
&
loop
,
GEdge
**
degeneratedToInsert
)
{
GEdgeSigned
*
prevOne
=
0
;
GEdgeSigned
ges
(
0
,
0
);
while
(
wire
.
size
()){
if
(
prevOne
&&
(
*
degeneratedToInsert
)
&&
(
*
degeneratedToInsert
)
->
getBeginVertex
()
==
prevOne
->
getEndVertex
()){
ges
=
GEdgeSigned
(
1
,
*
degeneratedToInsert
);
*
degeneratedToInsert
=
0
;
// printf("second degenerated edge inserted\n");
}
else
ges
=
nextOne
(
prevOne
,
wire
);
if
(
ges
.
getSign
()
==
0
){
// oops
if
(
0
){
Msg
::
Error
(
"Something wrong in edge loop of size=%d, no sign !"
,
wire
.
size
());
for
(
std
::
list
<
GEdge
*
>::
iterator
it
=
wire
.
begin
();
it
!=
wire
.
end
();
it
++
){
Msg
::
Error
(
"GEdge=%d begin=%d end =%d"
,
(
*
it
)
->
tag
(),
(
*
it
)
->
getBeginVertex
()
->
tag
(),
(
*
it
)
->
getEndVertex
()
->
tag
());
}
}
break
;
}
prevOne
=
&
ges
;
// ges.print();
loop
.
push_back
(
ges
);
}
}
GEdgeLoop
::
GEdgeLoop
(
const
std
::
list
<
GEdge
*>
&
cwire
)
{
// Sometimes OCC puts a nasty degenerated edge in the middle of the
...
...
@@ -112,7 +144,7 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire)
if
(
ed
->
degenerate
(
0
))
degenerated
.
push_back
(
ed
);
else
wire
.
push_back
(
ed
);
}
if
(
degenerated
.
size
()
==
1
){
wire
.
push_front
(
degenerated
[
0
]);
}
...
...
@@ -124,27 +156,9 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire)
Msg
::
Error
(
"More than two degenerated edges in one model face"
);
}
GEdgeSigned
*
prevOne
=
0
;
GEdgeSigned
ges
(
0
,
0
);
while
(
wire
.
size
()){
if
(
prevOne
&&
degeneratedToInsert
&&
degeneratedToInsert
->
getBeginVertex
()
==
prevOne
->
getEndVertex
()){
ges
=
GEdgeSigned
(
1
,
degeneratedToInsert
);
degeneratedToInsert
=
0
;
// printf("second degenerated edge inserted\n");
}
else
ges
=
nextOne
(
prevOne
,
wire
);
if
(
ges
.
getSign
()
==
0
){
// oops
Msg
::
Error
(
"Something wrong in edge loop of size=%d, no sign !"
,
wire
.
size
());
for
(
std
::
list
<
GEdge
*
>::
iterator
it
=
wire
.
begin
();
it
!=
wire
.
end
();
it
++
){
Msg
::
Error
(
"GEdge=%d begin=%d end =%d"
,
(
*
it
)
->
tag
(),
(
*
it
)
->
getBeginVertex
()
->
tag
(),
(
*
it
)
->
getEndVertex
()
->
tag
());
}
break
;
}
prevOne
=
&
ges
;
// ges.print();
loop
.
push_back
(
ges
);
while
(
!
wire
.
empty
()){
printf
(
"wire.size = %d
\n
"
,
wire
.
size
());
loopTheLoop
(
wire
,
loop
,
&
degeneratedToInsert
);
// break;
}
}
This diff is collapsed.
Click to expand it.
benchmarks/2d/coin.geo
+
2
−
1
View file @
091b59ab
Mesh
.
SmoothRatio
=
21.5
;
lc
=
0.1
;
a
=
1.0
;
b
=
1.0
;
h
=
1.0
;
refine
=
0.0000
00
1
;
refine
=
0.00001
;
Point
(
1
)
=
{
0
,
0
,
0
,
lc
*
refine
};
Point
(
2
)
=
{
a
,
0
,
0
,
lc
}
;
...
...
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