Skip to content
Snippets Groups Projects
Commit e7538670 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

- fixed infinite loop in edge loop creation (when the loop is wrong, just print
 a message and abort)

- introduced options to control healing of OCC models
parent 5bc14f7d
No related branches found
No related tags found
No related merge requests found
// $Id: GEdgeLoop.cpp,v 1.4 2006-11-27 22:22:12 geuzaine Exp $ // $Id: GEdgeLoop.cpp,v 1.5 2007-01-19 15:34:05 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -33,8 +33,7 @@ int countInList ( std::list<GEdge*> &wire , GEdge *ge) ...@@ -33,8 +33,7 @@ int countInList ( std::list<GEdge*> &wire , GEdge *ge)
std::list<GEdge*>::iterator it = wire.begin(); std::list<GEdge*>::iterator it = wire.begin();
std::list<GEdge*>::iterator ite = wire.end(); std::list<GEdge*>::iterator ite = wire.end();
int count = 0; int count = 0;
while (it != ite) while(it != ite){
{
if(*it == ge) count++; if(*it == ge) count++;
++it; ++it;
} }
...@@ -43,9 +42,7 @@ int countInList ( std::list<GEdge*> &wire , GEdge *ge) ...@@ -43,9 +42,7 @@ int countInList ( std::list<GEdge*> &wire , GEdge *ge)
GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire) GEdgeSigned nextOne(GEdgeSigned *thisOne, std::list<GEdge*> &wire)
{ {
if(!thisOne){
if (!thisOne)
{
GEdge *ge = *(wire.begin()); GEdge *ge = *(wire.begin());
wire.erase(wire.begin()); wire.erase(wire.begin());
return GEdgeSigned(1, ge); return GEdgeSigned(1, ge);
...@@ -57,8 +54,7 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire) ...@@ -57,8 +54,7 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire)
std::list<GEdge*>::iterator it = wire.begin(); std::list<GEdge*>::iterator it = wire.begin();
std::list<GEdge*>::iterator ite = wire.end(); std::list<GEdge*>::iterator ite = wire.end();
while (it != ite) while(it != ite){
{
GEdge *ge = *it; GEdge *ge = *it;
GVertex *v1 = ge->getBeginVertex(); GVertex *v1 = ge->getBeginVertex();
GVertex *v2 = ge->getEndVertex(); GVertex *v2 = ge->getEndVertex();
...@@ -67,12 +63,11 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire) ...@@ -67,12 +63,11 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire)
} }
it = possibleChoices.begin(); it = possibleChoices.begin();
ite = possibleChoices.end(); ite = possibleChoices.end();
while (it != ite) while(it != ite){
{
GEdge *ge = *it; GEdge *ge = *it;
if (countInList (possibleChoices , ge) == 2) if(countInList(possibleChoices, ge) == 2){
{ wire.erase(std::remove_if(wire.begin(), wire.end(),
wire.erase(std::remove_if(wire.begin(),wire.end() , std::bind2nd(std::equal_to<GEdge*>(), ge)) , std::bind2nd(std::equal_to<GEdge*>(), ge)),
wire.end()); wire.end());
wire.push_back(ge); wire.push_back(ge);
GVertex *v1 = ge->getBeginVertex(); GVertex *v1 = ge->getBeginVertex();
...@@ -85,12 +80,11 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire) ...@@ -85,12 +80,11 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire)
} }
it = possibleChoices.begin(); it = possibleChoices.begin();
ite = possibleChoices.end(); ite = possibleChoices.end();
while (it != ite) while(it != ite){
{
GEdge *ge = *it; GEdge *ge = *it;
if (ge != thisOne->ge) if(ge != thisOne->ge){
{ wire.erase(std::remove_if(wire.begin(),wire.end(),
wire.erase(std::remove_if(wire.begin(),wire.end() , std::bind2nd(std::equal_to<GEdge*>(), ge)) , std::bind2nd(std::equal_to<GEdge*>(), ge)),
wire.end()); wire.end());
GVertex *v1 = ge->getBeginVertex(); GVertex *v1 = ge->getBeginVertex();
GVertex *v2 = ge->getEndVertex(); GVertex *v2 = ge->getEndVertex();
...@@ -100,6 +94,9 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire) ...@@ -100,6 +94,9 @@ GEdgeSigned nextOne ( GEdgeSigned *thisOne, std::list<GEdge*> &wire)
} }
++it; ++it;
} }
// should never end up here
return GEdgeSigned(0, 0);
} }
int GEdgeLoop::count(GEdge* ge) const int GEdgeLoop::count(GEdge* ge) const
...@@ -107,8 +104,7 @@ int GEdgeLoop::count (GEdge* ge) const ...@@ -107,8 +104,7 @@ int GEdgeLoop::count (GEdge* ge) const
GEdgeLoop::citer it = begin(); GEdgeLoop::citer it = begin();
GEdgeLoop::citer ite = end(); GEdgeLoop::citer ite = end();
int count = 0; int count = 0;
while (it != ite) while(it != ite){
{
if(it->ge == ge) count++; if(it->ge == ge) count++;
++it; ++it;
} }
...@@ -117,20 +113,20 @@ int GEdgeLoop::count (GEdge* ge) const ...@@ -117,20 +113,20 @@ int GEdgeLoop::count (GEdge* ge) const
GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire) GEdgeLoop::GEdgeLoop(const std::list<GEdge*> &cwire)
{ {
std::list<GEdge*> wire(cwire); std::list<GEdge*> wire(cwire);
GEdgeSigned *prevOne = 0; GEdgeSigned *prevOne = 0;
Msg(INFO,"Building a wire"); Msg(INFO,"Building a wire");
GEdgeSigned ges(0,0); GEdgeSigned ges(0,0);
while (wire.size()) while(wire.size()){
{
ges = nextOne(prevOne, wire); ges = nextOne(prevOne, wire);
if(ges.getSign() == 0){ // oops
Msg(WARNING, "Something wrong in edge loop?");
break;
}
prevOne = &ges; prevOne = &ges;
ges.print(); ges.print();
loop.push_back(ges); loop.push_back(ges);
} }
} }
...@@ -39,6 +39,7 @@ struct GEdgeSigned ...@@ -39,6 +39,7 @@ struct GEdgeSigned
return (_sign!=1)?ge->getBeginVertex():ge->getEndVertex(); return (_sign!=1)?ge->getBeginVertex():ge->getEndVertex();
} }
void print() const; void print() const;
int getSign(){return _sign;}
}; };
class GEdgeLoop class GEdgeLoop
......
// $Id: meshGFace.cpp,v 1.51 2007-01-17 08:14:23 geuzaine Exp $ // $Id: meshGFace.cpp,v 1.52 2007-01-19 15:34:05 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -1445,6 +1445,10 @@ void orientMeshGFace::operator()(GFace *gf) ...@@ -1445,6 +1445,10 @@ void orientMeshGFace::operator()(GFace *gf)
{ {
if(gf->geomType() == GEntity::ProjectionSurface) return; if(gf->geomType() == GEntity::ProjectionSurface) return;
// orientation of opencascade surfaces are not consistent with
// orientation of bounding edges: should do something else
//if(gf->getNativeType() == GEntity::OpenCascadeModel) return;
// in old versions we did not reorient transfinite surface meshes; // in old versions we did not reorient transfinite surface meshes;
// we could add the following to provide backward compatibility: // we could add the following to provide backward compatibility:
// if(gf->meshAttributes.Method == TRANSFINI) return; // if(gf->meshAttributes.Method == TRANSFINI) return;
......
...@@ -13,7 +13,3 @@ Line Loop(5) = {4,1,2,3}; ...@@ -13,7 +13,3 @@ Line Loop(5) = {4,1,2,3};
Plane Surface(6) = {5}; Plane Surface(6) = {5};
Extrude Surface{6, {0.0,1,0}, {0,0.0,0.0}, 1*3.14159/2}; Extrude Surface{6, {0.0,1,0}, {0,0.0,0.0}, 1*3.14159/2};
Coherence;
Surface Loop(29) = {6,15,19,23,27,28};
Volume(30) = {29};
$Id: TODO,v 1.37 2007-01-18 09:12:45 geuzaine Exp $ $Id: TODO,v 1.38 2007-01-19 15:34:05 geuzaine Exp $
******************************************************************** ********************************************************************
...@@ -6,6 +6,11 @@ introduce Right/Left/Alternate for extruded meshes ...@@ -6,6 +6,11 @@ introduce Right/Left/Alternate for extruded meshes
******************************************************************** ********************************************************************
color edges depending on number of adjacent surfaces (to check face
sewing w/ tolerance)
********************************************************************
fix second order mesh for periodic surfaces fix second order mesh for periodic surfaces
******************************************************************** ********************************************************************
......
$Id: VERSIONS,v 1.371 2007-01-16 16:58:34 geuzaine Exp $ $Id: VERSIONS,v 1.372 2007-01-19 15:34:05 geuzaine Exp $
2.0: new geometry and mesh databases, with support for STEP and IGES 2.0: new geometry and mesh databases, with support for STEP and IGES
input via OpenCascade; complete rewrite of geometry and mesh drawing input via OpenCascade; complete rewrite of geometry and mesh drawing
code; complete rewrite of mesh I/O layer (with new native binary MSH code; complete rewrite of mesh I/O layer (with new native binary MSH
format and support for import/export of I-deas UNV, Nastran BDF, STL, format and support for import/export of I-deas UNV, Nastran BDF, STL,
Medit MESH and VRML 1.0 files); added support for incomplete second Medit MESH and VRML 1.0 files); added support for incomplete second
order elements; new default 2D mesh algorithm; removed anisotropic order elements; new default 2D and 3D meshing algorithms; improved
algorithm (as well as attractors); removed explicit region number integration of Netgen and TetGen algorithms; removed anisotropic
specification in extrusions; option changes in the graphical interface meshing algorithm (as well as attractors); removed explicit region
are now applied instantaneously; added support for offscreen rendering number specification in extrusions; option changes in the graphical
using OSMesa; added support for SVG output; added string labels for interface are now applied instantaneously; added support for offscreen
Physical entities; lots of other improvements all over the place. rendering using OSMesa; added support for SVG output; added string
labels for Physical entities; lots of other improvements all over the
place.
1.65 (May 15, 2006): new Plugin(ExtractEdges); fixed compilation 1.65 (May 15, 2006): new Plugin(ExtractEdges); fixed compilation
errors with gcc4.1; replaced Plugin(DisplacementRaise) and errors with gcc4.1; replaced Plugin(DisplacementRaise) and
...@@ -486,4 +488,3 @@ in rotations; changed default window sizes for better match with ...@@ -486,4 +488,3 @@ in rotations; changed default window sizes for better match with
0.982: lighting for mesh and post-processing; corrected 2nd order mesh 0.982: lighting for mesh and post-processing; corrected 2nd order mesh
on non plane surfaces; added example 13. on non plane surfaces; added example 13.
...@@ -251,17 +251,17 @@ thumbnail"></a> ...@@ -251,17 +251,17 @@ thumbnail"></a>
<h2><a name="Links"></a>Links</h2> <h2><a name="Links"></a>Links</h2>
Gmsh can be linked Gmsh can be linked with
with <a href="http://www.opencascade.org">OpenCascade</a> to provide <a href="http://www.opencascade.org">OpenCascade</a> to provide
support for STEP, IGES and BREP files. Gmsh can also be linked with several support for STEP, IGES and BREP files. Gmsh can also be linked with
external mesh generators (currently several external mesh generators (currently
<!-- a href="http://www-2.cs.cmu.edu/~quake/triangle.html">Triangle</a> from Jonathan Shewchuk,--> <a href="http://www-2.cs.cmu.edu/~quake/triangle.html">Triangle</a> from Jonathan Shewchuk,
<a href="http://www.hpfem.jku.at/netgen/">Netgen</a> from Joachim Sch&ouml;berl and <a href="http://www.hpfem.jku.at/netgen/">Netgen</a> from Joachim Sch&ouml;berl and
<a href="http://tetgen.berlios.de/index.html">TetGen</a> from Hang Si). <a href="http://tetgen.berlios.de/index.html">TetGen</a> from Hang Si).
<p> <p>
Gmsh's high quality vector PostScript and PDF output is produced by <a Gmsh's high quality vector PostScript, PDF and SVG output is produced
href="/gl2ps/">GL2PS</a>. by <a href="/gl2ps/">GL2PS</a>.
<p> <p>
Gmsh's cross-platform graphical user interface is based on <a Gmsh's cross-platform graphical user interface is based on <a
......
...@@ -94,6 +94,11 @@ Enable alpha blending (transparency) in post-processing views@* ...@@ -94,6 +94,11 @@ Enable alpha blending (transparency) in post-processing views@*
Default value: @code{1}@* Default value: @code{1}@*
Saved in: @code{General.OptionsFileName} Saved in: @code{General.OptionsFileName}
@item General.Antialiasing
Use multisample antialiasing (will slow down rendering)@*
Default value: @code{0}@*
Saved in: @code{General.OptionsFileName}
@item General.ArrowHeadRadius @item General.ArrowHeadRadius
Relative radius of arrow head@* Relative radius of arrow head@*
Default value: @code{0.12}@* Default value: @code{0.12}@*
......
...@@ -54,6 +54,21 @@ Display size of normal vectors (in pixels)@* ...@@ -54,6 +54,21 @@ Display size of normal vectors (in pixels)@*
Default value: @code{0}@* Default value: @code{0}@*
Saved in: @code{General.OptionsFileName} Saved in: @code{General.OptionsFileName}
@item Geometry.OCCFixSmallEdges
Fix small edges in OpenCascade models@*
Default value: @code{1}@*
Saved in: @code{General.OptionsFileName}
@item Geometry.OCCFixSmallFaces
Fix small faces in OpenCascade models@*
Default value: @code{1}@*
Saved in: @code{General.OptionsFileName}
@item Geometry.OCCSewFaces
Sew faces in OpenCascade models@*
Default value: @code{0}@*
Saved in: @code{General.OptionsFileName}
@item Geometry.OldCircle @item Geometry.OldCircle
Use old circle description (compatibility option for old Gmsh geometries)@* Use old circle description (compatibility option for old Gmsh geometries)@*
Default value: @code{0}@* Default value: @code{0}@*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment