Skip to content
Snippets Groups Projects
Commit b7a888c5 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

GEdge : do not consider closed multi-lines as degenerated

parent 3e727711
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,9 @@ gmshEdge::gmshEdge(GModel *m, Curve *edge, GVertex *v1, GVertex *v2)
bool gmshEdge::degenerate(int dim) const
{
if (c->beg == c->end && c->Typ == MSH_SEGM_LINE){
if (c->beg == c->end &&
c->Typ == MSH_SEGM_LINE &&
List_Nbr(c->Control_Points) == 0){
Msg::Info("Model Edge %d is degenerate", tag());
return true;
}
......
......@@ -371,7 +371,10 @@ void meshGEdge::operator() (GEdge *ge)
// first compute the length of the curve by integrating one
double length;
std::vector<IntPoint> Points;
if(ge->geomType() == GEntity::Line && ge->getBeginVertex() == ge->getEndVertex())
if(ge->geomType() == GEntity::Line &&
ge->getBeginVertex() == ge->getEndVertex() &&
//do not consider closed lines as degenerated
(ge->position(0.5) - ge->getBeginVertex()->xyz()).norm() < CTX::instance()->geom.tolerance)
length = 0.; // special case t avoid infinite loop in integration
else
length = Integration(ge, t_begin, t_end, F_One, Points, 1.e-8 * CTX::instance()->lc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment