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

don't crash if no begin vertex

parent 477e6846
No related branches found
No related tags found
No related merge requests found
...@@ -563,11 +563,12 @@ void meshGEdge::operator() (GEdge *ge) ...@@ -563,11 +563,12 @@ void meshGEdge::operator() (GEdge *ge)
// first compute the length of the curve by integrating one // first compute the length of the curve by integrating one
double length; double length;
std::vector<IntPoint> Points; std::vector<IntPoint> Points;
if(ge->geomType() == GEntity::Line && if(ge->geomType() == GEntity::Line && ge->getBeginVertex() &&
ge->getBeginVertex() == ge->getEndVertex() && ge->getBeginVertex() == ge->getEndVertex() &&
//do not consider closed lines as degenerated // do not consider closed lines as degenerated
(ge->position(0.5) - ge->getBeginVertex()->xyz()).norm() < CTX::instance()->geom.tolerance) (ge->position(0.5) - ge->getBeginVertex()->xyz()).norm() <
length = 0.; // special case t avoid infinite loop in integration CTX::instance()->geom.tolerance)
length = 0.; // special case to avoid infinite loop in integration
else else
length = Integration(ge, t_begin, t_end, F_One, Points, 1.e-12 * CTX::instance()->lc); length = Integration(ge, t_begin, t_end, F_One, Points, 1.e-12 * CTX::instance()->lc);
ge->setLength(length); ge->setLength(length);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment