Skip to content
Snippets Groups Projects
Commit 091b59ab authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

added a test case for samtech examples

parent 47bd12c9
No related branches found
No related tags found
Loading
...@@ -60,7 +60,7 @@ GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire) ...@@ -60,7 +60,7 @@ GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire)
GVertex *v2 = ge->getEndVertex(); GVertex *v2 = ge->getEndVertex();
if(v1 == gv) return GEdgeSigned(1, ge); if(v1 == gv) return GEdgeSigned(1, ge);
if(v2 == 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(); thisOne->print();
} }
++it; ++it;
...@@ -77,7 +77,7 @@ GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire) ...@@ -77,7 +77,7 @@ GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire)
GVertex *v2 = ge->getEndVertex(); GVertex *v2 = ge->getEndVertex();
if(v1 == gv) return GEdgeSigned(1, ge); if(v1 == gv) return GEdgeSigned(1, ge);
if(v2 == 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(); thisOne->print();
} }
++it; ++it;
...@@ -99,6 +99,38 @@ int GEdgeLoop::count(GEdge* ge) const ...@@ -99,6 +99,38 @@ int GEdgeLoop::count(GEdge* ge) const
return count; 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) GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire)
{ {
// Sometimes OCC puts a nasty degenerated edge in the middle of the // Sometimes OCC puts a nasty degenerated edge in the middle of the
...@@ -124,27 +156,9 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire) ...@@ -124,27 +156,9 @@ GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire)
Msg::Error("More than two degenerated edges in one model face"); Msg::Error("More than two degenerated edges in one model face");
} }
GEdgeSigned *prevOne = 0; while (!wire.empty()){
GEdgeSigned ges(0,0); printf("wire.size = %d\n",wire.size());
loopTheLoop(wire,loop,&degeneratedToInsert);
while(wire.size()){ // break;
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);
} }
} }
Mesh.SmoothRatio=21.5;
lc = 0.1; lc = 0.1;
a = 1.0; a = 1.0;
b = 1.0; b = 1.0;
h = 1.0; h = 1.0;
refine = 0.0000001; refine = 0.00001;
Point(1) = {0, 0, 0, lc*refine}; Point(1) = {0, 0, 0, lc*refine};
Point(2) = {a, 0, 0, lc} ; Point(2) = {a, 0, 0, lc} ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment